From 0eb6319692a7a121c2bea12e88b25b11db4f55eb Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 13 Sep 2024 16:16:59 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.396.7 --- .speakeasy/workflow.lock | 14 + .speakeasy/workflow.yaml | 2 + lending/.speakeasy/gen.lock | 12441 ++++++++++++++-- lending/.speakeasy/gen.yaml | 8 +- lending/CONTRIBUTING.md | 26 + lending/README.md | 514 +- lending/RELEASES.md | 12 +- lending/USAGE.md | 8 +- lending/accountbalances.go | 193 +- lending/accounts.go | 381 +- lending/accountspayable.go | 2 +- lending/accountsreceivable.go | 2 +- lending/accounttransactions.go | 385 +- lending/balancesheet.go | 381 +- lending/bankaccounts.go | 384 +- lending/banking.go | 2 +- lending/bankstatements.go | 1231 ++ lending/banktransactions.go | 384 +- lending/billcreditnotes.go | 381 +- lending/billpayments.go | 381 +- lending/bills.go | 962 +- lending/cashflow.go | 193 +- lending/categorizedstatement.go | 193 +- lending/codatlending.go | 110 +- lending/codatlendingaccountingbankdata.go | 195 +- lending/codatlendingaccounts.go | 381 +- lending/codatlendingbankingtransactions.go | 381 +- lending/codatlendingcustomers.go | 381 +- lending/codatlendingdirectcosts.go | 954 +- ...codatlendingfinancialstatementsaccounts.go | 381 +- lending/codatlendingloanwritebackaccounts.go | 384 +- lending/codatlendingpayments.go | 384 +- lending/codatlendingreports.go | 381 +- lending/codatlendingsalespayments.go | 381 +- lending/codatlendingsuppliers.go | 384 +- lending/codatlendingtransactions.go | 381 +- lending/codatlendingtransfers.go | 381 +- lending/companies.go | 947 +- lending/companyinfo.go | 381 +- lending/connections.go | 939 +- lending/createoperations.go | 381 +- lending/creditnotes.go | 381 +- lending/customers.go | 954 +- lending/dataintegrity.go | 569 +- lending/directcosts.go | 384 +- lending/directincomes.go | 954 +- lending/disputes.go | 381 +- .../operations/createcompanyresponse.md | 12 +- .../operations/createconnectionresponse.md | 12 +- .../operations/createsupplierrequest.md | 14 +- .../endbankstatementuploadsessionrequest.md | 11 + .../endbankstatementuploadsessionresponse.md | 10 + ...etaccountingagedcreditorsreportresponse.md | 12 +- .../getaccountingageddebtorsreportresponse.md | 12 +- .../getaccountingbillcreditnoteresponse.md | 12 +- .../getaccountingbillpaymentresponse.md | 12 +- .../getaccountingcreditnoteresponse.md | 12 +- .../getaccountingprofileresponse.md | 12 +- .../getaccountingsupplierresponse.md | 12 +- .../operations/getbankingaccountresponse.md | 12 +- .../getbankingtransactioncategoryresponse.md | 12 +- .../getbankingtransactionresponse.md | 12 +- ...bankstatementuploadconfigurationrequest.md | 9 + ...ankstatementuploadconfigurationresponse.md | 11 + ...ategorizedbalancesheetstatementresponse.md | 12 +- .../getcategorizedbankstatementrequest.md | 2 +- .../getcategorizedbankstatementresponse.md | 12 +- ...tegorizedprofitandlossstatementresponse.md | 12 +- .../operations/getcommercecustomerresponse.md | 12 +- .../operations/getcommercedisputeresponse.md | 12 +- .../operations/getcommercelocationresponse.md | 12 +- .../operations/getcommerceorderresponse.md | 12 +- .../getcommerceproductcategoryresponse.md | 12 +- .../models/operations/getcompanyresponse.md | 12 +- .../operations/getconnectionresponse.md | 12 +- .../getdataintegritysummariesrequest.md | 2 +- .../operations/getdatastatusdatastatuses.md | 52 + .../operations/getdatastatusresponse.md | 12 +- .../operations/getloansummaryresponse.md | 12 +- .../operations/getpulloperationresponse.md | 12 +- .../listaccountingaccountsrequest.md | 2 +- .../listaccountingaccountsresponse.md | 12 +- ...istaccountingaccounttransactionsrequest.md | 2 +- ...staccountingaccounttransactionsresponse.md | 12 +- .../listaccountingbankaccountsrequest.md | 2 +- .../listaccountingbankaccountsresponse.md | 12 +- ...ccountingbankaccounttransactionsrequest.md | 2 +- ...countingbankaccounttransactionsresponse.md | 12 +- .../listaccountingbillcreditnotesrequest.md | 2 +- .../listaccountingbillcreditnotesresponse.md | 12 +- .../listaccountingbillpaymentsrequest.md | 2 +- .../listaccountingbillpaymentsresponse.md | 12 +- .../operations/listaccountingbillsrequest.md | 2 +- .../operations/listaccountingbillsresponse.md | 12 +- .../listaccountingcreditnotesrequest.md | 2 +- .../listaccountingcreditnotesresponse.md | 12 +- .../listaccountingcustomersrequest.md | 2 +- .../listaccountingcustomersresponse.md | 12 +- .../listaccountingdirectcostsrequest.md | 2 +- .../listaccountingdirectcostsresponse.md | 12 +- .../listaccountingdirectincomesrequest.md | 2 +- .../listaccountingdirectincomesresponse.md | 12 +- .../listaccountinginvoicesrequest.md | 2 +- .../listaccountinginvoicesresponse.md | 12 +- .../listaccountingjournalentriesrequest.md | 2 +- .../listaccountingjournalentriesresponse.md | 12 +- .../listaccountingjournalsrequest.md | 2 +- .../listaccountingjournalsresponse.md | 12 +- .../listaccountingpaymentsrequest.md | 2 +- .../listaccountingpaymentsresponse.md | 12 +- .../listaccountingsuppliersrequest.md | 2 +- .../listaccountingsuppliersresponse.md | 12 +- .../listaccountingtransfersrequest.md | 2 +- .../listaccountingtransfersresponse.md | 12 +- .../listbankingaccountbalancesrequest.md | 2 +- .../listbankingaccountbalancesresponse.md | 12 +- .../operations/listbankingaccountsrequest.md | 2 +- .../operations/listbankingaccountsresponse.md | 12 +- ...listbankingtransactioncategoriesrequest.md | 2 +- ...istbankingtransactioncategoriesresponse.md | 12 +- .../listbankingtransactionsrequest.md | 2 +- .../listbankingtransactionsresponse.md | 12 +- .../listcommercecustomersrequest.md | 2 +- .../listcommercecustomersresponse.md | 12 +- .../operations/listcommercedisputesrequest.md | 2 +- .../listcommercedisputesresponse.md | 12 +- .../listcommercelocationsresponse.md | 12 +- .../operations/listcommerceordersrequest.md | 2 +- .../operations/listcommerceordersresponse.md | 12 +- .../listcommercepaymentmethodsrequest.md | 2 +- .../listcommercepaymentmethodsresponse.md | 12 +- .../operations/listcommercepaymentsrequest.md | 2 +- .../listcommercepaymentsresponse.md | 12 +- .../listcommerceproductcategoriesrequest.md | 2 +- .../listcommerceproductcategoriesresponse.md | 12 +- .../operations/listcommerceproductsrequest.md | 2 +- .../listcommerceproductsresponse.md | 12 +- .../listcommercetransactionsrequest.md | 2 +- .../listcommercetransactionsresponse.md | 12 +- .../models/operations/listcompaniesrequest.md | 2 +- .../operations/listcompaniesresponse.md | 12 +- .../operations/listconnectionsrequest.md | 2 +- .../operations/listconnectionsresponse.md | 12 +- .../operations/listcreateoperationsrequest.md | 2 +- .../listcreateoperationsresponse.md | 12 +- .../listdataintegritydetailsrequest.md | 2 +- .../listdataintegritydetailsresponse.md | 12 +- .../listloantransactionsresponse.md | 12 +- .../operations/listpulloperationsrequest.md | 2 +- .../operations/listpulloperationsresponse.md | 12 +- .../listreconciledinvoicesrequest.md | 2 +- lending/docs/pkg/models/operations/option.md | 4 +- .../operations/refreshdatatyperequest.md | 2 +- .../operations/refreshdatatyperesponse.md | 12 +- ...bankstatementuploadconfigurationrequest.md | 10 + ...ankstatementuploadconfigurationresponse.md | 11 + .../startbankstatementuploadsessionrequest.md | 10 + ...startbankstatementuploadsessionresponse.md | 11 + .../operations/unlinkconnectionresponse.md | 12 +- .../operations/updatecompanyresponse.md | 12 +- .../uploadbankstatementdatarequest.md | 12 + .../uploadbankstatementdatarequestbody.md | 23 + .../uploadbankstatementdataresponse.md | 10 + .../docs/pkg/models/shared/accountbalance.md | 2 +- .../shared/accountcategoriesupdatedwebhook.md | 24 +- .../accountcategoriesupdatedwebhookdata.md | 6 +- .../pkg/models/shared/accountingaccount.md | 2 +- .../pkg/models/shared/accountingaccounts.md | 14 +- .../shared/accountingaccounttransaction.md | 34 +- .../shared/accountingaccounttransactions.md | 14 +- .../accountingaccounttransactionstatus.md | 13 + .../shared/accountingagedcreditorreport.md | 2 +- .../shared/accountingageddebtorreport.md | 2 +- .../pkg/models/shared/accountingattachment.md | 4 +- .../models/shared/accountingbalancesheet.md | 4 +- .../models/shared/accountingbankaccount.md | 9 +- .../models/shared/accountingbankaccounts.md | 14 +- .../shared/accountingbanktransaction.md | 4 +- .../shared/accountingbanktransactions.md | 14 +- .../docs/pkg/models/shared/accountingbill.md | 48 +- .../models/shared/accountingbillcreditnote.md | 49 +- .../shared/accountingbillcreditnotes.md | 14 +- .../models/shared/accountingbillpayment.md | 40 +- .../models/shared/accountingbillpayments.md | 14 +- .../docs/pkg/models/shared/accountingbills.md | 14 +- .../models/shared/accountingcompanyinfo.md | 8 +- .../shared/accountingcreateaccountresponse.md | 2 +- ...gcreateaccountresponseaccountingaccount.md | 2 +- .../accountingcreatebankaccountresponse.md | 2 +- ...ankaccountresponseaccountingbankaccount.md | 9 +- ...ccountingcreatebanktransactionsresponse.md | 2 +- .../accountingcreatedirectcostresponse.md | 2 +- ...edirectcostresponseaccountingdirectcost.md | 38 +- ...reatedirectcostresponsecontactreference.md | 11 - ...ountingcreatedirectcostresponsedatatype.md | 11 - .../shared/accountingcreatepaymentresponse.md | 2 +- ...gcreatepaymentresponseaccountingpayment.md | 38 +- .../accountingcreatesupplierresponse.md | 4 +- ...reatesupplierresponseaccountingsupplier.md | 4 +- .../accountingcreatetransferresponse.md | 2 +- ...reatetransferresponseaccountingtransfer.md | 4 +- .../pkg/models/shared/accountingcreditnote.md | 52 +- .../models/shared/accountingcreditnotes.md | 14 +- .../pkg/models/shared/accountingcustomer.md | 4 +- .../pkg/models/shared/accountingcustomers.md | 14 +- .../pkg/models/shared/accountingdirectcost.md | 38 +- .../accountingdirectcostcontactreference.md | 11 - .../shared/accountingdirectcostdatatype.md | 11 - .../models/shared/accountingdirectcosts.md | 14 +- .../models/shared/accountingdirectincome.md | 38 +- .../models/shared/accountingdirectincomes.md | 14 +- .../pkg/models/shared/accountinginvoice.md | 56 +- .../pkg/models/shared/accountinginvoices.md | 14 +- .../pkg/models/shared/accountingjournal.md | 2 +- .../models/shared/accountingjournalentries.md | 14 +- .../models/shared/accountingjournalentry.md | 4 +- .../pkg/models/shared/accountingjournals.md | 14 +- .../pkg/models/shared/accountingpayment.md | 38 +- .../pkg/models/shared/accountingpayments.md | 14 +- .../shared/accountingprofitandlossreport.md | 4 +- .../pkg/models/shared/accountingsupplier.md | 4 +- .../pkg/models/shared/accountingsuppliers.md | 14 +- .../pkg/models/shared/accountingtransfer.md | 4 +- .../pkg/models/shared/accountingtransfers.md | 14 +- .../pkg/models/shared/accountprototype.md | 2 +- lending/docs/pkg/models/shared/accounts.md | 2 +- lending/docs/pkg/models/shared/allocation.md | 12 +- .../docs/pkg/models/shared/balancesheet.md | 4 +- .../pkg/models/shared/bankaccountstatus.md | 13 + .../models/shared/bankingaccountbalances.md | 14 +- .../docs/pkg/models/shared/bankingaccounts.md | 14 +- .../shared/bankingtransactioncategories.md | 14 +- .../pkg/models/shared/bankingtransactions.md | 14 +- .../bankstatementuploadconfiguration.md | 12 + .../models/shared/billcreditnotelineitem.md | 4 +- .../docs/pkg/models/shared/billedtotype1.md | 12 - .../pkg/models/shared/billlineitemdatatype.md | 3 +- .../pkg/models/shared/billpaymentlinelink.md | 12 +- .../pkg/models/shared/cashflowstatement.md | 4 +- .../shared/clientratelimitreachedwebhook.md | 18 +- .../shared/clientratelimitresetwebhook.md | 18 +- .../shared/clientratelimitresetwebhookdata.md | 2 +- .../models/shared/clientratelimitwebhook.md | 11 + .../shared/clientratelimitwebhookpayload.md | 10 + lending/docs/pkg/models/shared/codatfile.md | 2 +- .../pkg/models/shared/commercecompanyinfo.md | 4 +- .../pkg/models/shared/commercecustomers.md | 14 +- .../docs/pkg/models/shared/commercedispute.md | 2 +- .../pkg/models/shared/commercedisputes.md | 14 +- .../pkg/models/shared/commercelocations.md | 14 +- .../docs/pkg/models/shared/commerceorder.md | 2 +- .../docs/pkg/models/shared/commerceorders.md | 14 +- .../docs/pkg/models/shared/commercepayment.md | 4 +- .../models/shared/commercepaymentmethods.md | 14 +- .../pkg/models/shared/commercepayments.md | 14 +- .../docs/pkg/models/shared/commerceproduct.md | 2 +- .../shared/commerceproductcategories.md | 14 +- .../pkg/models/shared/commerceproducts.md | 14 +- .../pkg/models/shared/commercetransaction.md | 4 +- .../pkg/models/shared/commercetransactions.md | 14 +- lending/docs/pkg/models/shared/companies.md | 14 +- lending/docs/pkg/models/shared/company.md | 5 +- .../pkg/models/shared/companyrequestbody.md | 2 +- lending/docs/pkg/models/shared/connection.md | 2 +- lending/docs/pkg/models/shared/connections.md | 14 +- lending/docs/pkg/models/shared/contactref.md | 2 - .../pkg/models/shared/contactreference.md | 10 +- .../shared/createbankaccounttransaction.md | 2 +- .../pkg/models/shared/dataconnectionerror.md | 8 +- .../pkg/models/shared/dataintegritydetails.md | 14 +- .../docs/pkg/models/shared/datasetstatus.md | 30 + lending/docs/pkg/models/shared/datastatus.md | 4 +- lending/docs/pkg/models/shared/datatype.md | 2 +- lending/docs/pkg/models/shared/datatypes.md | 2 +- .../pkg/models/shared/directcostprototype.md | 28 +- .../shared/directcostprototypedatatype.md | 11 - .../models/shared/enduploadsessionrequest.md | 8 + .../shared/enduploadsessionrequeststatus.md | 11 + .../shared/enhancedcashflowtransaction.md | 6 +- .../shared/enhancedcashflowtransactions.md | 10 +- .../shared/enhancedinvoicereportitem.md | 2 +- .../models/shared/enhancedinvoicesreport.md | 10 +- lending/docs/pkg/models/shared/errorstatus.md | 11 + .../docs/pkg/models/shared/itemreference.md | 4 +- lending/docs/pkg/models/shared/items.md | 7 +- lending/docs/pkg/models/shared/journalline.md | 1 + .../pkg/models/shared/journallinedatatype.md | 11 + .../models/shared/loansummaryreportitem.md | 2 +- .../pkg/models/shared/loantransactions.md | 2 +- lending/docs/pkg/models/shared/path.md | 8 + lending/docs/pkg/models/shared/payment.md | 18 +- .../models/shared/paymentallocationpayment.md | 20 +- .../docs/pkg/models/shared/paymentlinelink.md | 12 +- .../pkg/models/shared/paymentmethodref.md | 2 +- lending/docs/pkg/models/shared/phonenumber.md | 2 +- .../pkg/models/shared/profitandlossreport.md | 10 +- .../pkg/models/shared/propertieitemref.md | 4 +- .../docs/pkg/models/shared/pulloperation.md | 4 +- .../docs/pkg/models/shared/pulloperations.md | 14 +- .../pkg/models/shared/pulloperationstatus.md | 32 - .../models/shared/purchaseorderreference.md | 4 +- .../docs/pkg/models/shared/pushoperation.md | 2 +- .../pkg/models/shared/pushoperationref.md | 2 +- .../docs/pkg/models/shared/pushoperations.md | 14 +- lending/docs/pkg/models/shared/reportitems.md | 2 +- lending/docs/pkg/models/shared/reportline.md | 2 +- .../docs/pkg/models/shared/reportlineinput.md | 11 - .../docs/pkg/models/shared/schemadatatype.md | 2 +- lending/docs/pkg/models/shared/source.md | 10 + .../shared/startuploadsessionrequest.md | 8 + .../startuploadsessionrequestdatatype.md | 11 + lending/docs/pkg/models/shared/status.md | 31 +- .../pkg/models/shared/supplementaldata.md | 8 +- lending/docs/pkg/models/shared/tags.md | 9 + .../models/shared/taxcomponentallocation.md | 8 +- .../docs/pkg/models/shared/taxcomponentref.md | 2 +- lending/docs/pkg/models/shared/taxrateref.md | 4 +- .../pkg/models/shared/taxratereference.md | 4 +- .../pkg/models/shared/transactioncategory.md | 3 +- .../pkg/models/shared/withholdingtaxitems.md | 9 - lending/docs/pkg/models/shared/zero.md | 14 + .../docs/pkg/models/shared/zerodatatype.md | 11 + .../clientratelimitreachedresponse1.md | 10 + .../webhooks/clientratelimitresetresponse1.md | 10 + lending/docs/sdks/accountbalances/README.md | 8 +- lending/docs/sdks/accounts/README.md | 16 +- lending/docs/sdks/accountspayable/README.md | 5 +- .../docs/sdks/accountsreceivable/README.md | 5 +- .../docs/sdks/accounttransactions/README.md | 20 +- lending/docs/sdks/balancesheet/README.md | 13 +- lending/docs/sdks/bankaccounts/README.md | 19 +- lending/docs/sdks/banking/README.md | 5 +- lending/docs/sdks/bankstatements/README.md | 338 + lending/docs/sdks/banktransactions/README.md | 25 +- lending/docs/sdks/billcreditnotes/README.md | 16 +- lending/docs/sdks/billpayments/README.md | 16 +- lending/docs/sdks/bills/README.md | 51 +- lending/docs/sdks/cashflow/README.md | 7 +- .../docs/sdks/categorizedstatement/README.md | 8 +- lending/docs/sdks/codatlending/README.md | 44 +- .../codatlendingaccountingbankdata/README.md | 10 +- .../docs/sdks/codatlendingaccounts/README.md | 16 +- .../codatlendingbankingtransactions/README.md | 16 +- .../docs/sdks/codatlendingcustomers/README.md | 16 +- .../sdks/codatlendingdirectcosts/README.md | 40 +- .../README.md | 16 +- .../README.md | 25 +- .../docs/sdks/codatlendingpayments/README.md | 50 +- .../docs/sdks/codatlendingreports/README.md | 25 +- .../sdks/codatlendingsalespayments/README.md | 16 +- .../docs/sdks/codatlendingsuppliers/README.md | 52 +- .../sdks/codatlendingtransactions/README.md | 16 +- .../docs/sdks/codatlendingtransfers/README.md | 16 +- lending/docs/sdks/companies/README.md | 51 +- lending/docs/sdks/companyinfo/README.md | 11 +- lending/docs/sdks/connections/README.md | 41 +- lending/docs/sdks/createoperations/README.md | 14 +- lending/docs/sdks/creditnotes/README.md | 16 +- lending/docs/sdks/customers/README.md | 40 +- lending/docs/sdks/dataintegrity/README.md | 19 +- lending/docs/sdks/directcosts/README.md | 84 +- lending/docs/sdks/directincomes/README.md | 40 +- lending/docs/sdks/disputes/README.md | 16 +- lending/docs/sdks/excelreports/README.md | 17 +- lending/docs/sdks/fileupload/README.md | 26 +- .../docs/sdks/financialstatements/README.md | 5 +- lending/docs/sdks/invoices/README.md | 65 +- lending/docs/sdks/journalentries/README.md | 16 +- lending/docs/sdks/journals/README.md | 16 +- lending/docs/sdks/liabilities/README.md | 29 +- lending/docs/sdks/loanwriteback/README.md | 5 +- lending/docs/sdks/locations/README.md | 15 +- lending/docs/sdks/managedata/README.md | 7 +- lending/docs/sdks/metrics/README.md | 37 +- lending/docs/sdks/orders/README.md | 16 +- lending/docs/sdks/paymentmethods/README.md | 16 +- lending/docs/sdks/payments/README.md | 16 +- lending/docs/sdks/productcategories/README.md | 16 +- lending/docs/sdks/products/README.md | 16 +- lending/docs/sdks/profitandloss/README.md | 13 +- lending/docs/sdks/pulloperations/README.md | 14 +- lending/docs/sdks/refresh/README.md | 16 +- lending/docs/sdks/reports/README.md | 25 +- lending/docs/sdks/sales/README.md | 5 +- lending/docs/sdks/suppliers/README.md | 40 +- .../docs/sdks/transactioncategories/README.md | 16 +- lending/docs/sdks/transactions/README.md | 5 +- lending/docs/sdks/transfers/README.md | 52 +- lending/excelreports.go | 577 +- lending/fileupload.go | 567 +- lending/financialstatements.go | 2 +- lending/go.mod | 2 - lending/go.sum | 4 - lending/internal/hooks/hooks.go | 144 + lending/internal/hooks/registration.go | 18 + lending/invoices.go | 1347 +- lending/journalentries.go | 381 +- lending/journals.go | 381 +- lending/liabilities.go | 729 +- lending/loanwriteback.go | 2 +- lending/locations.go | 381 +- lending/managedata.go | 198 +- lending/metrics.go | 569 +- lending/orders.go | 381 +- lending/paymentmethods.go | 381 +- lending/payments.go | 381 +- .../pkg/models/operations/createaccount.go | 2 +- .../models/operations/createbankaccount.go | 2 +- .../operations/createbanktransactions.go | 2 +- .../pkg/models/operations/createcompany.go | 2 +- .../pkg/models/operations/createconnection.go | 2 +- .../pkg/models/operations/createdirectcost.go | 2 +- .../pkg/models/operations/createpayment.go | 2 +- .../pkg/models/operations/createsupplier.go | 2 +- .../pkg/models/operations/createtransfer.go | 2 +- .../pkg/models/operations/deletecompany.go | 2 +- .../pkg/models/operations/deleteconnection.go | 2 +- .../downloadaccountingbillattachment.go | 2 +- .../downloadaccountingcustomerattachment.go | 2 +- .../downloadaccountingdirectcostattachment.go | 2 +- ...ownloadaccountingdirectincomeattachment.go | 2 +- .../downloadaccountinginvoiceattachment.go | 2 +- .../downloadaccountinginvoicepdf.go | 2 +- .../downloadaccountingsupplierattachment.go | 2 +- .../models/operations/downloadexcelreport.go | 2 +- .../pkg/models/operations/downloadfiles.go | 2 +- .../endbankstatementuploadsession.go | 76 + .../models/operations/generateexcelreport.go | 2 +- .../models/operations/generateloansummary.go | 3 +- .../operations/generateloantransactions.go | 3 +- .../models/operations/getaccountingaccount.go | 2 +- .../getaccountingaccounttransaction.go | 2 +- .../getaccountingagedcreditorsreport.go | 2 +- .../getaccountingageddebtorsreport.go | 2 +- .../operations/getaccountingbalancesheet.go | 2 +- .../operations/getaccountingbankaccount.go | 2 +- .../models/operations/getaccountingbill.go | 2 +- .../operations/getaccountingbillattachment.go | 2 +- .../operations/getaccountingbillcreditnote.go | 2 +- .../operations/getaccountingbillpayment.go | 2 +- .../getaccountingcashflowstatement.go | 2 +- .../operations/getaccountingcreditnote.go | 2 +- .../operations/getaccountingcustomer.go | 2 +- .../getaccountingcustomerattachment.go | 2 +- .../operations/getaccountingdirectcost.go | 2 +- .../getaccountingdirectcostattachment.go | 2 +- .../operations/getaccountingdirectincome.go | 2 +- .../getaccountingdirectincomeattachment.go | 2 +- .../models/operations/getaccountinginvoice.go | 2 +- .../getaccountinginvoiceattachment.go | 2 +- .../models/operations/getaccountingjournal.go | 2 +- .../operations/getaccountingjournalentry.go | 2 +- .../models/operations/getaccountingpayment.go | 2 +- .../models/operations/getaccountingprofile.go | 2 +- .../operations/getaccountingprofitandloss.go | 2 +- .../operations/getaccountingsupplier.go | 2 +- .../getaccountingsupplierattachment.go | 2 +- .../operations/getaccountingtransfer.go | 2 +- .../models/operations/getbankingaccount.go | 2 +- .../operations/getbankingtransaction.go | 2 +- .../getbankingtransactioncategory.go | 2 +- .../getbankstatementuploadconfiguration.go | 68 + .../getcategorizedbalancesheetstatement.go | 2 +- .../operations/getcategorizedbankstatement.go | 2 +- .../getcategorizedprofitandlossstatement.go | 2 +- .../models/operations/getcommercecustomer.go | 2 +- .../getcommercecustomerretentionmetrics.go | 2 +- .../models/operations/getcommercedispute.go | 2 +- .../getcommercelifetimevaluemetrics.go | 2 +- .../models/operations/getcommercelocation.go | 2 +- .../pkg/models/operations/getcommerceorder.go | 2 +- .../operations/getcommerceordersreport.go | 2 +- .../models/operations/getcommercepayment.go | 2 +- .../operations/getcommercepaymentmethod.go | 2 +- .../models/operations/getcommerceproduct.go | 2 +- .../operations/getcommerceproductcategory.go | 2 +- .../models/operations/getcommerceprofile.go | 2 +- .../operations/getcommercerefundsreport.go | 2 +- .../operations/getcommercerevenuemetrics.go | 2 +- .../operations/getcommercetransaction.go | 2 +- lending/pkg/models/operations/getcompany.go | 2 +- .../pkg/models/operations/getconnection.go | 2 +- .../getcreatebanktransactionsmodel.go | 2 +- .../getcreatechartofaccountsmodel.go | 2 +- .../operations/getcreatedirectcostsmodel.go | 2 +- .../models/operations/getcreateoperation.go | 2 +- .../operations/getcreatepaymentmodel.go | 2 +- .../operations/getcreatetransfersmodel.go | 2 +- .../getcreateupdatebankaccountsmodel.go | 2 +- .../getcreateupdatesuppliersmodel.go | 2 +- .../operations/getdataintegritystatus.go | 2 +- .../operations/getdataintegritysummaries.go | 2 +- .../pkg/models/operations/getdatastatus.go | 397 +- .../getexcelreportgenerationstatus.go | 2 +- .../pkg/models/operations/getloansummary.go | 3 +- .../pkg/models/operations/getpulloperation.go | 2 +- .../isagedcreditorsreportavailable.go | 2 +- .../isageddebtorsreportavailable.go | 2 +- .../operations/listaccountingaccounts.go | 2 +- .../listaccountingaccounttransactions.go | 2 +- .../operations/listaccountingbankaccounts.go | 2 +- .../listaccountingbankaccounttransactions.go | 2 +- .../listaccountingbillattachments.go | 2 +- .../listaccountingbillcreditnotes.go | 2 +- .../operations/listaccountingbillpayments.go | 2 +- .../models/operations/listaccountingbills.go | 2 +- .../operations/listaccountingcreditnotes.go | 2 +- .../listaccountingcustomerattachments.go | 2 +- .../operations/listaccountingcustomers.go | 2 +- .../listaccountingdirectcostattachments.go | 2 +- .../operations/listaccountingdirectcosts.go | 2 +- .../listaccountingdirectincomeattachments.go | 2 +- .../operations/listaccountingdirectincomes.go | 2 +- .../listaccountinginvoiceattachments.go | 2 +- .../operations/listaccountinginvoices.go | 2 +- .../listaccountingjournalentries.go | 2 +- .../operations/listaccountingjournals.go | 2 +- .../operations/listaccountingpayments.go | 2 +- .../listaccountingsupplierattachments.go | 2 +- .../operations/listaccountingsuppliers.go | 2 +- .../operations/listaccountingtransfers.go | 2 +- .../operations/listbankingaccountbalances.go | 2 +- .../models/operations/listbankingaccounts.go | 2 +- .../listbankingtransactioncategories.go | 2 +- .../operations/listbankingtransactions.go | 2 +- .../operations/listcommercecustomers.go | 2 +- .../models/operations/listcommercedisputes.go | 2 +- .../operations/listcommercelocations.go | 2 +- .../models/operations/listcommerceorders.go | 2 +- .../operations/listcommercepaymentmethods.go | 2 +- .../models/operations/listcommercepayments.go | 2 +- .../listcommerceproductcategories.go | 2 +- .../models/operations/listcommerceproducts.go | 2 +- .../operations/listcommercetransactions.go | 2 +- .../pkg/models/operations/listcompanies.go | 2 +- .../pkg/models/operations/listconnections.go | 2 +- .../models/operations/listcreateoperations.go | 2 +- .../operations/listdataintegritydetails.go | 2 +- lending/pkg/models/operations/listfiles.go | 2 +- .../models/operations/listloantransactions.go | 3 +- .../models/operations/listpulloperations.go | 2 +- .../operations/listreconciledinvoices.go | 2 +- lending/pkg/models/operations/options.go | 36 +- .../models/operations/refreshalldatatypes.go | 2 +- .../pkg/models/operations/refreshdatatype.go | 4 +- .../setbankstatementuploadconfiguration.go | 76 + .../startbankstatementuploadsession.go | 76 + .../pkg/models/operations/unlinkconnection.go | 2 +- .../pkg/models/operations/updatecompany.go | 2 +- .../operations/uploadbankstatementdata.go | 173 + lending/pkg/models/operations/uploadfiles.go | 2 +- lending/pkg/models/sdkerrors/errormessage.go | 2 +- lending/pkg/models/sdkerrors/sdkerror.go | 2 +- lending/pkg/models/shared/accountbalance.go | 6 +- .../models/shared/accountbalanceamounts.go | 2 +- .../shared/accountcategoriesupdatedwebhook.go | 8 +- .../accountcategoriesupdatedwebhookdata.go | 4 +- .../pkg/models/shared/accountcategorylevel.go | 2 +- .../pkg/models/shared/accountidentifiers.go | 2 +- .../models/shared/accountidentifiertype.go | 3 +- .../pkg/models/shared/accountingaccount.go | 4 +- .../pkg/models/shared/accountingaccounts.go | 2 +- .../shared/accountingaccounttransaction.go | 37 +- .../shared/accountingaccounttransactions.go | 2 +- .../pkg/models/shared/accountingaddress.go | 2 +- .../models/shared/accountingaddresstype.go | 3 +- .../shared/accountingagedcreditorreport.go | 4 +- .../shared/accountingageddebtorreport.go | 4 +- .../pkg/models/shared/accountingattachment.go | 6 +- .../models/shared/accountingbalancesheet.go | 6 +- .../models/shared/accountingbankaccount.go | 19 +- .../models/shared/accountingbankaccounts.go | 2 +- .../shared/accountingbankaccounttype.go | 3 +- .../shared/accountingbanktransaction.go | 6 +- .../shared/accountingbanktransactions.go | 2 +- lending/pkg/models/shared/accountingbill.go | 18 +- .../models/shared/accountingbillcreditnote.go | 27 +- .../shared/accountingbillcreditnotes.go | 2 +- .../models/shared/accountingbillpayment.go | 18 +- .../models/shared/accountingbillpayments.go | 2 +- lending/pkg/models/shared/accountingbills.go | 2 +- .../shared/accountingcashflowstatement.go | 2 +- .../models/shared/accountingcompanyinfo.go | 10 +- .../shared/accountingcreateaccountresponse.go | 6 +- .../accountingcreatebankaccountresponse.go | 21 +- .../accountingcreatebanktransactions.go | 2 +- ...ccountingcreatebanktransactionsresponse.go | 4 +- .../accountingcreatedirectcostresponse.go | 71 +- .../shared/accountingcreatepaymentresponse.go | 20 +- .../accountingcreatesupplierresponse.go | 8 +- .../accountingcreatetransferresponse.go | 7 +- .../pkg/models/shared/accountingcreditnote.go | 20 +- .../models/shared/accountingcreditnotes.go | 2 +- .../pkg/models/shared/accountingcustomer.go | 6 +- .../models/shared/accountingcustomerref.go | 2 +- .../pkg/models/shared/accountingcustomers.go | 2 +- .../pkg/models/shared/accountingdirectcost.go | 69 +- .../models/shared/accountingdirectcosts.go | 2 +- .../models/shared/accountingdirectincome.go | 13 +- .../models/shared/accountingdirectincomes.go | 2 +- .../pkg/models/shared/accountinginvoice.go | 21 +- .../pkg/models/shared/accountinginvoices.go | 2 +- .../pkg/models/shared/accountingjournal.go | 4 +- .../models/shared/accountingjournalentries.go | 2 +- .../models/shared/accountingjournalentry.go | 6 +- .../pkg/models/shared/accountingjournals.go | 2 +- .../pkg/models/shared/accountingpayment.go | 18 +- .../shared/accountingpaymentallocation.go | 8 +- .../pkg/models/shared/accountingpayments.go | 2 +- .../shared/accountingprofitandlossreport.go | 6 +- .../pkg/models/shared/accountingsupplier.go | 6 +- .../pkg/models/shared/accountingsuppliers.go | 2 +- .../pkg/models/shared/accountingtransfer.go | 5 +- .../pkg/models/shared/accountingtransfers.go | 2 +- .../pkg/models/shared/accountinstitution.go | 2 +- lending/pkg/models/shared/accountprototype.go | 4 +- lending/pkg/models/shared/accountref.go | 2 +- lending/pkg/models/shared/accounts.go | 2 +- .../models/shared/accountspayabletracking.go | 2 +- .../shared/accountsreceivabletracking.go | 2 +- lending/pkg/models/shared/accountstatus.go | 3 +- .../models/shared/accounttransactionline.go | 2 +- .../shared/accounttransactionlinerecordref.go | 3 +- lending/pkg/models/shared/accounttype.go | 3 +- lending/pkg/models/shared/agedcreditor.go | 2 +- .../models/shared/agedcurrencyoutstanding.go | 2 +- lending/pkg/models/shared/ageddebtor.go | 2 +- .../models/shared/agedoutstandingamount.go | 2 +- .../shared/agedoutstandingamountdetail.go | 2 +- lending/pkg/models/shared/attachments.go | 2 +- lending/pkg/models/shared/balancesheet.go | 12 +- lending/pkg/models/shared/bankaccountref.go | 2 +- .../pkg/models/shared/bankaccountstatus.go | 41 + lending/pkg/models/shared/bankingaccount.go | 2 +- .../models/shared/bankingaccountbalance.go | 2 +- .../models/shared/bankingaccountbalances.go | 2 +- lending/pkg/models/shared/bankingaccounts.go | 2 +- .../pkg/models/shared/bankingtransaction.go | 2 +- .../shared/bankingtransactioncategories.go | 2 +- .../shared/bankingtransactioncategory.go | 2 +- .../models/shared/bankingtransactionref.go | 2 +- .../pkg/models/shared/bankingtransactions.go | 2 +- .../bankstatementuploadconfiguration.go | 63 + .../pkg/models/shared/banktransactiontype.go | 3 +- .../models/shared/billcreditnotelineitem.go | 30 +- .../pkg/models/shared/billcreditnotestatus.go | 3 +- lending/pkg/models/shared/billedtotype.go | 3 +- lending/pkg/models/shared/billedtotype1.go | 3 +- lending/pkg/models/shared/billlineitem.go | 6 +- lending/pkg/models/shared/billpaymentline.go | 2 +- .../pkg/models/shared/billpaymentlinelink.go | 8 +- .../models/shared/billpaymentlinelinktype.go | 3 +- lending/pkg/models/shared/billstatus.go | 3 +- .../pkg/models/shared/cashflowstatement.go | 10 +- .../shared/clientratelimitreachedwebhook.go | 6 +- .../clientratelimitreachedwebhookdata.go | 2 +- .../shared/clientratelimitresetwebhook.go | 6 +- .../shared/clientratelimitresetwebhookdata.go | 4 +- .../models/shared/clientratelimitwebhook.go | 59 + .../shared/clientratelimitwebhookpayload.go | 51 + lending/pkg/models/shared/codatfile.go | 9 +- lending/pkg/models/shared/commerceaddress.go | 2 +- .../pkg/models/shared/commerceaddresstype.go | 3 +- .../pkg/models/shared/commercecompanyinfo.go | 4 +- lending/pkg/models/shared/commercecustomer.go | 2 +- .../pkg/models/shared/commercecustomerref.go | 2 +- .../pkg/models/shared/commercecustomers.go | 2 +- lending/pkg/models/shared/commercedispute.go | 6 +- lending/pkg/models/shared/commercedisputes.go | 2 +- lending/pkg/models/shared/commercelocation.go | 2 +- .../pkg/models/shared/commercelocations.go | 2 +- lending/pkg/models/shared/commerceorder.go | 4 +- lending/pkg/models/shared/commerceorders.go | 2 +- lending/pkg/models/shared/commercepayment.go | 6 +- .../models/shared/commercepaymentmethod.go | 3 +- .../models/shared/commercepaymentmethods.go | 2 +- lending/pkg/models/shared/commercepayments.go | 2 +- lending/pkg/models/shared/commerceproduct.go | 4 +- .../shared/commerceproductcategories.go | 2 +- .../models/shared/commerceproductcategory.go | 2 +- lending/pkg/models/shared/commerceproducts.go | 2 +- .../pkg/models/shared/commercerecordref.go | 2 +- lending/pkg/models/shared/commercereport.go | 2 +- .../models/shared/commercereportcomponent.go | 2 +- .../models/shared/commercereportdimension.go | 2 +- .../pkg/models/shared/commercereporterror.go | 2 +- .../models/shared/commercereportmeasure.go | 2 +- .../pkg/models/shared/commercetransaction.go | 6 +- .../pkg/models/shared/commercetransactions.go | 2 +- lending/pkg/models/shared/companies.go | 2 +- lending/pkg/models/shared/company.go | 41 +- .../pkg/models/shared/companyrequestbody.go | 18 +- lending/pkg/models/shared/connection.go | 7 +- lending/pkg/models/shared/connections.go | 2 +- lending/pkg/models/shared/contact.go | 2 +- lending/pkg/models/shared/contactref.go | 4 +- .../shared/createbankaccounttransaction.go | 4 +- .../pkg/models/shared/creditnotelineitem.go | 2 +- lending/pkg/models/shared/creditnotestatus.go | 3 +- lending/pkg/models/shared/customerstatus.go | 3 +- .../pkg/models/shared/dataconnectionerror.go | 76 +- .../pkg/models/shared/dataconnectionstatus.go | 3 +- .../pkg/models/shared/dataintegrityamounts.go | 2 +- .../models/shared/dataintegritybyamount.go | 2 +- .../pkg/models/shared/dataintegritybycount.go | 2 +- .../shared/dataintegrityconnectionid.go | 2 +- .../models/shared/dataintegritydatatype.go | 3 +- .../pkg/models/shared/dataintegritydates.go | 2 +- .../pkg/models/shared/dataintegritydetail.go | 2 +- .../pkg/models/shared/dataintegritydetails.go | 2 +- .../pkg/models/shared/dataintegritymatch.go | 2 +- .../pkg/models/shared/dataintegritystatus.go | 2 +- .../models/shared/dataintegritystatuses.go | 2 +- .../models/shared/dataintegritystatusinfo.go | 2 +- .../models/shared/dataintegritysummaries.go | 2 +- .../pkg/models/shared/dataintegritysummary.go | 2 +- lending/pkg/models/shared/datasource.go | 2 +- lending/pkg/models/shared/datastatus.go | 15 +- lending/pkg/models/shared/datatype.go | 5 +- .../pkg/models/shared/directcostlineitem.go | 2 +- .../pkg/models/shared/directcostprototype.go | 67 +- .../pkg/models/shared/directincomelineitem.go | 2 +- lending/pkg/models/shared/disputestatus.go | 3 +- .../models/shared/enduploadsessionrequest.go | 47 + .../pkg/models/shared/enhancedcashflowitem.go | 2 +- .../shared/enhancedcashflowtransaction.go | 38 +- .../shared/enhancedcashflowtransactions.go | 2 +- .../models/shared/enhancedfinancialreport.go | 2 +- .../shared/enhancedinvoicereportitem.go | 4 +- .../models/shared/enhancedinvoicesreport.go | 4 +- .../shared/enhancedreportaccountcategory.go | 2 +- .../pkg/models/shared/enhancedreportinfo.go | 2 +- lending/pkg/models/shared/errorvalidation.go | 2 +- .../pkg/models/shared/errorvalidationitem.go | 2 +- lending/pkg/models/shared/excelreporttypes.go | 3 +- lending/pkg/models/shared/excelstatus.go | 2 +- lending/pkg/models/shared/file.go | 2 +- lending/pkg/models/shared/fileupload.go | 2 +- lending/pkg/models/shared/halref.go | 2 +- lending/pkg/models/shared/integritystatus.go | 3 +- lending/pkg/models/shared/invoicelineitem.go | 2 +- lending/pkg/models/shared/invoicestatus.go | 3 +- lending/pkg/models/shared/itemref.go | 2 +- lending/pkg/models/shared/items.go | 37 +- .../models/shared/journalentryrecordref.go | 3 +- lending/pkg/models/shared/journalline.go | 62 +- lending/pkg/models/shared/journalref.go | 2 +- lending/pkg/models/shared/journalstatus.go | 3 +- .../pkg/models/shared/lendingcustomerref.go | 2 +- lending/pkg/models/shared/links.go | 2 +- lending/pkg/models/shared/loanref.go | 2 +- lending/pkg/models/shared/loansummary.go | 2 +- .../shared/loansummaryintegrationtype.go | 3 +- .../pkg/models/shared/loansummaryrecordref.go | 2 +- .../models/shared/loansummaryrecordreftype.go | 3 +- .../models/shared/loansummaryreportinfo.go | 2 +- .../models/shared/loansummaryreportitem.go | 10 +- lending/pkg/models/shared/loantransactions.go | 6 +- .../shared/loantransactionsreportinfo.go | 2 +- lending/pkg/models/shared/locationref.go | 2 +- lending/pkg/models/shared/metadata.go | 2 +- .../models/shared/orderdiscountallocation.go | 2 +- lending/pkg/models/shared/orderlineitem.go | 2 +- lending/pkg/models/shared/path.go | 31 + lending/pkg/models/shared/payment.go | 10 +- .../models/shared/paymentallocationpayment.go | 8 +- lending/pkg/models/shared/paymentline.go | 2 +- lending/pkg/models/shared/paymentlinelink.go | 8 +- lending/pkg/models/shared/paymentlinktype.go | 3 +- lending/pkg/models/shared/paymentmethodref.go | 4 +- lending/pkg/models/shared/paymentref.go | 2 +- lending/pkg/models/shared/paymentstatus.go | 3 +- lending/pkg/models/shared/paymenttype.go | 3 +- lending/pkg/models/shared/periodunit.go | 3 +- lending/pkg/models/shared/phonenumber.go | 4 +- lending/pkg/models/shared/phonenumbertype.go | 3 +- lending/pkg/models/shared/productinventory.go | 2 +- .../models/shared/productinventorylocation.go | 2 +- lending/pkg/models/shared/productprice.go | 2 +- lending/pkg/models/shared/productref.go | 2 +- lending/pkg/models/shared/productvariant.go | 2 +- .../pkg/models/shared/productvariantref.go | 2 +- .../pkg/models/shared/productvariantstatus.go | 3 +- .../pkg/models/shared/profitandlossreport.go | 26 +- lending/pkg/models/shared/projectref.go | 2 +- lending/pkg/models/shared/propertieitemref.go | 6 +- lending/pkg/models/shared/pulloperation.go | 73 +- lending/pkg/models/shared/pulloperations.go | 2 +- lending/pkg/models/shared/pushchangetype.go | 3 +- .../pkg/models/shared/pushfieldvalidation.go | 2 +- lending/pkg/models/shared/pushoperation.go | 4 +- .../pkg/models/shared/pushoperationchange.go | 2 +- lending/pkg/models/shared/pushoperationref.go | 4 +- lending/pkg/models/shared/pushoperations.go | 2 +- .../pkg/models/shared/pushoperationstatus.go | 3 +- lending/pkg/models/shared/pushoption.go | 2 +- lending/pkg/models/shared/pushoptionchoice.go | 2 +- .../pkg/models/shared/pushoptionproperty.go | 2 +- lending/pkg/models/shared/pushoptiontype.go | 3 +- .../pkg/models/shared/pushvalidationinfo.go | 2 +- lending/pkg/models/shared/recordref.go | 2 +- lending/pkg/models/shared/reportbasis.go | 3 +- .../models/shared/reportcomponentmeasure.go | 2 +- lending/pkg/models/shared/reportinfo.go | 2 +- lending/pkg/models/shared/reportinput.go | 3 +- lending/pkg/models/shared/reportitems.go | 11 +- lending/pkg/models/shared/reportline.go | 4 +- lending/pkg/models/shared/reportlineinput.go | 58 - lending/pkg/models/shared/schemadatatype.go | 5 +- lending/pkg/models/shared/security.go | 2 +- lending/pkg/models/shared/servicecharge.go | 2 +- .../pkg/models/shared/servicechargetype.go | 3 +- lending/pkg/models/shared/sourceref.go | 2 +- .../shared/startuploadsessionrequest.go | 47 + lending/pkg/models/shared/status.go | 92 + lending/pkg/models/shared/supplementaldata.go | 8 +- lending/pkg/models/shared/supplierref.go | 2 +- lending/pkg/models/shared/supplierstatus.go | 3 +- .../models/shared/taxcomponentallocation.go | 6 +- lending/pkg/models/shared/taxcomponentref.go | 4 +- lending/pkg/models/shared/taxrateref.go | 6 +- lending/pkg/models/shared/tracking.go | 2 +- .../pkg/models/shared/trackingcategoryref.go | 2 +- .../pkg/models/shared/trackingrecordref.go | 3 +- .../pkg/models/shared/transactioncategory.go | 13 +- .../models/shared/transactioncategoryref.go | 2 +- .../shared/transactioncategorystatus.go | 3 +- lending/pkg/models/shared/transactioncode.go | 3 +- .../pkg/models/shared/transactionsourceref.go | 2 +- .../models/shared/transactionsourcetype.go | 3 +- lending/pkg/models/shared/transactiontype.go | 3 +- lending/pkg/models/shared/transferaccount.go | 2 +- lending/pkg/models/shared/validation.go | 2 +- lending/pkg/models/shared/validationitem.go | 2 +- lending/pkg/models/shared/weblink.go | 3 +- .../pkg/models/shared/withholdingtaxitems.go | 40 - lending/pkg/models/shared/zero.go | 68 + .../webhooks/accountcategoriesupdated.go | 2 +- .../models/webhooks/clientratelimitreached.go | 10 +- .../models/webhooks/clientratelimitreset.go | 10 +- lending/pkg/retry/config.go | 16 + lending/pkg/types/bigint.go | 2 +- lending/pkg/types/date.go | 2 +- lending/pkg/types/datetime.go | 2 +- lending/pkg/types/decimal.go | 2 +- lending/pkg/types/pointers.go | 3 +- lending/pkg/utils/contenttype.go | 6 +- lending/pkg/utils/form.go | 2 +- lending/pkg/utils/headers.go | 32 +- lending/pkg/utils/json.go | 113 +- lending/pkg/utils/pathparams.go | 49 +- lending/pkg/utils/queryparams.go | 183 +- lending/pkg/utils/requestbody.go | 44 +- lending/pkg/utils/retries.go | 23 +- lending/pkg/utils/security.go | 157 +- lending/pkg/utils/utils.go | 90 +- lending/productcategories.go | 381 +- lending/products.go | 381 +- lending/profitandloss.go | 381 +- lending/pulloperations.go | 381 +- lending/refresh.go | 367 +- lending/reports.go | 757 +- lending/sales.go | 2 +- lending/suppliers.go | 954 +- lending/transactioncategories.go | 381 +- lending/transactions.go | 2 +- lending/transfers.go | 384 +- 867 files changed, 39787 insertions(+), 9987 deletions(-) create mode 100644 lending/CONTRIBUTING.md create mode 100644 lending/bankstatements.go create mode 100644 lending/docs/pkg/models/operations/endbankstatementuploadsessionrequest.md create mode 100644 lending/docs/pkg/models/operations/endbankstatementuploadsessionresponse.md create mode 100644 lending/docs/pkg/models/operations/getbankstatementuploadconfigurationrequest.md create mode 100644 lending/docs/pkg/models/operations/getbankstatementuploadconfigurationresponse.md create mode 100644 lending/docs/pkg/models/operations/getdatastatusdatastatuses.md create mode 100644 lending/docs/pkg/models/operations/setbankstatementuploadconfigurationrequest.md create mode 100644 lending/docs/pkg/models/operations/setbankstatementuploadconfigurationresponse.md create mode 100644 lending/docs/pkg/models/operations/startbankstatementuploadsessionrequest.md create mode 100644 lending/docs/pkg/models/operations/startbankstatementuploadsessionresponse.md create mode 100644 lending/docs/pkg/models/operations/uploadbankstatementdatarequest.md create mode 100644 lending/docs/pkg/models/operations/uploadbankstatementdatarequestbody.md create mode 100644 lending/docs/pkg/models/operations/uploadbankstatementdataresponse.md create mode 100644 lending/docs/pkg/models/shared/accountingaccounttransactionstatus.md delete mode 100644 lending/docs/pkg/models/shared/accountingcreatedirectcostresponsecontactreference.md delete mode 100644 lending/docs/pkg/models/shared/accountingcreatedirectcostresponsedatatype.md delete mode 100644 lending/docs/pkg/models/shared/accountingdirectcostcontactreference.md delete mode 100644 lending/docs/pkg/models/shared/accountingdirectcostdatatype.md create mode 100644 lending/docs/pkg/models/shared/bankaccountstatus.md create mode 100644 lending/docs/pkg/models/shared/bankstatementuploadconfiguration.md delete mode 100644 lending/docs/pkg/models/shared/billedtotype1.md create mode 100644 lending/docs/pkg/models/shared/clientratelimitwebhook.md create mode 100644 lending/docs/pkg/models/shared/clientratelimitwebhookpayload.md create mode 100644 lending/docs/pkg/models/shared/datasetstatus.md delete mode 100644 lending/docs/pkg/models/shared/directcostprototypedatatype.md create mode 100644 lending/docs/pkg/models/shared/enduploadsessionrequest.md create mode 100644 lending/docs/pkg/models/shared/enduploadsessionrequeststatus.md create mode 100644 lending/docs/pkg/models/shared/errorstatus.md create mode 100644 lending/docs/pkg/models/shared/journallinedatatype.md create mode 100644 lending/docs/pkg/models/shared/path.md delete mode 100644 lending/docs/pkg/models/shared/pulloperationstatus.md delete mode 100644 lending/docs/pkg/models/shared/reportlineinput.md create mode 100644 lending/docs/pkg/models/shared/source.md create mode 100644 lending/docs/pkg/models/shared/startuploadsessionrequest.md create mode 100644 lending/docs/pkg/models/shared/startuploadsessionrequestdatatype.md create mode 100644 lending/docs/pkg/models/shared/tags.md delete mode 100644 lending/docs/pkg/models/shared/withholdingtaxitems.md create mode 100644 lending/docs/pkg/models/shared/zero.md create mode 100644 lending/docs/pkg/models/shared/zerodatatype.md create mode 100644 lending/docs/pkg/models/webhooks/clientratelimitreachedresponse1.md create mode 100644 lending/docs/pkg/models/webhooks/clientratelimitresetresponse1.md create mode 100644 lending/docs/sdks/bankstatements/README.md create mode 100644 lending/internal/hooks/hooks.go create mode 100644 lending/internal/hooks/registration.go create mode 100644 lending/pkg/models/operations/endbankstatementuploadsession.go create mode 100644 lending/pkg/models/operations/getbankstatementuploadconfiguration.go create mode 100644 lending/pkg/models/operations/setbankstatementuploadconfiguration.go create mode 100644 lending/pkg/models/operations/startbankstatementuploadsession.go create mode 100644 lending/pkg/models/operations/uploadbankstatementdata.go create mode 100644 lending/pkg/models/shared/bankaccountstatus.go create mode 100644 lending/pkg/models/shared/bankstatementuploadconfiguration.go create mode 100644 lending/pkg/models/shared/clientratelimitwebhook.go create mode 100644 lending/pkg/models/shared/clientratelimitwebhookpayload.go create mode 100644 lending/pkg/models/shared/enduploadsessionrequest.go create mode 100644 lending/pkg/models/shared/path.go delete mode 100644 lending/pkg/models/shared/reportlineinput.go create mode 100644 lending/pkg/models/shared/startuploadsessionrequest.go create mode 100644 lending/pkg/models/shared/status.go delete mode 100644 lending/pkg/models/shared/withholdingtaxitems.go create mode 100644 lending/pkg/models/shared/zero.go create mode 100644 lending/pkg/retry/config.go diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 0c5a1ff68..7ea48a4eb 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -49,6 +49,13 @@ sources: tags: - latest - main + lending-source: + sourceNamespace: lending-source + sourceRevisionDigest: sha256:903cae2450004a2b3e025b71b499583cb0975e416f730ac3b8cef63524793e78 + sourceBlobDigest: sha256:11ae523963780dcf6d5f3e5d617b7d4f809c94c11f59f95202727916e51510f4 + tags: + - latest + - main targets: accounting-library: source: accounting-source @@ -85,6 +92,11 @@ targets: sourceNamespace: files-source sourceRevisionDigest: sha256:9fd1d0dd9d47a7e0c657aca1eaa020c3a314ff1ca25b14497f4a6741e341d9a8 sourceBlobDigest: sha256:95e088645c8a70b6c0d755c6f12a0a24b74eda70dcebccc7a0c2f70fec219d81 + lending-library: + source: lending-source + sourceNamespace: lending-source + sourceRevisionDigest: sha256:903cae2450004a2b3e025b71b499583cb0975e416f730ac3b8cef63524793e78 + sourceBlobDigest: sha256:11ae523963780dcf6d5f3e5d617b7d4f809c94c11f59f95202727916e51510f4 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest @@ -127,6 +139,8 @@ workflow: lending-source: inputs: - location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Lending.yaml + registry: + location: registry.speakeasyapi.dev/codat/codat/lending-source platform-source: inputs: - location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Platform.yaml diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index 956d35b5d..9ac925505 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -39,6 +39,8 @@ sources: lending-source: inputs: - location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Lending.yaml + registry: + location: registry.speakeasyapi.dev/codat/codat/lending-source platform-source: inputs: - location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Platform.yaml diff --git a/lending/.speakeasy/gen.lock b/lending/.speakeasy/gen.lock index b88ac296e..30f8d79e6 100755 --- a/lending/.speakeasy/gen.lock +++ b/lending/.speakeasy/gen.lock @@ -1,1197 +1,11660 @@ lockVersion: 2.0.0 id: 38fc8a31-15d9-4bd1-b91d-cc3fc015d0f0 management: - docChecksum: 50007982baed63cebf40d1c51c53721c + docChecksum: 865d7e2e40bcc97b168e5bafc12ce83b docVersion: 3.0.0 - speakeasyVersion: internal - generationVersion: 2.253.0 - releaseVersion: 5.3.0 - configChecksum: 1c4d44a8b8d45a64966cacf76cc21e26 + speakeasyVersion: 1.396.7 + generationVersion: 2.415.6 + releaseVersion: 5.4.0 + configChecksum: 8ad1aacd7a183ac21eddd5fc84bd3acb repoURL: https://github.com/codatio/client-sdk-go.git repoSubDirectory: lending installationURL: https://github.com/codatio/client-sdk-go/lending published: true features: go: - constsAndDefaults: 0.1.3 - core: 3.3.2 + additionalDependencies: 0.1.0 + constsAndDefaults: 0.1.6 + core: 3.5.8 + decimal: 0.1.0 + defaultEnabledRetries: 0.2.0 deprecations: 2.81.1 - downloadStreams: 0.1.1 + downloadStreams: 0.1.2 + envVarSecurityUsage: 0.3.1 examples: 2.81.3 - globalSecurity: 2.82.6 - globalServerURLs: 2.82.1 + globalSecurity: 2.82.10 + globalSecurityCallbacks: 0.1.0 + globalServerURLs: 2.82.2 groups: 2.81.2 inputOutputModels: 2.83.0 - nameOverrides: 2.81.1 - retries: 2.82.2 + intellisenseMarkdownSupport: 0.1.0 + nameOverrides: 2.81.2 + nullables: 0.1.0 + responseFormat: 0.1.2 + retries: 2.83.0 + sdkHooks: 0.1.0 + serverEventsSentinels: 0.1.0 + typeOverrides: 2.81.1 + unions: 2.85.9 + uploadStreams: 0.1.0 + webhooks: 1.0.0 generatedFiles: - - companies.go - - connections.go - - accounttransactions.go - - codatlendingdirectcosts.go - - codatlendingtransfers.go - - journalentries.go - - journals.go - - transactions.go - - accounts.go - - codatlendingaccountingbankdata.go - - accountbalances.go - - codatlendingaccounts.go - - transactioncategories.go - - codatlendingbankingtransactions.go - - categorizedstatement.go - - banking.go - - bills.go - - suppliers.go - - billcreditnotes.go - - billpayments.go - - accountspayable.go - - codatlendingcustomers.go - - disputes.go - - locations.go - - orders.go - - paymentmethods.go - - codatlendingsalespayments.go - - productcategories.go - - products.go - - codatlendingtransactions.go - - metrics.go - - codatlendingreports.go - - sales.go - - companyinfo.go - - customers.go - - directincomes.go - - invoices.go - - creditnotes.go - - payments.go - - reports.go - - accountsreceivable.go - - fileupload.go - - bankaccounts.go - - banktransactions.go - - codatlendingloanwritebackaccounts.go - - directcosts.go - - codatlendingpayments.go - - codatlendingsuppliers.go - - transfers.go - - createoperations.go - - loanwriteback.go - - codatlendingfinancialstatementsaccounts.go - - balancesheet.go - - cashflow.go - - profitandloss.go - - financialstatements.go - - refresh.go - - pulloperations.go - - managedata.go - - liabilities.go - - dataintegrity.go - - excelreports.go - - codatlending.go - - go.mod - - go.sum - - pkg/models/sdkerrors/sdkerror.go - - pkg/types/bigint.go - - pkg/types/date.go - - pkg/types/datetime.go - - pkg/types/decimal.go - - pkg/types/pointers.go - - pkg/utils/contenttype.go - - pkg/utils/form.go - - pkg/utils/headers.go - - pkg/utils/json.go - - pkg/utils/pathparams.go - - pkg/utils/queryparams.go - - pkg/utils/requestbody.go - - pkg/utils/retries.go - - pkg/utils/security.go - - pkg/utils/utils.go + - .gitattributes + - /pkg/models/operations/createaccount.go + - /pkg/models/operations/createbankaccount.go + - /pkg/models/operations/createbanktransactions.go - /pkg/models/operations/createcompany.go - - /pkg/models/operations/deletecompany.go - - /pkg/models/operations/getcompany.go - - /pkg/models/operations/listcompanies.go - - /pkg/models/operations/updatecompany.go - /pkg/models/operations/createconnection.go + - /pkg/models/operations/createdirectcost.go + - /pkg/models/operations/createpayment.go + - /pkg/models/operations/createsupplier.go + - /pkg/models/operations/createtransfer.go + - /pkg/models/operations/deletecompany.go - /pkg/models/operations/deleteconnection.go - - /pkg/models/operations/getconnection.go - - /pkg/models/operations/listconnections.go - - /pkg/models/operations/unlinkconnection.go - - /pkg/models/operations/getaccountingaccounttransaction.go - - /pkg/models/operations/listaccountingaccounttransactions.go + - /pkg/models/operations/downloadaccountingbillattachment.go + - /pkg/models/operations/downloadaccountingcustomerattachment.go - /pkg/models/operations/downloadaccountingdirectcostattachment.go + - /pkg/models/operations/downloadaccountingdirectincomeattachment.go + - /pkg/models/operations/downloadaccountinginvoiceattachment.go + - /pkg/models/operations/downloadaccountinginvoicepdf.go + - /pkg/models/operations/downloadaccountingsupplierattachment.go + - /pkg/models/operations/downloadexcelreport.go + - /pkg/models/operations/downloadfiles.go + - /pkg/models/operations/endbankstatementuploadsession.go + - /pkg/models/operations/generateexcelreport.go + - /pkg/models/operations/generateloansummary.go + - /pkg/models/operations/generateloantransactions.go + - /pkg/models/operations/getaccountingaccount.go + - /pkg/models/operations/getaccountingaccounttransaction.go + - /pkg/models/operations/getaccountingagedcreditorsreport.go + - /pkg/models/operations/getaccountingageddebtorsreport.go + - /pkg/models/operations/getaccountingbalancesheet.go + - /pkg/models/operations/getaccountingbankaccount.go + - /pkg/models/operations/getaccountingbill.go + - /pkg/models/operations/getaccountingbillattachment.go + - /pkg/models/operations/getaccountingbillcreditnote.go + - /pkg/models/operations/getaccountingbillpayment.go + - /pkg/models/operations/getaccountingcashflowstatement.go + - /pkg/models/operations/getaccountingcreditnote.go + - /pkg/models/operations/getaccountingcustomer.go + - /pkg/models/operations/getaccountingcustomerattachment.go - /pkg/models/operations/getaccountingdirectcost.go - /pkg/models/operations/getaccountingdirectcostattachment.go - - /pkg/models/operations/listaccountingdirectcosts.go - - /pkg/models/operations/listaccountingdirectcostattachments.go - - /pkg/models/operations/getaccountingtransfer.go - - /pkg/models/operations/listaccountingtransfers.go - - /pkg/models/operations/getaccountingjournalentry.go - - /pkg/models/operations/listaccountingjournalentries.go + - /pkg/models/operations/getaccountingdirectincome.go + - /pkg/models/operations/getaccountingdirectincomeattachment.go + - /pkg/models/operations/getaccountinginvoice.go + - /pkg/models/operations/getaccountinginvoiceattachment.go - /pkg/models/operations/getaccountingjournal.go - - /pkg/models/operations/listaccountingjournals.go - - /pkg/models/operations/listaccountingbankaccounttransactions.go - - /pkg/models/operations/getaccountingbankaccount.go - - /pkg/models/operations/listaccountingbankaccounts.go - - /pkg/models/operations/listbankingaccountbalances.go + - /pkg/models/operations/getaccountingjournalentry.go + - /pkg/models/operations/getaccountingpayment.go + - /pkg/models/operations/getaccountingprofile.go + - /pkg/models/operations/getaccountingprofitandloss.go + - /pkg/models/operations/getaccountingsupplier.go + - /pkg/models/operations/getaccountingsupplierattachment.go + - /pkg/models/operations/getaccountingtransfer.go - /pkg/models/operations/getbankingaccount.go - - /pkg/models/operations/listbankingaccounts.go - - /pkg/models/operations/getbankingtransactioncategory.go - - /pkg/models/operations/listbankingtransactioncategories.go - /pkg/models/operations/getbankingtransaction.go - - /pkg/models/operations/listbankingtransactions.go + - /pkg/models/operations/getbankingtransactioncategory.go + - /pkg/models/operations/getbankstatementuploadconfiguration.go + - /pkg/models/operations/getcategorizedbalancesheetstatement.go - /pkg/models/operations/getcategorizedbankstatement.go - - /pkg/models/operations/downloadaccountingbillattachment.go - - /pkg/models/operations/getaccountingbill.go - - /pkg/models/operations/getaccountingbillattachment.go - - /pkg/models/operations/listaccountingbills.go - - /pkg/models/operations/listaccountingbillattachments.go - - /pkg/models/operations/downloadaccountingsupplierattachment.go - - /pkg/models/operations/getaccountingsupplier.go - - /pkg/models/operations/getaccountingsupplierattachment.go - - /pkg/models/operations/listaccountingsuppliers.go - - /pkg/models/operations/listaccountingsupplierattachments.go - - /pkg/models/operations/getaccountingbillcreditnote.go - - /pkg/models/operations/listaccountingbillcreditnotes.go - - /pkg/models/operations/getaccountingbillpayment.go - - /pkg/models/operations/listaccountingbillpayments.go + - /pkg/models/operations/getcategorizedprofitandlossstatement.go - /pkg/models/operations/getcommercecustomer.go - - /pkg/models/operations/listcommercecustomers.go + - /pkg/models/operations/getcommercecustomerretentionmetrics.go - /pkg/models/operations/getcommercedispute.go - - /pkg/models/operations/listcommercedisputes.go + - /pkg/models/operations/getcommercelifetimevaluemetrics.go - /pkg/models/operations/getcommercelocation.go - - /pkg/models/operations/listcommercelocations.go - /pkg/models/operations/getcommerceorder.go - - /pkg/models/operations/listcommerceorders.go - - /pkg/models/operations/getcommercepaymentmethod.go - - /pkg/models/operations/listcommercepaymentmethods.go + - /pkg/models/operations/getcommerceordersreport.go - /pkg/models/operations/getcommercepayment.go - - /pkg/models/operations/listcommercepayments.go - - /pkg/models/operations/getcommerceproductcategory.go - - /pkg/models/operations/listcommerceproductcategories.go + - /pkg/models/operations/getcommercepaymentmethod.go - /pkg/models/operations/getcommerceproduct.go - - /pkg/models/operations/listcommerceproducts.go - - /pkg/models/operations/getcommercetransaction.go - - /pkg/models/operations/listcommercetransactions.go - - /pkg/models/operations/getcommercecustomerretentionmetrics.go - - /pkg/models/operations/getcommercelifetimevaluemetrics.go - - /pkg/models/operations/getcommercerevenuemetrics.go - - /pkg/models/operations/getcommerceordersreport.go - - /pkg/models/operations/getcommercerefundsreport.go - - /pkg/models/operations/getaccountingprofile.go + - /pkg/models/operations/getcommerceproductcategory.go - /pkg/models/operations/getcommerceprofile.go - - /pkg/models/operations/downloadaccountingcustomerattachment.go - - /pkg/models/operations/getaccountingcustomer.go - - /pkg/models/operations/getaccountingcustomerattachment.go - - /pkg/models/operations/listaccountingcustomers.go - - /pkg/models/operations/listaccountingcustomerattachments.go - - /pkg/models/operations/downloadaccountingdirectincomeattachment.go - - /pkg/models/operations/getaccountingdirectincome.go - - /pkg/models/operations/getaccountingdirectincomeattachment.go - - /pkg/models/operations/listaccountingdirectincomes.go - - /pkg/models/operations/listaccountingdirectincomeattachments.go - - /pkg/models/operations/downloadaccountinginvoiceattachment.go - - /pkg/models/operations/downloadaccountinginvoicepdf.go - - /pkg/models/operations/getaccountinginvoice.go - - /pkg/models/operations/getaccountinginvoiceattachment.go - - /pkg/models/operations/listaccountinginvoices.go - - /pkg/models/operations/listaccountinginvoiceattachments.go - - /pkg/models/operations/listreconciledinvoices.go - - /pkg/models/operations/getaccountingcreditnote.go - - /pkg/models/operations/listaccountingcreditnotes.go - - /pkg/models/operations/getaccountingpayment.go - - /pkg/models/operations/listaccountingpayments.go - - /pkg/models/operations/getaccountingagedcreditorsreport.go - - /pkg/models/operations/getaccountingageddebtorsreport.go - - /pkg/models/operations/isagedcreditorsreportavailable.go - - /pkg/models/operations/isageddebtorsreportavailable.go - - /pkg/models/operations/downloadfiles.go - - /pkg/models/operations/listfiles.go - - /pkg/models/operations/uploadfiles.go - - /pkg/models/operations/createbankaccount.go - - /pkg/models/operations/getcreateupdatebankaccountsmodel.go - - /pkg/models/operations/createbanktransactions.go + - /pkg/models/operations/getcommercerefundsreport.go + - /pkg/models/operations/getcommercerevenuemetrics.go + - /pkg/models/operations/getcommercetransaction.go + - /pkg/models/operations/getcompany.go + - /pkg/models/operations/getconnection.go - /pkg/models/operations/getcreatebanktransactionsmodel.go - - /pkg/models/operations/createaccount.go - /pkg/models/operations/getcreatechartofaccountsmodel.go - - /pkg/models/operations/createdirectcost.go - /pkg/models/operations/getcreatedirectcostsmodel.go - - /pkg/models/operations/createpayment.go + - /pkg/models/operations/getcreateoperation.go - /pkg/models/operations/getcreatepaymentmodel.go - - /pkg/models/operations/createsupplier.go - - /pkg/models/operations/getcreateupdatesuppliersmodel.go - - /pkg/models/operations/createtransfer.go - /pkg/models/operations/getcreatetransfersmodel.go - - /pkg/models/operations/getcreateoperation.go - - /pkg/models/operations/listcreateoperations.go - - /pkg/models/operations/getaccountingaccount.go - - /pkg/models/operations/listaccountingaccounts.go - - /pkg/models/operations/getaccountingbalancesheet.go - - /pkg/models/operations/getcategorizedbalancesheetstatement.go - - /pkg/models/operations/getaccountingcashflowstatement.go - - /pkg/models/operations/getaccountingprofitandloss.go - - /pkg/models/operations/getcategorizedprofitandlossstatement.go - - /pkg/models/operations/getdatastatus.go - - /pkg/models/operations/refreshalldatatypes.go - - /pkg/models/operations/refreshdatatype.go - - /pkg/models/operations/getpulloperation.go - - /pkg/models/operations/listpulloperations.go - - /pkg/models/operations/generateloansummary.go - - /pkg/models/operations/generateloantransactions.go - - /pkg/models/operations/getloansummary.go - - /pkg/models/operations/listloantransactions.go - - /pkg/models/operations/listdataintegritydetails.go + - /pkg/models/operations/getcreateupdatebankaccountsmodel.go + - /pkg/models/operations/getcreateupdatesuppliersmodel.go - /pkg/models/operations/getdataintegritystatus.go - /pkg/models/operations/getdataintegritysummaries.go - - /pkg/models/operations/downloadexcelreport.go - - /pkg/models/operations/generateexcelreport.go + - /pkg/models/operations/getdatastatus.go - /pkg/models/operations/getexcelreportgenerationstatus.go - - /pkg/models/shared/company.go - - /pkg/models/shared/connection.go - - /pkg/models/shared/dataconnectionstatus.go - - /pkg/models/shared/dataconnectionerror.go - - /pkg/models/shared/errorvalidation.go - - /pkg/models/shared/errorvalidationitem.go - - /pkg/models/shared/companyrequestbody.go - - /pkg/models/shared/items.go - - /pkg/models/shared/companies.go - - /pkg/models/shared/links.go - - /pkg/models/shared/halref.go - - /pkg/models/shared/connections.go + - /pkg/models/operations/getloansummary.go + - /pkg/models/operations/getpulloperation.go + - /pkg/models/operations/isagedcreditorsreportavailable.go + - /pkg/models/operations/isageddebtorsreportavailable.go + - /pkg/models/operations/listaccountingaccounts.go + - /pkg/models/operations/listaccountingaccounttransactions.go + - /pkg/models/operations/listaccountingbankaccounts.go + - /pkg/models/operations/listaccountingbankaccounttransactions.go + - /pkg/models/operations/listaccountingbillattachments.go + - /pkg/models/operations/listaccountingbillcreditnotes.go + - /pkg/models/operations/listaccountingbillpayments.go + - /pkg/models/operations/listaccountingbills.go + - /pkg/models/operations/listaccountingcreditnotes.go + - /pkg/models/operations/listaccountingcustomerattachments.go + - /pkg/models/operations/listaccountingcustomers.go + - /pkg/models/operations/listaccountingdirectcostattachments.go + - /pkg/models/operations/listaccountingdirectcosts.go + - /pkg/models/operations/listaccountingdirectincomeattachments.go + - /pkg/models/operations/listaccountingdirectincomes.go + - /pkg/models/operations/listaccountinginvoiceattachments.go + - /pkg/models/operations/listaccountinginvoices.go + - /pkg/models/operations/listaccountingjournalentries.go + - /pkg/models/operations/listaccountingjournals.go + - /pkg/models/operations/listaccountingpayments.go + - /pkg/models/operations/listaccountingsupplierattachments.go + - /pkg/models/operations/listaccountingsuppliers.go + - /pkg/models/operations/listaccountingtransfers.go + - /pkg/models/operations/listbankingaccountbalances.go + - /pkg/models/operations/listbankingaccounts.go + - /pkg/models/operations/listbankingtransactioncategories.go + - /pkg/models/operations/listbankingtransactions.go + - /pkg/models/operations/listcommercecustomers.go + - /pkg/models/operations/listcommercedisputes.go + - /pkg/models/operations/listcommercelocations.go + - /pkg/models/operations/listcommerceorders.go + - /pkg/models/operations/listcommercepaymentmethods.go + - /pkg/models/operations/listcommercepayments.go + - /pkg/models/operations/listcommerceproductcategories.go + - /pkg/models/operations/listcommerceproducts.go + - /pkg/models/operations/listcommercetransactions.go + - /pkg/models/operations/listcompanies.go + - /pkg/models/operations/listconnections.go + - /pkg/models/operations/listcreateoperations.go + - /pkg/models/operations/listdataintegritydetails.go + - /pkg/models/operations/listfiles.go + - /pkg/models/operations/listloantransactions.go + - /pkg/models/operations/listpulloperations.go + - /pkg/models/operations/listreconciledinvoices.go + - /pkg/models/operations/refreshalldatatypes.go + - /pkg/models/operations/refreshdatatype.go + - /pkg/models/operations/setbankstatementuploadconfiguration.go + - /pkg/models/operations/startbankstatementuploadsession.go + - /pkg/models/operations/unlinkconnection.go + - /pkg/models/operations/updatecompany.go + - /pkg/models/operations/uploadbankstatementdata.go + - /pkg/models/operations/uploadfiles.go + - /pkg/models/sdkerrors/errormessage.go + - /pkg/models/shared/accountbalance.go + - /pkg/models/shared/accountbalanceamounts.go + - /pkg/models/shared/accountcategoriesupdatedwebhook.go + - /pkg/models/shared/accountcategoriesupdatedwebhookdata.go + - /pkg/models/shared/accountcategorylevel.go + - /pkg/models/shared/accountidentifiers.go + - /pkg/models/shared/accountidentifiertype.go + - /pkg/models/shared/accountingaccount.go + - /pkg/models/shared/accountingaccounts.go - /pkg/models/shared/accountingaccounttransaction.go - - /pkg/models/shared/metadata.go - - /pkg/models/shared/accounttransactionline.go - - /pkg/models/shared/accounttransactionlinerecordref.go - - /pkg/models/shared/bankaccountref.go - /pkg/models/shared/accountingaccounttransactions.go - - /pkg/models/shared/accountingdirectcost.go - - /pkg/models/shared/supplementaldata.go - - /pkg/models/shared/accountingpaymentallocation.go - - /pkg/models/shared/paymentallocationpayment.go - - /pkg/models/shared/accountref.go - - /pkg/models/shared/directcostlineitem.go - - /pkg/models/shared/trackingcategoryref.go - - /pkg/models/shared/tracking.go - - /pkg/models/shared/trackingrecordref.go - - /pkg/models/shared/recordref.go - - /pkg/models/shared/taxrateref.go - - /pkg/models/shared/propertieitemref.go + - /pkg/models/shared/accountingaddress.go + - /pkg/models/shared/accountingaddresstype.go + - /pkg/models/shared/accountingagedcreditorreport.go + - /pkg/models/shared/accountingageddebtorreport.go - /pkg/models/shared/accountingattachment.go + - /pkg/models/shared/accountingbalancesheet.go + - /pkg/models/shared/accountingbankaccount.go + - /pkg/models/shared/accountingbankaccounts.go + - /pkg/models/shared/accountingbankaccounttype.go + - /pkg/models/shared/accountingbanktransaction.go + - /pkg/models/shared/accountingbanktransactions.go + - /pkg/models/shared/accountingbill.go + - /pkg/models/shared/accountingbillcreditnote.go + - /pkg/models/shared/accountingbillcreditnotes.go + - /pkg/models/shared/accountingbillpayment.go + - /pkg/models/shared/accountingbillpayments.go + - /pkg/models/shared/accountingbills.go + - /pkg/models/shared/accountingcashflowstatement.go + - /pkg/models/shared/accountingcompanyinfo.go + - /pkg/models/shared/accountingcreateaccountresponse.go + - /pkg/models/shared/accountingcreatebankaccountresponse.go + - /pkg/models/shared/accountingcreatebanktransactions.go + - /pkg/models/shared/accountingcreatebanktransactionsresponse.go + - /pkg/models/shared/accountingcreatedirectcostresponse.go + - /pkg/models/shared/accountingcreatepaymentresponse.go + - /pkg/models/shared/accountingcreatesupplierresponse.go + - /pkg/models/shared/accountingcreatetransferresponse.go + - /pkg/models/shared/accountingcreditnote.go + - /pkg/models/shared/accountingcreditnotes.go + - /pkg/models/shared/accountingcustomer.go + - /pkg/models/shared/accountingcustomerref.go + - /pkg/models/shared/accountingcustomers.go + - /pkg/models/shared/accountingdirectcost.go - /pkg/models/shared/accountingdirectcosts.go - - /pkg/models/shared/attachments.go - - /pkg/models/shared/accountingtransfer.go - - /pkg/models/shared/transferaccount.go - - /pkg/models/shared/contactref.go - - /pkg/models/shared/accountingtransfers.go - - /pkg/models/shared/accountingjournalentry.go - - /pkg/models/shared/journalentryrecordref.go - - /pkg/models/shared/journalref.go - - /pkg/models/shared/journalline.go - - /pkg/models/shared/accountingjournalentries.go + - /pkg/models/shared/accountingdirectincome.go + - /pkg/models/shared/accountingdirectincomes.go + - /pkg/models/shared/accountinginvoice.go + - /pkg/models/shared/accountinginvoices.go - /pkg/models/shared/accountingjournal.go - - /pkg/models/shared/journalstatus.go + - /pkg/models/shared/accountingjournalentries.go + - /pkg/models/shared/accountingjournalentry.go - /pkg/models/shared/accountingjournals.go - - /pkg/models/shared/accountingbanktransactions.go - - /pkg/models/shared/accountingbanktransaction.go - - /pkg/models/shared/banktransactiontype.go - - /pkg/models/shared/accountingbankaccount.go - - /pkg/models/shared/accountingbankaccounttype.go - - /pkg/models/shared/accountingbankaccounts.go - - /pkg/models/shared/bankingaccountbalances.go - - /pkg/models/shared/bankingaccountbalance.go - - /pkg/models/shared/accountbalanceamounts.go - - /pkg/models/shared/bankingaccount.go + - /pkg/models/shared/accountingpayment.go + - /pkg/models/shared/accountingpaymentallocation.go + - /pkg/models/shared/accountingpayments.go + - /pkg/models/shared/accountingprofitandlossreport.go + - /pkg/models/shared/accountingsupplier.go + - /pkg/models/shared/accountingsuppliers.go + - /pkg/models/shared/accountingtransfer.go + - /pkg/models/shared/accountingtransfers.go - /pkg/models/shared/accountinstitution.go - - /pkg/models/shared/accountidentifiers.go - - /pkg/models/shared/accountidentifiertype.go + - /pkg/models/shared/accountprototype.go + - /pkg/models/shared/accountref.go + - /pkg/models/shared/accounts.go + - /pkg/models/shared/accountspayabletracking.go + - /pkg/models/shared/accountsreceivabletracking.go + - /pkg/models/shared/accountstatus.go + - /pkg/models/shared/accounttransactionline.go + - /pkg/models/shared/accounttransactionlinerecordref.go + - /pkg/models/shared/accounttype.go + - /pkg/models/shared/agedcreditor.go + - /pkg/models/shared/agedcurrencyoutstanding.go + - /pkg/models/shared/ageddebtor.go + - /pkg/models/shared/agedoutstandingamount.go + - /pkg/models/shared/agedoutstandingamountdetail.go + - /pkg/models/shared/attachments.go + - /pkg/models/shared/balancesheet.go + - /pkg/models/shared/bankaccountref.go + - /pkg/models/shared/bankaccountstatus.go + - /pkg/models/shared/bankingaccount.go + - /pkg/models/shared/bankingaccountbalance.go + - /pkg/models/shared/bankingaccountbalances.go - /pkg/models/shared/bankingaccounts.go - - /pkg/models/shared/bankingtransactioncategory.go - - /pkg/models/shared/transactioncategorystatus.go - - /pkg/models/shared/bankingtransactioncategories.go - /pkg/models/shared/bankingtransaction.go - - /pkg/models/shared/transactioncategoryref.go - - /pkg/models/shared/transactioncode.go + - /pkg/models/shared/bankingtransactioncategories.go + - /pkg/models/shared/bankingtransactioncategory.go + - /pkg/models/shared/bankingtransactionref.go - /pkg/models/shared/bankingtransactions.go - - /pkg/models/shared/enhancedcashflowtransactions.go - - /pkg/models/shared/enhancedcashflowitem.go - - /pkg/models/shared/enhancedcashflowtransaction.go - - /pkg/models/shared/transactioncategory.go - - /pkg/models/shared/sourceref.go - - /pkg/models/shared/reportinfo.go - - /pkg/models/shared/datasource.go - - /pkg/models/shared/accounts.go - - /pkg/models/shared/accountingbill.go - - /pkg/models/shared/supplierref.go - - /pkg/models/shared/billstatus.go - - /pkg/models/shared/billlineitem.go - - /pkg/models/shared/accountspayabletracking.go - - /pkg/models/shared/projectref.go - - /pkg/models/shared/billedtotype.go - - /pkg/models/shared/accountingcustomerref.go - - /pkg/models/shared/accountingbills.go - - /pkg/models/shared/accountingsupplier.go - - /pkg/models/shared/supplierstatus.go - - /pkg/models/shared/accountingaddress.go - - /pkg/models/shared/accountingaddresstype.go - - /pkg/models/shared/accountingsuppliers.go - - /pkg/models/shared/accountingbillcreditnote.go - - /pkg/models/shared/withholdingtaxitems.go - - /pkg/models/shared/billcreditnotestatus.go + - /pkg/models/shared/bankstatementuploadconfiguration.go + - /pkg/models/shared/banktransactiontype.go - /pkg/models/shared/billcreditnotelineitem.go - - /pkg/models/shared/accountingbillcreditnotes.go - - /pkg/models/shared/accountingbillpayment.go - - /pkg/models/shared/paymentmethodref.go + - /pkg/models/shared/billcreditnotestatus.go + - /pkg/models/shared/billedtotype.go + - /pkg/models/shared/billedtotype1.go + - /pkg/models/shared/billlineitem.go - /pkg/models/shared/billpaymentline.go - /pkg/models/shared/billpaymentlinelink.go - /pkg/models/shared/billpaymentlinelinktype.go - - /pkg/models/shared/accountingbillpayments.go - - /pkg/models/shared/commercecustomer.go + - /pkg/models/shared/billstatus.go + - /pkg/models/shared/cashflowstatement.go + - /pkg/models/shared/clientratelimitreachedwebhook.go + - /pkg/models/shared/clientratelimitreachedwebhookdata.go + - /pkg/models/shared/clientratelimitresetwebhook.go + - /pkg/models/shared/clientratelimitresetwebhookdata.go + - /pkg/models/shared/clientratelimitwebhook.go + - /pkg/models/shared/clientratelimitwebhookpayload.go + - /pkg/models/shared/codatfile.go - /pkg/models/shared/commerceaddress.go - /pkg/models/shared/commerceaddresstype.go + - /pkg/models/shared/commercecompanyinfo.go + - /pkg/models/shared/commercecustomer.go + - /pkg/models/shared/commercecustomerref.go - /pkg/models/shared/commercecustomers.go - /pkg/models/shared/commercedispute.go - - /pkg/models/shared/disputestatus.go - - /pkg/models/shared/transactionsourceref.go - - /pkg/models/shared/transactionsourcetype.go - /pkg/models/shared/commercedisputes.go - /pkg/models/shared/commercelocation.go - /pkg/models/shared/commercelocations.go - /pkg/models/shared/commerceorder.go - - /pkg/models/shared/servicecharge.go - - /pkg/models/shared/servicechargetype.go - - /pkg/models/shared/taxcomponentallocation.go - - /pkg/models/shared/taxcomponentref.go - - /pkg/models/shared/paymentref.go - - /pkg/models/shared/paymenttype.go - - /pkg/models/shared/paymentstatus.go - - /pkg/models/shared/orderlineitem.go - - /pkg/models/shared/productvariantref.go - - /pkg/models/shared/productref.go - - /pkg/models/shared/orderdiscountallocation.go - - /pkg/models/shared/locationref.go - - /pkg/models/shared/commercecustomerref.go - /pkg/models/shared/commerceorders.go + - /pkg/models/shared/commercepayment.go - /pkg/models/shared/commercepaymentmethod.go - /pkg/models/shared/commercepaymentmethods.go - - /pkg/models/shared/commercepayment.go - /pkg/models/shared/commercepayments.go + - /pkg/models/shared/commerceproduct.go + - /pkg/models/shared/commerceproductcategories.go - /pkg/models/shared/commerceproductcategory.go + - /pkg/models/shared/commerceproducts.go - /pkg/models/shared/commercerecordref.go - - /pkg/models/shared/commerceproductcategories.go - - /pkg/models/shared/commerceproduct.go - - /pkg/models/shared/productvariant.go - - /pkg/models/shared/productvariantstatus.go - - /pkg/models/shared/productprice.go - - /pkg/models/shared/productinventory.go - - /pkg/models/shared/productinventorylocation.go - - /pkg/models/shared/commerceproducts.go - - /pkg/models/shared/commercetransaction.go - - /pkg/models/shared/transactiontype.go - - /pkg/models/shared/commercetransactions.go - /pkg/models/shared/commercereport.go - /pkg/models/shared/commercereportcomponent.go - - /pkg/models/shared/reportcomponentmeasure.go - - /pkg/models/shared/commercereportmeasure.go - - /pkg/models/shared/commercereporterror.go - /pkg/models/shared/commercereportdimension.go - - /pkg/models/shared/periodunit.go - - /pkg/models/shared/accountingcompanyinfo.go - - /pkg/models/shared/weblink.go - - /pkg/models/shared/phonenumber.go - - /pkg/models/shared/phonenumbertype.go - - /pkg/models/shared/commercecompanyinfo.go - - /pkg/models/shared/accountbalance.go - - /pkg/models/shared/accountingcustomer.go - - /pkg/models/shared/customerstatus.go + - /pkg/models/shared/commercereporterror.go + - /pkg/models/shared/commercereportmeasure.go + - /pkg/models/shared/commercetransaction.go + - /pkg/models/shared/commercetransactions.go + - /pkg/models/shared/companies.go + - /pkg/models/shared/company.go + - /pkg/models/shared/companyrequestbody.go + - /pkg/models/shared/connection.go + - /pkg/models/shared/connections.go - /pkg/models/shared/contact.go - - /pkg/models/shared/accountingcustomers.go - - /pkg/models/shared/accountingdirectincome.go - - /pkg/models/shared/directincomelineitem.go - - /pkg/models/shared/accountingdirectincomes.go - - /pkg/models/shared/accountinginvoice.go - - /pkg/models/shared/invoicestatus.go - - /pkg/models/shared/invoicelineitem.go - - /pkg/models/shared/accountsreceivabletracking.go - - /pkg/models/shared/billedtotype1.go - - /pkg/models/shared/accountinginvoices.go - - /pkg/models/shared/enhancedinvoicesreport.go - - /pkg/models/shared/enhancedinvoicereportitem.go - - /pkg/models/shared/payment.go - - /pkg/models/shared/bankingtransactionref.go - - /pkg/models/shared/lendingcustomerref.go - - /pkg/models/shared/accountingcreditnote.go - - /pkg/models/shared/creditnotestatus.go + - /pkg/models/shared/contactref.go + - /pkg/models/shared/createbankaccounttransaction.go - /pkg/models/shared/creditnotelineitem.go - - /pkg/models/shared/accountingcreditnotes.go - - /pkg/models/shared/accountingpayment.go - - /pkg/models/shared/paymentline.go - - /pkg/models/shared/paymentlinelink.go - - /pkg/models/shared/paymentlinktype.go - - /pkg/models/shared/accountingpayments.go - - /pkg/models/shared/accountingagedcreditorreport.go - - /pkg/models/shared/agedcreditor.go - - /pkg/models/shared/agedcurrencyoutstanding.go - - /pkg/models/shared/agedoutstandingamount.go - - /pkg/models/shared/agedoutstandingamountdetail.go - - /pkg/models/shared/accountingageddebtorreport.go - - /pkg/models/shared/ageddebtor.go - - /pkg/models/shared/file.go - - /pkg/models/shared/fileupload.go - - /pkg/models/shared/codatfile.go - - /pkg/models/shared/accountingcreatebankaccountresponse.go - - /pkg/models/shared/validation.go - - /pkg/models/shared/validationitem.go - - /pkg/models/shared/pushoperationstatus.go + - /pkg/models/shared/creditnotestatus.go + - /pkg/models/shared/customerstatus.go + - /pkg/models/shared/dataconnectionerror.go + - /pkg/models/shared/dataconnectionstatus.go + - /pkg/models/shared/dataintegrityamounts.go + - /pkg/models/shared/dataintegritybyamount.go + - /pkg/models/shared/dataintegritybycount.go + - /pkg/models/shared/dataintegrityconnectionid.go + - /pkg/models/shared/dataintegritydatatype.go + - /pkg/models/shared/dataintegritydates.go + - /pkg/models/shared/dataintegritydetail.go + - /pkg/models/shared/dataintegritydetails.go + - /pkg/models/shared/dataintegritymatch.go + - /pkg/models/shared/dataintegritystatus.go + - /pkg/models/shared/dataintegritystatuses.go + - /pkg/models/shared/dataintegritystatusinfo.go + - /pkg/models/shared/dataintegritysummaries.go + - /pkg/models/shared/dataintegritysummary.go + - /pkg/models/shared/datasource.go + - /pkg/models/shared/datastatus.go - /pkg/models/shared/datatype.go - - /pkg/models/shared/pushoperationchange.go - - /pkg/models/shared/pushchangetype.go - - /pkg/models/shared/pushoperationref.go - - /pkg/models/shared/pushoption.go - - /pkg/models/shared/pushvalidationinfo.go - - /pkg/models/shared/pushfieldvalidation.go - - /pkg/models/shared/pushoptiontype.go - - /pkg/models/shared/pushoptionproperty.go - - /pkg/models/shared/pushoptionchoice.go - - /pkg/models/shared/accountingcreatebanktransactionsresponse.go - - /pkg/models/shared/createbankaccounttransaction.go - - /pkg/models/shared/accountingcreatebanktransactions.go - - /pkg/models/shared/accountingcreateaccountresponse.go - - /pkg/models/shared/accounttype.go - - /pkg/models/shared/accountstatus.go - - /pkg/models/shared/accountprototype.go - - /pkg/models/shared/accountingcreatedirectcostresponse.go + - /pkg/models/shared/directcostlineitem.go - /pkg/models/shared/directcostprototype.go - - /pkg/models/shared/accountingcreatepaymentresponse.go - - /pkg/models/shared/accountingcreatesupplierresponse.go - - /pkg/models/shared/accountingcreatetransferresponse.go - - /pkg/models/shared/pushoperation.go - - /pkg/models/shared/pushoperations.go - - /pkg/models/shared/accountingaccount.go - - /pkg/models/shared/accountingaccounts.go - - /pkg/models/shared/accountingbalancesheet.go - - /pkg/models/shared/balancesheet.go - - /pkg/models/shared/reportlineinput.go - - /pkg/models/shared/reportline.go + - /pkg/models/shared/directincomelineitem.go + - /pkg/models/shared/disputestatus.go + - /pkg/models/shared/enduploadsessionrequest.go + - /pkg/models/shared/enhancedcashflowitem.go + - /pkg/models/shared/enhancedcashflowtransaction.go + - /pkg/models/shared/enhancedcashflowtransactions.go - /pkg/models/shared/enhancedfinancialreport.go + - /pkg/models/shared/enhancedinvoicereportitem.go + - /pkg/models/shared/enhancedinvoicesreport.go - /pkg/models/shared/enhancedreportaccountcategory.go - - /pkg/models/shared/accountcategorylevel.go - /pkg/models/shared/enhancedreportinfo.go - - /pkg/models/shared/accountingcashflowstatement.go - - /pkg/models/shared/cashflowstatement.go - - /pkg/models/shared/reportinput.go - - /pkg/models/shared/reportbasis.go - - /pkg/models/shared/accountingprofitandlossreport.go - - /pkg/models/shared/profitandlossreport.go - - /pkg/models/shared/datastatus.go - - /pkg/models/shared/pulloperation.go - - /pkg/models/shared/schemadatatype.go - - /pkg/models/shared/pulloperations.go + - /pkg/models/shared/errorvalidation.go + - /pkg/models/shared/errorvalidationitem.go + - /pkg/models/shared/excelreporttypes.go + - /pkg/models/shared/excelstatus.go + - /pkg/models/shared/file.go + - /pkg/models/shared/fileupload.go + - /pkg/models/shared/halref.go + - /pkg/models/shared/integritystatus.go + - /pkg/models/shared/invoicelineitem.go + - /pkg/models/shared/invoicestatus.go + - /pkg/models/shared/itemref.go + - /pkg/models/shared/items.go + - /pkg/models/shared/journalentryrecordref.go + - /pkg/models/shared/journalline.go + - /pkg/models/shared/journalref.go + - /pkg/models/shared/journalstatus.go + - /pkg/models/shared/lendingcustomerref.go + - /pkg/models/shared/links.go + - /pkg/models/shared/loanref.go - /pkg/models/shared/loansummary.go - - /pkg/models/shared/loansummaryreportitem.go + - /pkg/models/shared/loansummaryintegrationtype.go - /pkg/models/shared/loansummaryrecordref.go - /pkg/models/shared/loansummaryrecordreftype.go - - /pkg/models/shared/loansummaryintegrationtype.go - /pkg/models/shared/loansummaryreportinfo.go + - /pkg/models/shared/loansummaryreportitem.go - /pkg/models/shared/loantransactions.go - - /pkg/models/shared/reportitems.go - - /pkg/models/shared/loanref.go - - /pkg/models/shared/itemref.go - /pkg/models/shared/loantransactionsreportinfo.go - - /pkg/models/shared/dataintegritydetails.go - - /pkg/models/shared/dataintegritydetail.go - - /pkg/models/shared/dataintegritymatch.go - - /pkg/models/shared/dataintegritydatatype.go - - /pkg/models/shared/dataintegritystatuses.go - - /pkg/models/shared/dataintegritystatus.go - - /pkg/models/shared/dataintegritystatusinfo.go - - /pkg/models/shared/integritystatus.go - - /pkg/models/shared/dataintegritydates.go - - /pkg/models/shared/dataintegrityconnectionid.go - - /pkg/models/shared/dataintegrityamounts.go - - /pkg/models/shared/dataintegritysummaries.go - - /pkg/models/shared/dataintegritysummary.go - - /pkg/models/shared/dataintegritybycount.go - - /pkg/models/shared/dataintegritybyamount.go - - /pkg/models/shared/excelreporttypes.go - - /pkg/models/shared/excelstatus.go + - /pkg/models/shared/locationref.go + - /pkg/models/shared/metadata.go + - /pkg/models/shared/orderdiscountallocation.go + - /pkg/models/shared/orderlineitem.go + - /pkg/models/shared/path.go + - /pkg/models/shared/payment.go + - /pkg/models/shared/paymentallocationpayment.go + - /pkg/models/shared/paymentline.go + - /pkg/models/shared/paymentlinelink.go + - /pkg/models/shared/paymentlinktype.go + - /pkg/models/shared/paymentmethodref.go + - /pkg/models/shared/paymentref.go + - /pkg/models/shared/paymentstatus.go + - /pkg/models/shared/paymenttype.go + - /pkg/models/shared/periodunit.go + - /pkg/models/shared/phonenumber.go + - /pkg/models/shared/phonenumbertype.go + - /pkg/models/shared/productinventory.go + - /pkg/models/shared/productinventorylocation.go + - /pkg/models/shared/productprice.go + - /pkg/models/shared/productref.go + - /pkg/models/shared/productvariant.go + - /pkg/models/shared/productvariantref.go + - /pkg/models/shared/productvariantstatus.go + - /pkg/models/shared/profitandlossreport.go + - /pkg/models/shared/projectref.go + - /pkg/models/shared/propertieitemref.go + - /pkg/models/shared/pulloperation.go + - /pkg/models/shared/pulloperations.go + - /pkg/models/shared/pushchangetype.go + - /pkg/models/shared/pushfieldvalidation.go + - /pkg/models/shared/pushoperation.go + - /pkg/models/shared/pushoperationchange.go + - /pkg/models/shared/pushoperationref.go + - /pkg/models/shared/pushoperations.go + - /pkg/models/shared/pushoperationstatus.go + - /pkg/models/shared/pushoption.go + - /pkg/models/shared/pushoptionchoice.go + - /pkg/models/shared/pushoptionproperty.go + - /pkg/models/shared/pushoptiontype.go + - /pkg/models/shared/pushvalidationinfo.go + - /pkg/models/shared/recordref.go + - /pkg/models/shared/reportbasis.go + - /pkg/models/shared/reportcomponentmeasure.go + - /pkg/models/shared/reportinfo.go + - /pkg/models/shared/reportinput.go + - /pkg/models/shared/reportitems.go + - /pkg/models/shared/reportline.go + - /pkg/models/shared/schemadatatype.go - /pkg/models/shared/security.go - - /pkg/models/shared/accountcategoriesupdatedwebhook.go - - /pkg/models/shared/accountcategoriesupdatedwebhookdata.go - - /pkg/models/shared/clientratelimitreachedwebhook.go - - /pkg/models/shared/clientratelimitreachedwebhookdata.go - - /pkg/models/shared/clientratelimitresetwebhook.go - - /pkg/models/shared/clientratelimitresetwebhookdata.go - - /pkg/models/sdkerrors/errormessage.go + - /pkg/models/shared/servicecharge.go + - /pkg/models/shared/servicechargetype.go + - /pkg/models/shared/sourceref.go + - /pkg/models/shared/startuploadsessionrequest.go + - /pkg/models/shared/status.go + - /pkg/models/shared/supplementaldata.go + - /pkg/models/shared/supplierref.go + - /pkg/models/shared/supplierstatus.go + - /pkg/models/shared/taxcomponentallocation.go + - /pkg/models/shared/taxcomponentref.go + - /pkg/models/shared/taxrateref.go + - /pkg/models/shared/tracking.go + - /pkg/models/shared/trackingcategoryref.go + - /pkg/models/shared/trackingrecordref.go + - /pkg/models/shared/transactioncategory.go + - /pkg/models/shared/transactioncategoryref.go + - /pkg/models/shared/transactioncategorystatus.go + - /pkg/models/shared/transactioncode.go + - /pkg/models/shared/transactionsourceref.go + - /pkg/models/shared/transactionsourcetype.go + - /pkg/models/shared/transactiontype.go + - /pkg/models/shared/transferaccount.go + - /pkg/models/shared/validation.go + - /pkg/models/shared/validationitem.go + - /pkg/models/shared/weblink.go + - /pkg/models/shared/zero.go - /pkg/models/webhooks/accountcategoriesupdated.go - /pkg/models/webhooks/clientratelimitreached.go - /pkg/models/webhooks/clientratelimitreset.go - - docs/pkg/models/operations/createcompanyresponse.md - - docs/pkg/models/operations/deletecompanyrequest.md - - docs/pkg/models/operations/deletecompanyresponse.md - - docs/pkg/models/operations/getcompanyrequest.md - - docs/pkg/models/operations/getcompanyresponse.md - - docs/pkg/models/operations/listcompaniesrequest.md - - docs/pkg/models/operations/listcompaniesresponse.md - - docs/pkg/models/operations/updatecompanyrequest.md - - docs/pkg/models/operations/updatecompanyresponse.md - - docs/pkg/models/operations/createconnectionrequestbody.md + - CONTRIBUTING.md + - USAGE.md + - accountbalances.go + - accounts.go + - accountspayable.go + - accountsreceivable.go + - accounttransactions.go + - balancesheet.go + - bankaccounts.go + - banking.go + - bankstatements.go + - banktransactions.go + - billcreditnotes.go + - billpayments.go + - bills.go + - cashflow.go + - categorizedstatement.go + - codatlending.go + - codatlendingaccountingbankdata.go + - codatlendingaccounts.go + - codatlendingbankingtransactions.go + - codatlendingcustomers.go + - codatlendingdirectcosts.go + - codatlendingfinancialstatementsaccounts.go + - codatlendingloanwritebackaccounts.go + - codatlendingpayments.go + - codatlendingreports.go + - codatlendingsalespayments.go + - codatlendingsuppliers.go + - codatlendingtransactions.go + - codatlendingtransfers.go + - companies.go + - companyinfo.go + - connections.go + - createoperations.go + - creditnotes.go + - customers.go + - dataintegrity.go + - directcosts.go + - directincomes.go + - disputes.go + - docs/pkg/models/operations/createaccountrequest.md + - docs/pkg/models/operations/createaccountresponse.md + - docs/pkg/models/operations/createbankaccountrequest.md + - docs/pkg/models/operations/createbankaccountresponse.md + - docs/pkg/models/operations/createbanktransactionsrequest.md + - docs/pkg/models/operations/createbanktransactionsresponse.md + - docs/pkg/models/operations/createcompanyresponse.md - docs/pkg/models/operations/createconnectionrequest.md + - docs/pkg/models/operations/createconnectionrequestbody.md - docs/pkg/models/operations/createconnectionresponse.md + - docs/pkg/models/operations/createdirectcostrequest.md + - docs/pkg/models/operations/createdirectcostresponse.md + - docs/pkg/models/operations/createpaymentrequest.md + - docs/pkg/models/operations/createpaymentresponse.md + - docs/pkg/models/operations/createsupplierrequest.md + - docs/pkg/models/operations/createsupplierresponse.md + - docs/pkg/models/operations/createtransferrequest.md + - docs/pkg/models/operations/createtransferresponse.md + - docs/pkg/models/operations/deletecompanyrequest.md + - docs/pkg/models/operations/deletecompanyresponse.md - docs/pkg/models/operations/deleteconnectionrequest.md - docs/pkg/models/operations/deleteconnectionresponse.md - - docs/pkg/models/operations/getconnectionrequest.md - - docs/pkg/models/operations/getconnectionresponse.md - - docs/pkg/models/operations/listconnectionsrequest.md - - docs/pkg/models/operations/listconnectionsresponse.md - - docs/pkg/models/operations/unlinkconnectionupdateconnection.md - - docs/pkg/models/operations/unlinkconnectionrequest.md - - docs/pkg/models/operations/unlinkconnectionresponse.md - - docs/pkg/models/operations/getaccountingaccounttransactionrequest.md - - docs/pkg/models/operations/getaccountingaccounttransactionresponse.md - - docs/pkg/models/operations/listaccountingaccounttransactionsrequest.md - - docs/pkg/models/operations/listaccountingaccounttransactionsresponse.md + - docs/pkg/models/operations/downloadaccountingbillattachmentrequest.md + - docs/pkg/models/operations/downloadaccountingbillattachmentresponse.md + - docs/pkg/models/operations/downloadaccountingcustomerattachmentrequest.md + - docs/pkg/models/operations/downloadaccountingcustomerattachmentresponse.md - docs/pkg/models/operations/downloadaccountingdirectcostattachmentrequest.md - docs/pkg/models/operations/downloadaccountingdirectcostattachmentresponse.md - - docs/pkg/models/operations/getaccountingdirectcostrequest.md - - docs/pkg/models/operations/getaccountingdirectcostresponse.md + - docs/pkg/models/operations/downloadaccountingdirectincomeattachmentrequest.md + - docs/pkg/models/operations/downloadaccountingdirectincomeattachmentresponse.md + - docs/pkg/models/operations/downloadaccountinginvoiceattachmentrequest.md + - docs/pkg/models/operations/downloadaccountinginvoiceattachmentresponse.md + - docs/pkg/models/operations/downloadaccountinginvoicepdfrequest.md + - docs/pkg/models/operations/downloadaccountinginvoicepdfresponse.md + - docs/pkg/models/operations/downloadaccountingsupplierattachmentrequest.md + - docs/pkg/models/operations/downloadaccountingsupplierattachmentresponse.md + - docs/pkg/models/operations/downloadexcelreportrequest.md + - docs/pkg/models/operations/downloadexcelreportresponse.md + - docs/pkg/models/operations/downloadfilesrequest.md + - docs/pkg/models/operations/downloadfilesresponse.md + - docs/pkg/models/operations/endbankstatementuploadsessionrequest.md + - docs/pkg/models/operations/endbankstatementuploadsessionresponse.md + - docs/pkg/models/operations/generateexcelreportrequest.md + - docs/pkg/models/operations/generateexcelreportresponse.md + - docs/pkg/models/operations/generateloansummaryrequest.md + - docs/pkg/models/operations/generateloansummaryresponse.md + - docs/pkg/models/operations/generateloantransactionsrequest.md + - docs/pkg/models/operations/generateloantransactionsresponse.md + - docs/pkg/models/operations/getaccountingaccountrequest.md + - docs/pkg/models/operations/getaccountingaccountresponse.md + - docs/pkg/models/operations/getaccountingaccounttransactionrequest.md + - docs/pkg/models/operations/getaccountingaccounttransactionresponse.md + - docs/pkg/models/operations/getaccountingagedcreditorsreportrequest.md + - docs/pkg/models/operations/getaccountingagedcreditorsreportresponse.md + - docs/pkg/models/operations/getaccountingageddebtorsreportrequest.md + - docs/pkg/models/operations/getaccountingageddebtorsreportresponse.md + - docs/pkg/models/operations/getaccountingbalancesheetrequest.md + - docs/pkg/models/operations/getaccountingbalancesheetresponse.md + - docs/pkg/models/operations/getaccountingbankaccountrequest.md + - docs/pkg/models/operations/getaccountingbankaccountresponse.md + - docs/pkg/models/operations/getaccountingbillattachmentrequest.md + - docs/pkg/models/operations/getaccountingbillattachmentresponse.md + - docs/pkg/models/operations/getaccountingbillcreditnoterequest.md + - docs/pkg/models/operations/getaccountingbillcreditnoteresponse.md + - docs/pkg/models/operations/getaccountingbillpaymentrequest.md + - docs/pkg/models/operations/getaccountingbillpaymentresponse.md + - docs/pkg/models/operations/getaccountingbillrequest.md + - docs/pkg/models/operations/getaccountingbillresponse.md + - docs/pkg/models/operations/getaccountingcashflowstatementrequest.md + - docs/pkg/models/operations/getaccountingcashflowstatementresponse.md + - docs/pkg/models/operations/getaccountingcreditnoterequest.md + - docs/pkg/models/operations/getaccountingcreditnoteresponse.md + - docs/pkg/models/operations/getaccountingcustomerattachmentrequest.md + - docs/pkg/models/operations/getaccountingcustomerattachmentresponse.md + - docs/pkg/models/operations/getaccountingcustomerrequest.md + - docs/pkg/models/operations/getaccountingcustomerresponse.md - docs/pkg/models/operations/getaccountingdirectcostattachmentrequest.md - docs/pkg/models/operations/getaccountingdirectcostattachmentresponse.md - - docs/pkg/models/operations/listaccountingdirectcostsrequest.md - - docs/pkg/models/operations/listaccountingdirectcostsresponse.md - - docs/pkg/models/operations/listaccountingdirectcostattachmentsrequest.md - - docs/pkg/models/operations/listaccountingdirectcostattachmentsresponse.md - - docs/pkg/models/operations/getaccountingtransferrequest.md - - docs/pkg/models/operations/getaccountingtransferresponse.md - - docs/pkg/models/operations/listaccountingtransfersrequest.md - - docs/pkg/models/operations/listaccountingtransfersresponse.md + - docs/pkg/models/operations/getaccountingdirectcostrequest.md + - docs/pkg/models/operations/getaccountingdirectcostresponse.md + - docs/pkg/models/operations/getaccountingdirectincomeattachmentrequest.md + - docs/pkg/models/operations/getaccountingdirectincomeattachmentresponse.md + - docs/pkg/models/operations/getaccountingdirectincomerequest.md + - docs/pkg/models/operations/getaccountingdirectincomeresponse.md + - docs/pkg/models/operations/getaccountinginvoiceattachmentrequest.md + - docs/pkg/models/operations/getaccountinginvoiceattachmentresponse.md + - docs/pkg/models/operations/getaccountinginvoicerequest.md + - docs/pkg/models/operations/getaccountinginvoiceresponse.md - docs/pkg/models/operations/getaccountingjournalentryrequest.md - docs/pkg/models/operations/getaccountingjournalentryresponse.md - - docs/pkg/models/operations/listaccountingjournalentriesrequest.md - - docs/pkg/models/operations/listaccountingjournalentriesresponse.md - docs/pkg/models/operations/getaccountingjournalrequest.md - docs/pkg/models/operations/getaccountingjournalresponse.md - - docs/pkg/models/operations/listaccountingjournalsrequest.md - - docs/pkg/models/operations/listaccountingjournalsresponse.md - - docs/pkg/models/operations/listaccountingbankaccounttransactionsrequest.md - - docs/pkg/models/operations/listaccountingbankaccounttransactionsresponse.md - - docs/pkg/models/operations/getaccountingbankaccountrequest.md - - docs/pkg/models/operations/getaccountingbankaccountresponse.md - - docs/pkg/models/operations/listaccountingbankaccountsrequest.md - - docs/pkg/models/operations/listaccountingbankaccountsresponse.md - - docs/pkg/models/operations/listbankingaccountbalancesrequest.md - - docs/pkg/models/operations/listbankingaccountbalancesresponse.md + - docs/pkg/models/operations/getaccountingpaymentrequest.md + - docs/pkg/models/operations/getaccountingpaymentresponse.md + - docs/pkg/models/operations/getaccountingprofilerequest.md + - docs/pkg/models/operations/getaccountingprofileresponse.md + - docs/pkg/models/operations/getaccountingprofitandlossrequest.md + - docs/pkg/models/operations/getaccountingprofitandlossresponse.md + - docs/pkg/models/operations/getaccountingsupplierattachmentrequest.md + - docs/pkg/models/operations/getaccountingsupplierattachmentresponse.md + - docs/pkg/models/operations/getaccountingsupplierrequest.md + - docs/pkg/models/operations/getaccountingsupplierresponse.md + - docs/pkg/models/operations/getaccountingtransferrequest.md + - docs/pkg/models/operations/getaccountingtransferresponse.md - docs/pkg/models/operations/getbankingaccountrequest.md - docs/pkg/models/operations/getbankingaccountresponse.md - - docs/pkg/models/operations/listbankingaccountsrequest.md - - docs/pkg/models/operations/listbankingaccountsresponse.md - docs/pkg/models/operations/getbankingtransactioncategoryrequest.md - docs/pkg/models/operations/getbankingtransactioncategoryresponse.md - - docs/pkg/models/operations/listbankingtransactioncategoriesrequest.md - - docs/pkg/models/operations/listbankingtransactioncategoriesresponse.md - docs/pkg/models/operations/getbankingtransactionrequest.md - docs/pkg/models/operations/getbankingtransactionresponse.md - - docs/pkg/models/operations/listbankingtransactionsrequest.md - - docs/pkg/models/operations/listbankingtransactionsresponse.md + - docs/pkg/models/operations/getbankstatementuploadconfigurationrequest.md + - docs/pkg/models/operations/getbankstatementuploadconfigurationresponse.md + - docs/pkg/models/operations/getcategorizedbalancesheetstatementrequest.md + - docs/pkg/models/operations/getcategorizedbalancesheetstatementresponse.md - docs/pkg/models/operations/getcategorizedbankstatementrequest.md - docs/pkg/models/operations/getcategorizedbankstatementresponse.md - - docs/pkg/models/operations/downloadaccountingbillattachmentrequest.md - - docs/pkg/models/operations/downloadaccountingbillattachmentresponse.md - - docs/pkg/models/operations/getaccountingbillrequest.md - - docs/pkg/models/operations/getaccountingbillresponse.md - - docs/pkg/models/operations/getaccountingbillattachmentrequest.md - - docs/pkg/models/operations/getaccountingbillattachmentresponse.md - - docs/pkg/models/operations/listaccountingbillsrequest.md - - docs/pkg/models/operations/listaccountingbillsresponse.md - - docs/pkg/models/operations/listaccountingbillattachmentsrequest.md - - docs/pkg/models/operations/listaccountingbillattachmentsresponse.md - - docs/pkg/models/operations/downloadaccountingsupplierattachmentrequest.md - - docs/pkg/models/operations/downloadaccountingsupplierattachmentresponse.md - - docs/pkg/models/operations/getaccountingsupplierrequest.md - - docs/pkg/models/operations/getaccountingsupplierresponse.md - - docs/pkg/models/operations/getaccountingsupplierattachmentrequest.md - - docs/pkg/models/operations/getaccountingsupplierattachmentresponse.md - - docs/pkg/models/operations/listaccountingsuppliersrequest.md - - docs/pkg/models/operations/listaccountingsuppliersresponse.md - - docs/pkg/models/operations/listaccountingsupplierattachmentsrequest.md - - docs/pkg/models/operations/listaccountingsupplierattachmentsresponse.md - - docs/pkg/models/operations/getaccountingbillcreditnoterequest.md - - docs/pkg/models/operations/getaccountingbillcreditnoteresponse.md - - docs/pkg/models/operations/listaccountingbillcreditnotesrequest.md - - docs/pkg/models/operations/listaccountingbillcreditnotesresponse.md - - docs/pkg/models/operations/getaccountingbillpaymentrequest.md - - docs/pkg/models/operations/getaccountingbillpaymentresponse.md - - docs/pkg/models/operations/listaccountingbillpaymentsrequest.md - - docs/pkg/models/operations/listaccountingbillpaymentsresponse.md + - docs/pkg/models/operations/getcategorizedprofitandlossstatementrequest.md + - docs/pkg/models/operations/getcategorizedprofitandlossstatementresponse.md - docs/pkg/models/operations/getcommercecustomerrequest.md - docs/pkg/models/operations/getcommercecustomerresponse.md - - docs/pkg/models/operations/listcommercecustomersrequest.md - - docs/pkg/models/operations/listcommercecustomersresponse.md + - docs/pkg/models/operations/getcommercecustomerretentionmetricsrequest.md + - docs/pkg/models/operations/getcommercecustomerretentionmetricsresponse.md - docs/pkg/models/operations/getcommercedisputerequest.md - docs/pkg/models/operations/getcommercedisputeresponse.md - - docs/pkg/models/operations/listcommercedisputesrequest.md - - docs/pkg/models/operations/listcommercedisputesresponse.md + - docs/pkg/models/operations/getcommercelifetimevaluemetricsrequest.md + - docs/pkg/models/operations/getcommercelifetimevaluemetricsresponse.md - docs/pkg/models/operations/getcommercelocationrequest.md - docs/pkg/models/operations/getcommercelocationresponse.md - - docs/pkg/models/operations/listcommercelocationsrequest.md - - docs/pkg/models/operations/listcommercelocationsresponse.md - docs/pkg/models/operations/getcommerceorderrequest.md - docs/pkg/models/operations/getcommerceorderresponse.md - - docs/pkg/models/operations/listcommerceordersrequest.md - - docs/pkg/models/operations/listcommerceordersresponse.md + - docs/pkg/models/operations/getcommerceordersreportrequest.md + - docs/pkg/models/operations/getcommerceordersreportresponse.md - docs/pkg/models/operations/getcommercepaymentmethodrequest.md - docs/pkg/models/operations/getcommercepaymentmethodresponse.md - - docs/pkg/models/operations/listcommercepaymentmethodsrequest.md - - docs/pkg/models/operations/listcommercepaymentmethodsresponse.md - docs/pkg/models/operations/getcommercepaymentrequest.md - docs/pkg/models/operations/getcommercepaymentresponse.md - - docs/pkg/models/operations/listcommercepaymentsrequest.md - - docs/pkg/models/operations/listcommercepaymentsresponse.md - docs/pkg/models/operations/getcommerceproductcategoryrequest.md - docs/pkg/models/operations/getcommerceproductcategoryresponse.md - - docs/pkg/models/operations/listcommerceproductcategoriesrequest.md - - docs/pkg/models/operations/listcommerceproductcategoriesresponse.md - docs/pkg/models/operations/getcommerceproductrequest.md - docs/pkg/models/operations/getcommerceproductresponse.md - - docs/pkg/models/operations/listcommerceproductsrequest.md - - docs/pkg/models/operations/listcommerceproductsresponse.md - - docs/pkg/models/operations/getcommercetransactionrequest.md - - docs/pkg/models/operations/getcommercetransactionresponse.md - - docs/pkg/models/operations/listcommercetransactionsrequest.md - - docs/pkg/models/operations/listcommercetransactionsresponse.md - - docs/pkg/models/operations/getcommercecustomerretentionmetricsrequest.md - - docs/pkg/models/operations/getcommercecustomerretentionmetricsresponse.md - - docs/pkg/models/operations/getcommercelifetimevaluemetricsrequest.md - - docs/pkg/models/operations/getcommercelifetimevaluemetricsresponse.md - - docs/pkg/models/operations/getcommercerevenuemetricsrequest.md - - docs/pkg/models/operations/getcommercerevenuemetricsresponse.md - - docs/pkg/models/operations/getcommerceordersreportrequest.md - - docs/pkg/models/operations/getcommerceordersreportresponse.md - - docs/pkg/models/operations/getcommercerefundsreportrequest.md - - docs/pkg/models/operations/getcommercerefundsreportresponse.md - - docs/pkg/models/operations/getaccountingprofilerequest.md - - docs/pkg/models/operations/getaccountingprofileresponse.md - docs/pkg/models/operations/getcommerceprofilerequest.md - docs/pkg/models/operations/getcommerceprofileresponse.md - - docs/pkg/models/operations/downloadaccountingcustomerattachmentrequest.md - - docs/pkg/models/operations/downloadaccountingcustomerattachmentresponse.md - - docs/pkg/models/operations/getaccountingcustomerrequest.md - - docs/pkg/models/operations/getaccountingcustomerresponse.md - - docs/pkg/models/operations/getaccountingcustomerattachmentrequest.md - - docs/pkg/models/operations/getaccountingcustomerattachmentresponse.md - - docs/pkg/models/operations/listaccountingcustomersrequest.md - - docs/pkg/models/operations/listaccountingcustomersresponse.md - - docs/pkg/models/operations/listaccountingcustomerattachmentsrequest.md - - docs/pkg/models/operations/listaccountingcustomerattachmentsresponse.md - - docs/pkg/models/operations/downloadaccountingdirectincomeattachmentrequest.md - - docs/pkg/models/operations/downloadaccountingdirectincomeattachmentresponse.md - - docs/pkg/models/operations/getaccountingdirectincomerequest.md - - docs/pkg/models/operations/getaccountingdirectincomeresponse.md - - docs/pkg/models/operations/getaccountingdirectincomeattachmentrequest.md - - docs/pkg/models/operations/getaccountingdirectincomeattachmentresponse.md - - docs/pkg/models/operations/listaccountingdirectincomesrequest.md - - docs/pkg/models/operations/listaccountingdirectincomesresponse.md - - docs/pkg/models/operations/listaccountingdirectincomeattachmentsrequest.md - - docs/pkg/models/operations/listaccountingdirectincomeattachmentsresponse.md - - docs/pkg/models/operations/downloadaccountinginvoiceattachmentrequest.md - - docs/pkg/models/operations/downloadaccountinginvoiceattachmentresponse.md - - docs/pkg/models/operations/downloadaccountinginvoicepdfrequest.md - - docs/pkg/models/operations/downloadaccountinginvoicepdfresponse.md - - docs/pkg/models/operations/getaccountinginvoicerequest.md - - docs/pkg/models/operations/getaccountinginvoiceresponse.md - - docs/pkg/models/operations/getaccountinginvoiceattachmentrequest.md - - docs/pkg/models/operations/getaccountinginvoiceattachmentresponse.md - - docs/pkg/models/operations/listaccountinginvoicesrequest.md - - docs/pkg/models/operations/listaccountinginvoicesresponse.md - - docs/pkg/models/operations/listaccountinginvoiceattachmentsrequest.md - - docs/pkg/models/operations/listaccountinginvoiceattachmentsresponse.md - - docs/pkg/models/operations/listreconciledinvoicesrequest.md - - docs/pkg/models/operations/listreconciledinvoicesresponse.md - - docs/pkg/models/operations/getaccountingcreditnoterequest.md - - docs/pkg/models/operations/getaccountingcreditnoteresponse.md - - docs/pkg/models/operations/listaccountingcreditnotesrequest.md - - docs/pkg/models/operations/listaccountingcreditnotesresponse.md - - docs/pkg/models/operations/getaccountingpaymentrequest.md - - docs/pkg/models/operations/getaccountingpaymentresponse.md - - docs/pkg/models/operations/listaccountingpaymentsrequest.md - - docs/pkg/models/operations/listaccountingpaymentsresponse.md - - docs/types/date.md - - docs/pkg/models/operations/getaccountingagedcreditorsreportrequest.md - - docs/pkg/models/operations/getaccountingagedcreditorsreportresponse.md - - docs/pkg/models/operations/getaccountingageddebtorsreportrequest.md - - docs/pkg/models/operations/getaccountingageddebtorsreportresponse.md - - docs/pkg/models/operations/isagedcreditorsreportavailablerequest.md - - docs/pkg/models/operations/isagedcreditorsreportavailableresponse.md - - docs/pkg/models/operations/isageddebtorsreportavailablerequest.md - - docs/pkg/models/operations/isageddebtorsreportavailableresponse.md - - docs/pkg/models/operations/downloadfilesrequest.md - - docs/pkg/models/operations/downloadfilesresponse.md - - docs/pkg/models/operations/listfilesrequest.md - - docs/pkg/models/operations/listfilesresponse.md - - docs/pkg/models/operations/uploadfilesrequest.md - - docs/pkg/models/operations/uploadfilesresponse.md - - docs/pkg/models/operations/createbankaccountrequest.md - - docs/pkg/models/operations/createbankaccountresponse.md - - docs/pkg/models/operations/getcreateupdatebankaccountsmodelrequest.md - - docs/pkg/models/operations/getcreateupdatebankaccountsmodelresponse.md - - docs/pkg/models/operations/createbanktransactionsrequest.md - - docs/pkg/models/operations/createbanktransactionsresponse.md + - docs/pkg/models/operations/getcommercerefundsreportrequest.md + - docs/pkg/models/operations/getcommercerefundsreportresponse.md + - docs/pkg/models/operations/getcommercerevenuemetricsrequest.md + - docs/pkg/models/operations/getcommercerevenuemetricsresponse.md + - docs/pkg/models/operations/getcommercetransactionrequest.md + - docs/pkg/models/operations/getcommercetransactionresponse.md + - docs/pkg/models/operations/getcompanyrequest.md + - docs/pkg/models/operations/getcompanyresponse.md + - docs/pkg/models/operations/getconnectionrequest.md + - docs/pkg/models/operations/getconnectionresponse.md - docs/pkg/models/operations/getcreatebanktransactionsmodelrequest.md - docs/pkg/models/operations/getcreatebanktransactionsmodelresponse.md - - docs/pkg/models/operations/createaccountrequest.md - - docs/pkg/models/operations/createaccountresponse.md - docs/pkg/models/operations/getcreatechartofaccountsmodelrequest.md - docs/pkg/models/operations/getcreatechartofaccountsmodelresponse.md - - docs/pkg/models/operations/createdirectcostrequest.md - - docs/pkg/models/operations/createdirectcostresponse.md - docs/pkg/models/operations/getcreatedirectcostsmodelrequest.md - docs/pkg/models/operations/getcreatedirectcostsmodelresponse.md - - docs/pkg/models/operations/createpaymentrequest.md - - docs/pkg/models/operations/createpaymentresponse.md + - docs/pkg/models/operations/getcreateoperationrequest.md + - docs/pkg/models/operations/getcreateoperationresponse.md - docs/pkg/models/operations/getcreatepaymentmodelrequest.md - docs/pkg/models/operations/getcreatepaymentmodelresponse.md - - docs/pkg/models/operations/createsupplierrequest.md - - docs/pkg/models/operations/createsupplierresponse.md - - docs/pkg/models/operations/getcreateupdatesuppliersmodelrequest.md - - docs/pkg/models/operations/getcreateupdatesuppliersmodelresponse.md - - docs/pkg/models/operations/createtransferrequest.md - - docs/pkg/models/operations/createtransferresponse.md - docs/pkg/models/operations/getcreatetransfersmodelrequest.md - docs/pkg/models/operations/getcreatetransfersmodelresponse.md - - docs/pkg/models/operations/getcreateoperationrequest.md - - docs/pkg/models/operations/getcreateoperationresponse.md - - docs/pkg/models/operations/listcreateoperationsrequest.md - - docs/pkg/models/operations/listcreateoperationsresponse.md - - docs/pkg/models/operations/getaccountingaccountrequest.md - - docs/pkg/models/operations/getaccountingaccountresponse.md - - docs/pkg/models/operations/listaccountingaccountsrequest.md - - docs/pkg/models/operations/listaccountingaccountsresponse.md - - docs/pkg/models/operations/getaccountingbalancesheetrequest.md - - docs/pkg/models/operations/getaccountingbalancesheetresponse.md - - docs/pkg/models/operations/getcategorizedbalancesheetstatementrequest.md - - docs/pkg/models/operations/getcategorizedbalancesheetstatementresponse.md - - docs/pkg/models/operations/getaccountingcashflowstatementrequest.md - - docs/pkg/models/operations/getaccountingcashflowstatementresponse.md - - docs/pkg/models/operations/getaccountingprofitandlossrequest.md - - docs/pkg/models/operations/getaccountingprofitandlossresponse.md - - docs/pkg/models/operations/getcategorizedprofitandlossstatementrequest.md - - docs/pkg/models/operations/getcategorizedprofitandlossstatementresponse.md + - docs/pkg/models/operations/getcreateupdatebankaccountsmodelrequest.md + - docs/pkg/models/operations/getcreateupdatebankaccountsmodelresponse.md + - docs/pkg/models/operations/getcreateupdatesuppliersmodelrequest.md + - docs/pkg/models/operations/getcreateupdatesuppliersmodelresponse.md + - docs/pkg/models/operations/getdataintegritystatusrequest.md + - docs/pkg/models/operations/getdataintegritystatusresponse.md + - docs/pkg/models/operations/getdataintegritysummariesrequest.md + - docs/pkg/models/operations/getdataintegritysummariesresponse.md + - docs/pkg/models/operations/getdatastatusdatastatuses.md - docs/pkg/models/operations/getdatastatusrequest.md - docs/pkg/models/operations/getdatastatusresponse.md - - docs/pkg/models/operations/refreshalldatatypesrequest.md - - docs/pkg/models/operations/refreshalldatatypesresponse.md - - docs/pkg/models/operations/refreshdatatyperequest.md - - docs/pkg/models/operations/refreshdatatyperesponse.md - - docs/pkg/models/operations/getpulloperationrequest.md - - docs/pkg/models/operations/getpulloperationresponse.md - - docs/pkg/models/operations/listpulloperationsrequest.md - - docs/pkg/models/operations/listpulloperationsresponse.md - - docs/pkg/models/operations/sourcetype.md - - docs/pkg/models/operations/generateloansummaryrequest.md - - docs/pkg/models/operations/generateloansummaryresponse.md - - docs/pkg/models/operations/queryparamsourcetype.md - - docs/pkg/models/operations/generateloantransactionsrequest.md - - docs/pkg/models/operations/generateloantransactionsresponse.md + - docs/pkg/models/operations/getexcelreportgenerationstatusrequest.md + - docs/pkg/models/operations/getexcelreportgenerationstatusresponse.md - docs/pkg/models/operations/getloansummaryqueryparamsourcetype.md - docs/pkg/models/operations/getloansummaryrequest.md - docs/pkg/models/operations/getloansummaryresponse.md + - docs/pkg/models/operations/getpulloperationrequest.md + - docs/pkg/models/operations/getpulloperationresponse.md + - docs/pkg/models/operations/isagedcreditorsreportavailablerequest.md + - docs/pkg/models/operations/isagedcreditorsreportavailableresponse.md + - docs/pkg/models/operations/isageddebtorsreportavailablerequest.md + - docs/pkg/models/operations/isageddebtorsreportavailableresponse.md + - docs/pkg/models/operations/listaccountingaccountsrequest.md + - docs/pkg/models/operations/listaccountingaccountsresponse.md + - docs/pkg/models/operations/listaccountingaccounttransactionsrequest.md + - docs/pkg/models/operations/listaccountingaccounttransactionsresponse.md + - docs/pkg/models/operations/listaccountingbankaccountsrequest.md + - docs/pkg/models/operations/listaccountingbankaccountsresponse.md + - docs/pkg/models/operations/listaccountingbankaccounttransactionsrequest.md + - docs/pkg/models/operations/listaccountingbankaccounttransactionsresponse.md + - docs/pkg/models/operations/listaccountingbillattachmentsrequest.md + - docs/pkg/models/operations/listaccountingbillattachmentsresponse.md + - docs/pkg/models/operations/listaccountingbillcreditnotesrequest.md + - docs/pkg/models/operations/listaccountingbillcreditnotesresponse.md + - docs/pkg/models/operations/listaccountingbillpaymentsrequest.md + - docs/pkg/models/operations/listaccountingbillpaymentsresponse.md + - docs/pkg/models/operations/listaccountingbillsrequest.md + - docs/pkg/models/operations/listaccountingbillsresponse.md + - docs/pkg/models/operations/listaccountingcreditnotesrequest.md + - docs/pkg/models/operations/listaccountingcreditnotesresponse.md + - docs/pkg/models/operations/listaccountingcustomerattachmentsrequest.md + - docs/pkg/models/operations/listaccountingcustomerattachmentsresponse.md + - docs/pkg/models/operations/listaccountingcustomersrequest.md + - docs/pkg/models/operations/listaccountingcustomersresponse.md + - docs/pkg/models/operations/listaccountingdirectcostattachmentsrequest.md + - docs/pkg/models/operations/listaccountingdirectcostattachmentsresponse.md + - docs/pkg/models/operations/listaccountingdirectcostsrequest.md + - docs/pkg/models/operations/listaccountingdirectcostsresponse.md + - docs/pkg/models/operations/listaccountingdirectincomeattachmentsrequest.md + - docs/pkg/models/operations/listaccountingdirectincomeattachmentsresponse.md + - docs/pkg/models/operations/listaccountingdirectincomesrequest.md + - docs/pkg/models/operations/listaccountingdirectincomesresponse.md + - docs/pkg/models/operations/listaccountinginvoiceattachmentsrequest.md + - docs/pkg/models/operations/listaccountinginvoiceattachmentsresponse.md + - docs/pkg/models/operations/listaccountinginvoicesrequest.md + - docs/pkg/models/operations/listaccountinginvoicesresponse.md + - docs/pkg/models/operations/listaccountingjournalentriesrequest.md + - docs/pkg/models/operations/listaccountingjournalentriesresponse.md + - docs/pkg/models/operations/listaccountingjournalsrequest.md + - docs/pkg/models/operations/listaccountingjournalsresponse.md + - docs/pkg/models/operations/listaccountingpaymentsrequest.md + - docs/pkg/models/operations/listaccountingpaymentsresponse.md + - docs/pkg/models/operations/listaccountingsupplierattachmentsrequest.md + - docs/pkg/models/operations/listaccountingsupplierattachmentsresponse.md + - docs/pkg/models/operations/listaccountingsuppliersrequest.md + - docs/pkg/models/operations/listaccountingsuppliersresponse.md + - docs/pkg/models/operations/listaccountingtransfersrequest.md + - docs/pkg/models/operations/listaccountingtransfersresponse.md + - docs/pkg/models/operations/listbankingaccountbalancesrequest.md + - docs/pkg/models/operations/listbankingaccountbalancesresponse.md + - docs/pkg/models/operations/listbankingaccountsrequest.md + - docs/pkg/models/operations/listbankingaccountsresponse.md + - docs/pkg/models/operations/listbankingtransactioncategoriesrequest.md + - docs/pkg/models/operations/listbankingtransactioncategoriesresponse.md + - docs/pkg/models/operations/listbankingtransactionsrequest.md + - docs/pkg/models/operations/listbankingtransactionsresponse.md + - docs/pkg/models/operations/listcommercecustomersrequest.md + - docs/pkg/models/operations/listcommercecustomersresponse.md + - docs/pkg/models/operations/listcommercedisputesrequest.md + - docs/pkg/models/operations/listcommercedisputesresponse.md + - docs/pkg/models/operations/listcommercelocationsrequest.md + - docs/pkg/models/operations/listcommercelocationsresponse.md + - docs/pkg/models/operations/listcommerceordersrequest.md + - docs/pkg/models/operations/listcommerceordersresponse.md + - docs/pkg/models/operations/listcommercepaymentmethodsrequest.md + - docs/pkg/models/operations/listcommercepaymentmethodsresponse.md + - docs/pkg/models/operations/listcommercepaymentsrequest.md + - docs/pkg/models/operations/listcommercepaymentsresponse.md + - docs/pkg/models/operations/listcommerceproductcategoriesrequest.md + - docs/pkg/models/operations/listcommerceproductcategoriesresponse.md + - docs/pkg/models/operations/listcommerceproductsrequest.md + - docs/pkg/models/operations/listcommerceproductsresponse.md + - docs/pkg/models/operations/listcommercetransactionsrequest.md + - docs/pkg/models/operations/listcommercetransactionsresponse.md + - docs/pkg/models/operations/listcompaniesrequest.md + - docs/pkg/models/operations/listcompaniesresponse.md + - docs/pkg/models/operations/listconnectionsrequest.md + - docs/pkg/models/operations/listconnectionsresponse.md + - docs/pkg/models/operations/listcreateoperationsrequest.md + - docs/pkg/models/operations/listcreateoperationsresponse.md + - docs/pkg/models/operations/listdataintegritydetailsrequest.md + - docs/pkg/models/operations/listdataintegritydetailsresponse.md + - docs/pkg/models/operations/listfilesrequest.md + - docs/pkg/models/operations/listfilesresponse.md - docs/pkg/models/operations/listloantransactionsqueryparamsourcetype.md - docs/pkg/models/operations/listloantransactionsrequest.md - docs/pkg/models/operations/listloantransactionsresponse.md - - docs/pkg/models/operations/listdataintegritydetailsrequest.md - - docs/pkg/models/operations/listdataintegritydetailsresponse.md - - docs/pkg/models/operations/getdataintegritystatusrequest.md - - docs/pkg/models/operations/getdataintegritystatusresponse.md - - docs/pkg/models/operations/getdataintegritysummariesrequest.md - - docs/pkg/models/operations/getdataintegritysummariesresponse.md - - docs/pkg/models/operations/downloadexcelreportrequest.md - - docs/pkg/models/operations/downloadexcelreportresponse.md - - docs/pkg/models/operations/generateexcelreportrequest.md - - docs/pkg/models/operations/generateexcelreportresponse.md - - docs/pkg/models/operations/getexcelreportgenerationstatusrequest.md - - docs/pkg/models/operations/getexcelreportgenerationstatusresponse.md - - docs/pkg/models/shared/groupreference.md - - docs/pkg/models/shared/company.md - - docs/pkg/models/shared/sourcetype.md - - docs/pkg/models/shared/connection.md - - docs/pkg/models/shared/dataconnectionstatus.md - - docs/pkg/models/shared/dataconnectionerror.md - - docs/pkg/models/shared/errorvalidation.md - - docs/pkg/models/shared/errorvalidationitem.md - - docs/pkg/models/shared/companyrequestbody.md - - docs/pkg/models/shared/items.md - - docs/pkg/models/shared/companies.md - - docs/pkg/models/shared/links.md - - docs/pkg/models/shared/halref.md - - docs/pkg/models/shared/connections.md - - docs/pkg/models/shared/status.md + - docs/pkg/models/operations/listpulloperationsrequest.md + - docs/pkg/models/operations/listpulloperationsresponse.md + - docs/pkg/models/operations/listreconciledinvoicesrequest.md + - docs/pkg/models/operations/listreconciledinvoicesresponse.md + - docs/pkg/models/operations/option.md + - docs/pkg/models/operations/queryparamsourcetype.md + - docs/pkg/models/operations/refreshalldatatypesrequest.md + - docs/pkg/models/operations/refreshalldatatypesresponse.md + - docs/pkg/models/operations/refreshdatatyperequest.md + - docs/pkg/models/operations/refreshdatatyperesponse.md + - docs/pkg/models/operations/setbankstatementuploadconfigurationrequest.md + - docs/pkg/models/operations/setbankstatementuploadconfigurationresponse.md + - docs/pkg/models/operations/sourcetype.md + - docs/pkg/models/operations/startbankstatementuploadsessionrequest.md + - docs/pkg/models/operations/startbankstatementuploadsessionresponse.md + - docs/pkg/models/operations/unlinkconnectionrequest.md + - docs/pkg/models/operations/unlinkconnectionresponse.md + - docs/pkg/models/operations/unlinkconnectionupdateconnection.md + - docs/pkg/models/operations/updatecompanyrequest.md + - docs/pkg/models/operations/updatecompanyresponse.md + - docs/pkg/models/operations/uploadbankstatementdatarequest.md + - docs/pkg/models/operations/uploadbankstatementdatarequestbody.md + - docs/pkg/models/operations/uploadbankstatementdataresponse.md + - docs/pkg/models/operations/uploadfilesrequest.md + - docs/pkg/models/operations/uploadfilesresponse.md + - docs/pkg/models/sdkerrors/errormessage.md + - docs/pkg/models/shared/accountbalance.md + - docs/pkg/models/shared/accountbalanceamounts.md + - docs/pkg/models/shared/accountcategoriesupdatedwebhook.md + - docs/pkg/models/shared/accountcategoriesupdatedwebhookdata.md + - docs/pkg/models/shared/accountcategorylevel.md + - docs/pkg/models/shared/accountidentifiers.md + - docs/pkg/models/shared/accountidentifiertype.md + - docs/pkg/models/shared/accountingaccount.md + - docs/pkg/models/shared/accountingaccounts.md - docs/pkg/models/shared/accountingaccounttransaction.md - - docs/pkg/models/shared/metadata.md - - docs/pkg/models/shared/accounttransactionline.md - - docs/pkg/models/shared/accounttransactionlinerecordrefdatatype.md - - docs/pkg/models/shared/accounttransactionlinerecordref.md - - docs/pkg/models/shared/bankaccountref.md - docs/pkg/models/shared/accountingaccounttransactions.md - - docs/pkg/models/shared/accountingdirectcostdatatype.md - - docs/pkg/models/shared/accountingdirectcostcontactreference.md - - docs/pkg/models/shared/accountingdirectcost.md - - docs/pkg/models/shared/supplementaldata.md - - docs/pkg/models/shared/allocation.md - - docs/pkg/models/shared/accountingpaymentallocation.md - - docs/pkg/models/shared/paymentallocationpayment.md - - docs/pkg/models/shared/accountref.md - - docs/pkg/models/shared/directcostlineitem.md - - docs/pkg/models/shared/trackingcategoryref.md - - docs/pkg/models/shared/tracking.md - - docs/pkg/models/shared/trackingrecordrefdatatype.md - - docs/pkg/models/shared/trackingrecordref.md - - docs/pkg/models/shared/recordref.md - - docs/pkg/models/shared/taxrateref.md - - docs/pkg/models/shared/propertieitemref.md + - docs/pkg/models/shared/accountingaccounttransactionstatus.md + - docs/pkg/models/shared/accountingaccountvaliddatatypelinks.md + - docs/pkg/models/shared/accountingaddress.md + - docs/pkg/models/shared/accountingaddresstype.md + - docs/pkg/models/shared/accountingagedcreditorreport.md + - docs/pkg/models/shared/accountingageddebtorreport.md - docs/pkg/models/shared/accountingattachment.md + - docs/pkg/models/shared/accountingbalancesheet.md + - docs/pkg/models/shared/accountingbankaccount.md + - docs/pkg/models/shared/accountingbankaccounts.md + - docs/pkg/models/shared/accountingbankaccounttype.md + - docs/pkg/models/shared/accountingbanktransaction.md + - docs/pkg/models/shared/accountingbanktransactions.md + - docs/pkg/models/shared/accountingbill.md + - docs/pkg/models/shared/accountingbillcreditnote.md + - docs/pkg/models/shared/accountingbillcreditnotes.md + - docs/pkg/models/shared/accountingbillpayment.md + - docs/pkg/models/shared/accountingbillpayments.md + - docs/pkg/models/shared/accountingbills.md + - docs/pkg/models/shared/accountingcashflowstatement.md + - docs/pkg/models/shared/accountingcompanyinfo.md + - docs/pkg/models/shared/accountingcreateaccountresponse.md + - docs/pkg/models/shared/accountingcreateaccountresponseaccountingaccount.md + - docs/pkg/models/shared/accountingcreateaccountresponsevaliddatatypelinks.md + - docs/pkg/models/shared/accountingcreatebankaccountresponse.md + - docs/pkg/models/shared/accountingcreatebankaccountresponseaccountingbankaccount.md + - docs/pkg/models/shared/accountingcreatebankaccounttransactions.md + - docs/pkg/models/shared/accountingcreatebanktransactions.md + - docs/pkg/models/shared/accountingcreatebanktransactionsresponse.md + - docs/pkg/models/shared/accountingcreatedirectcostresponse.md + - docs/pkg/models/shared/accountingcreatedirectcostresponseaccountingdirectcost.md + - docs/pkg/models/shared/accountingcreatepaymentresponse.md + - docs/pkg/models/shared/accountingcreatepaymentresponseaccountingpayment.md + - docs/pkg/models/shared/accountingcreatesupplierresponse.md + - docs/pkg/models/shared/accountingcreatesupplierresponseaccountingsupplier.md + - docs/pkg/models/shared/accountingcreatetransferresponse.md + - docs/pkg/models/shared/accountingcreatetransferresponseaccountingtransfer.md + - docs/pkg/models/shared/accountingcreditnote.md + - docs/pkg/models/shared/accountingcreditnotes.md + - docs/pkg/models/shared/accountingcustomer.md + - docs/pkg/models/shared/accountingcustomerref.md + - docs/pkg/models/shared/accountingcustomers.md + - docs/pkg/models/shared/accountingdirectcost.md - docs/pkg/models/shared/accountingdirectcosts.md - - docs/pkg/models/shared/attachments.md - - docs/pkg/models/shared/accountingtransfer.md - - docs/pkg/models/shared/transferaccount.md - - docs/pkg/models/shared/contactrefdatatype.md - - docs/pkg/models/shared/contactref.md - - docs/pkg/models/shared/accountingtransfers.md - - docs/pkg/models/shared/accountingjournalentry.md - - docs/pkg/models/shared/journalentryrecordrefdatatype.md - - docs/pkg/models/shared/journalentryrecordref.md - - docs/pkg/models/shared/journalref.md - - docs/pkg/models/shared/journallinetracking.md - - docs/pkg/models/shared/journalline.md - - docs/pkg/models/shared/accountingjournalentries.md + - docs/pkg/models/shared/accountingdirectincome.md + - docs/pkg/models/shared/accountingdirectincomes.md + - docs/pkg/models/shared/accountinginvoice.md + - docs/pkg/models/shared/accountinginvoicedatatype.md + - docs/pkg/models/shared/accountinginvoices.md - docs/pkg/models/shared/accountingjournal.md - - docs/pkg/models/shared/journalstatus.md + - docs/pkg/models/shared/accountingjournalentries.md + - docs/pkg/models/shared/accountingjournalentry.md - docs/pkg/models/shared/accountingjournals.md - - docs/pkg/models/shared/accountingbanktransactions.md - - docs/pkg/models/shared/accountingbanktransaction.md - - docs/pkg/models/shared/banktransactiontype.md - - docs/pkg/models/shared/accountingbankaccount.md - - docs/pkg/models/shared/accountingbankaccounttype.md - - docs/pkg/models/shared/accountingbankaccounts.md - - docs/pkg/models/shared/bankingaccountbalances.md - - docs/pkg/models/shared/bankingaccountbalance.md - - docs/pkg/models/shared/accountbalanceamounts.md - - docs/pkg/models/shared/bankingaccount.md + - docs/pkg/models/shared/accountingpayment.md + - docs/pkg/models/shared/accountingpaymentallocation.md + - docs/pkg/models/shared/accountingpayments.md + - docs/pkg/models/shared/accountingprofitandlossreport.md + - docs/pkg/models/shared/accountingsupplier.md + - docs/pkg/models/shared/accountingsuppliers.md + - docs/pkg/models/shared/accountingtransfer.md + - docs/pkg/models/shared/accountingtransfers.md - docs/pkg/models/shared/accountinstitution.md - - docs/pkg/models/shared/accountidentifiers.md - - docs/pkg/models/shared/accountidentifiertype.md + - docs/pkg/models/shared/accountprototype.md + - docs/pkg/models/shared/accountref.md + - docs/pkg/models/shared/accounts.md + - docs/pkg/models/shared/accountspayabletracking.md + - docs/pkg/models/shared/accountsreceivabletracking.md + - docs/pkg/models/shared/accountstatus.md + - docs/pkg/models/shared/accounttransactionline.md + - docs/pkg/models/shared/accounttransactionlinerecordref.md + - docs/pkg/models/shared/accounttransactionlinerecordrefdatatype.md + - docs/pkg/models/shared/accounttype.md + - docs/pkg/models/shared/agedcreditor.md + - docs/pkg/models/shared/agedcurrencyoutstanding.md + - docs/pkg/models/shared/ageddebtor.md + - docs/pkg/models/shared/agedoutstandingamount.md + - docs/pkg/models/shared/agedoutstandingamountdetail.md + - docs/pkg/models/shared/allocation.md + - docs/pkg/models/shared/attachments.md + - docs/pkg/models/shared/balancesheet.md + - docs/pkg/models/shared/bankaccountref.md + - docs/pkg/models/shared/bankaccountstatus.md + - docs/pkg/models/shared/bankingaccount.md + - docs/pkg/models/shared/bankingaccountbalance.md + - docs/pkg/models/shared/bankingaccountbalances.md - docs/pkg/models/shared/bankingaccounts.md - - docs/pkg/models/shared/bankingtransactioncategory.md - - docs/pkg/models/shared/transactioncategorystatus.md - - docs/pkg/models/shared/bankingtransactioncategories.md - docs/pkg/models/shared/bankingtransaction.md - - docs/pkg/models/shared/transactioncategoryref.md - - docs/pkg/models/shared/transactioncode.md + - docs/pkg/models/shared/bankingtransactioncategories.md + - docs/pkg/models/shared/bankingtransactioncategory.md + - docs/pkg/models/shared/bankingtransactionref.md - docs/pkg/models/shared/bankingtransactions.md - - docs/pkg/models/shared/enhancedcashflowtransactions.md - - docs/pkg/models/shared/enhancedcashflowitem.md - - docs/pkg/models/shared/enhancedcashflowtransaction.md - - docs/pkg/models/shared/transactioncategory.md - - docs/pkg/models/shared/sourceref.md - - docs/pkg/models/shared/reportinfo.md - - docs/pkg/models/shared/datasource.md - - docs/pkg/models/shared/accounts.md - - docs/pkg/models/shared/purchaseorderreference.md - - docs/pkg/models/shared/withholdingtax.md - - docs/pkg/models/shared/accountingbill.md - - docs/pkg/models/shared/supplierref.md - - docs/pkg/models/shared/billstatus.md - - docs/pkg/models/shared/billlineitemdatatype.md - - docs/pkg/models/shared/recordlinereference.md - - docs/pkg/models/shared/billlineitem.md - - docs/pkg/models/shared/accountspayabletracking.md - - docs/pkg/models/shared/projectref.md - - docs/pkg/models/shared/billedtotype.md - - docs/pkg/models/shared/accountingcustomerref.md - - docs/pkg/models/shared/accountingbills.md - - docs/pkg/models/shared/accountingsupplier.md - - docs/pkg/models/shared/supplierstatus.md - - docs/pkg/models/shared/accountingaddress.md - - docs/pkg/models/shared/accountingaddresstype.md - - docs/pkg/models/shared/accountingsuppliers.md - - docs/pkg/models/shared/accountingbillcreditnote.md - - docs/pkg/models/shared/withholdingtaxitems.md - - docs/pkg/models/shared/billcreditnotestatus.md - - docs/pkg/models/shared/itemreference.md - - docs/pkg/models/shared/taxratereference.md + - docs/pkg/models/shared/bankstatementuploadconfiguration.md + - docs/pkg/models/shared/banktransactiontype.md - docs/pkg/models/shared/billcreditnotelineitem.md - - docs/pkg/models/shared/accountingbillcreditnotes.md - - docs/pkg/models/shared/accountingbillpayment.md - - docs/pkg/models/shared/paymentmethodref.md + - docs/pkg/models/shared/billcreditnotestatus.md + - docs/pkg/models/shared/billedtotype.md + - docs/pkg/models/shared/billlineitem.md + - docs/pkg/models/shared/billlineitemdatatype.md - docs/pkg/models/shared/billpaymentline.md - docs/pkg/models/shared/billpaymentlinelink.md - docs/pkg/models/shared/billpaymentlinelinktype.md - - docs/pkg/models/shared/accountingbillpayments.md - - docs/pkg/models/shared/commercecustomer.md + - docs/pkg/models/shared/billstatus.md + - docs/pkg/models/shared/cashflowstatement.md + - docs/pkg/models/shared/clientratelimitreachedwebhook.md + - docs/pkg/models/shared/clientratelimitreachedwebhookdata.md + - docs/pkg/models/shared/clientratelimitresetwebhook.md + - docs/pkg/models/shared/clientratelimitresetwebhookdata.md + - docs/pkg/models/shared/clientratelimitwebhook.md + - docs/pkg/models/shared/clientratelimitwebhookpayload.md + - docs/pkg/models/shared/codatfile.md - docs/pkg/models/shared/commerceaddress.md - docs/pkg/models/shared/commerceaddresstype.md + - docs/pkg/models/shared/commercecompanyinfo.md + - docs/pkg/models/shared/commercecustomer.md + - docs/pkg/models/shared/commercecustomerref.md - docs/pkg/models/shared/commercecustomers.md - docs/pkg/models/shared/commercedispute.md - - docs/pkg/models/shared/disputestatus.md - - docs/pkg/models/shared/transactionsourceref.md - - docs/pkg/models/shared/transactionsourcetype.md - docs/pkg/models/shared/commercedisputes.md - docs/pkg/models/shared/commercelocation.md - docs/pkg/models/shared/commercelocations.md - docs/pkg/models/shared/commerceorder.md - - docs/pkg/models/shared/servicecharge.md - - docs/pkg/models/shared/servicechargetype.md - - docs/pkg/models/shared/taxcomponentallocation.md - - docs/pkg/models/shared/taxcomponentref.md - - docs/pkg/models/shared/paymentref.md - - docs/pkg/models/shared/paymenttype.md - - docs/pkg/models/shared/paymentstatus.md - - docs/pkg/models/shared/orderlineitem.md - - docs/pkg/models/shared/productvariantref.md - - docs/pkg/models/shared/productref.md - - docs/pkg/models/shared/orderdiscountallocation.md - - docs/pkg/models/shared/locationref.md - - docs/pkg/models/shared/commercecustomerref.md - docs/pkg/models/shared/commerceorders.md - - docs/pkg/models/shared/commercepaymentmethodstatus.md + - docs/pkg/models/shared/commercepayment.md - docs/pkg/models/shared/commercepaymentmethod.md - docs/pkg/models/shared/commercepaymentmethods.md - - docs/pkg/models/shared/commercepayment.md + - docs/pkg/models/shared/commercepaymentmethodstatus.md - docs/pkg/models/shared/commercepayments.md - - docs/pkg/models/shared/commerceproductcategory.md - - docs/pkg/models/shared/commercerecordref.md - - docs/pkg/models/shared/commerceproductcategories.md - docs/pkg/models/shared/commerceproduct.md - - docs/pkg/models/shared/productvariant.md - - docs/pkg/models/shared/productvariantstatus.md - - docs/pkg/models/shared/productprice.md - - docs/pkg/models/shared/productinventory.md - - docs/pkg/models/shared/productinventorylocation.md + - docs/pkg/models/shared/commerceproductcategories.md + - docs/pkg/models/shared/commerceproductcategory.md - docs/pkg/models/shared/commerceproducts.md - - docs/pkg/models/shared/commercetransaction.md - - docs/pkg/models/shared/transactiontype.md - - docs/pkg/models/shared/commercetransactions.md + - docs/pkg/models/shared/commercerecordref.md - docs/pkg/models/shared/commercereport.md - docs/pkg/models/shared/commercereportcomponent.md - - docs/pkg/models/shared/reportcomponentmeasure.md - - docs/pkg/models/shared/commercereportmeasure.md - - docs/pkg/models/shared/commercereporterror.md - - docs/pkg/models/shared/commercereportdimensionitems.md - docs/pkg/models/shared/commercereportdimension.md - - docs/pkg/models/shared/periodunit.md - - docs/pkg/models/shared/accountingcompanyinfo.md - - docs/pkg/models/shared/type.md - - docs/pkg/models/shared/weblink.md - - docs/pkg/models/shared/phonenumber.md - - docs/pkg/models/shared/phonenumbertype.md - - docs/pkg/models/shared/commercecompanyinfo.md - - docs/pkg/models/shared/accountbalance.md - - docs/pkg/models/shared/accountingcustomer.md - - docs/pkg/models/shared/customerstatus.md + - docs/pkg/models/shared/commercereportdimensionitems.md + - docs/pkg/models/shared/commercereporterror.md + - docs/pkg/models/shared/commercereportmeasure.md + - docs/pkg/models/shared/commercetransaction.md + - docs/pkg/models/shared/commercetransactions.md + - docs/pkg/models/shared/companies.md + - docs/pkg/models/shared/company.md + - docs/pkg/models/shared/companyrequestbody.md + - docs/pkg/models/shared/connection.md + - docs/pkg/models/shared/connections.md - docs/pkg/models/shared/contact.md - - docs/pkg/models/shared/accountingcustomers.md - - docs/pkg/models/shared/accountingdirectincome.md - - docs/pkg/models/shared/directincomelineitem.md - - docs/pkg/models/shared/accountingdirectincomes.md - - docs/pkg/models/shared/accountinginvoicedatatype.md - - docs/pkg/models/shared/salesorderreference.md - - docs/pkg/models/shared/accountinginvoice.md - - docs/pkg/models/shared/invoicestatus.md - - docs/pkg/models/shared/invoicelineitem.md - - docs/pkg/models/shared/recordreference.md - - docs/pkg/models/shared/accountsreceivabletracking.md - - docs/pkg/models/shared/billedtotype1.md - - docs/pkg/models/shared/accountinginvoices.md - - docs/pkg/models/shared/enhancedinvoicesreport.md - - docs/pkg/models/shared/enhancedinvoicereportitem.md - - docs/pkg/models/shared/payment.md - - docs/pkg/models/shared/bankingtransactionref.md - - docs/pkg/models/shared/lendingcustomerref.md - - docs/pkg/models/shared/accountingcreditnote.md - - docs/pkg/models/shared/creditnotestatus.md + - docs/pkg/models/shared/contactref.md + - docs/pkg/models/shared/contactrefdatatype.md + - docs/pkg/models/shared/contactreference.md + - docs/pkg/models/shared/createbankaccounttransaction.md - docs/pkg/models/shared/creditnotelineitem.md - - docs/pkg/models/shared/accountingcreditnotes.md - - docs/pkg/models/shared/accountingpayment.md - - docs/pkg/models/shared/paymentline.md - - docs/pkg/models/shared/paymentlinelink.md - - docs/pkg/models/shared/paymentlinktype.md - - docs/pkg/models/shared/accountingpayments.md - - docs/pkg/models/shared/accountingagedcreditorreport.md - - docs/pkg/models/shared/agedcreditor.md - - docs/pkg/models/shared/agedcurrencyoutstanding.md - - docs/pkg/models/shared/agedoutstandingamount.md - - docs/pkg/models/shared/agedoutstandingamountdetail.md - - docs/pkg/models/shared/accountingageddebtorreport.md - - docs/pkg/models/shared/ageddebtor.md - - docs/pkg/models/shared/file.md - - docs/pkg/models/shared/fileupload.md - - docs/pkg/models/shared/codatfile.md - - docs/pkg/models/shared/accountingcreatebankaccountresponseaccountingbankaccount.md - - docs/pkg/models/shared/accountingcreatebankaccountresponse.md - - docs/pkg/models/shared/validation.md - - docs/pkg/models/shared/validationitem.md - - docs/pkg/models/shared/pushoperationstatus.md + - docs/pkg/models/shared/creditnotestatus.md + - docs/pkg/models/shared/customerstatus.md + - docs/pkg/models/shared/dataconnectionerror.md + - docs/pkg/models/shared/dataconnectionstatus.md + - docs/pkg/models/shared/dataintegrityamounts.md + - docs/pkg/models/shared/dataintegritybyamount.md + - docs/pkg/models/shared/dataintegritybycount.md + - docs/pkg/models/shared/dataintegrityconnectionid.md + - docs/pkg/models/shared/dataintegritydatatype.md + - docs/pkg/models/shared/dataintegritydates.md + - docs/pkg/models/shared/dataintegritydetail.md + - docs/pkg/models/shared/dataintegritydetails.md + - docs/pkg/models/shared/dataintegritymatch.md + - docs/pkg/models/shared/dataintegritystatus.md + - docs/pkg/models/shared/dataintegritystatuses.md + - docs/pkg/models/shared/dataintegritystatusinfo.md + - docs/pkg/models/shared/dataintegritysummaries.md + - docs/pkg/models/shared/dataintegritysummary.md + - docs/pkg/models/shared/datasetstatus.md + - docs/pkg/models/shared/datasource.md + - docs/pkg/models/shared/datastatus.md - docs/pkg/models/shared/datatype.md - - docs/pkg/models/shared/pushoperationchange.md - - docs/pkg/models/shared/pushchangetype.md - - docs/pkg/models/shared/pushoperationref.md - - docs/pkg/models/shared/pushoption.md - - docs/pkg/models/shared/pushvalidationinfo.md - - docs/pkg/models/shared/pushfieldvalidation.md - - docs/pkg/models/shared/pushoptiontype.md - - docs/pkg/models/shared/pushoptionproperty.md - - docs/pkg/models/shared/pushoptionchoice.md - - docs/pkg/models/shared/accountingcreatebankaccounttransactions.md - - docs/pkg/models/shared/accountingcreatebanktransactionsresponse.md - - docs/pkg/models/shared/createbankaccounttransaction.md - - docs/pkg/models/shared/accountingcreatebanktransactions.md - - docs/pkg/models/shared/accountingcreateaccountresponsevaliddatatypelinks.md - - docs/pkg/models/shared/accountingcreateaccountresponseaccountingaccount.md - - docs/pkg/models/shared/accountingcreateaccountresponse.md - - docs/pkg/models/shared/accounttype.md - - docs/pkg/models/shared/accountstatus.md - - docs/pkg/models/shared/validdatatypelinks.md - - docs/pkg/models/shared/accountprototype.md - - docs/pkg/models/shared/accountingcreatedirectcostresponsedatatype.md - - docs/pkg/models/shared/accountingcreatedirectcostresponsecontactreference.md - - docs/pkg/models/shared/accountingcreatedirectcostresponseaccountingdirectcost.md - - docs/pkg/models/shared/accountingcreatedirectcostresponse.md - - docs/pkg/models/shared/directcostprototypedatatype.md - - docs/pkg/models/shared/contactreference.md + - docs/pkg/models/shared/datatypes.md + - docs/pkg/models/shared/directcostlineitem.md - docs/pkg/models/shared/directcostprototype.md - - docs/pkg/models/shared/accountingcreatepaymentresponseaccountingpayment.md - - docs/pkg/models/shared/accountingcreatepaymentresponse.md - - docs/pkg/models/shared/accountingcreatesupplierresponseaccountingsupplier.md - - docs/pkg/models/shared/accountingcreatesupplierresponse.md - - docs/pkg/models/shared/accountingcreatetransferresponseaccountingtransfer.md - - docs/pkg/models/shared/accountingcreatetransferresponse.md - - docs/pkg/models/shared/pushoperation.md - - docs/pkg/models/shared/pushoperations.md - - docs/pkg/models/shared/accountingaccountvaliddatatypelinks.md - - docs/pkg/models/shared/accountingaccount.md - - docs/pkg/models/shared/accountingaccounts.md - - docs/pkg/models/shared/accountingbalancesheet.md - - docs/pkg/models/shared/balancesheet.md - - docs/pkg/models/shared/reportlineinput.md - - docs/pkg/models/shared/reportline.md - - docs/pkg/models/shared/reportitem.md + - docs/pkg/models/shared/directincomelineitem.md + - docs/pkg/models/shared/disputestatus.md + - docs/pkg/models/shared/enduploadsessionrequest.md + - docs/pkg/models/shared/enduploadsessionrequeststatus.md + - docs/pkg/models/shared/enhancedcashflowitem.md + - docs/pkg/models/shared/enhancedcashflowtransaction.md + - docs/pkg/models/shared/enhancedcashflowtransactions.md - docs/pkg/models/shared/enhancedfinancialreport.md + - docs/pkg/models/shared/enhancedinvoicereportitem.md + - docs/pkg/models/shared/enhancedinvoicesreport.md - docs/pkg/models/shared/enhancedreportaccountcategory.md - - docs/pkg/models/shared/accountcategorylevel.md - docs/pkg/models/shared/enhancedreportinfo.md - - docs/pkg/models/shared/accountingcashflowstatement.md - - docs/pkg/models/shared/cashflowstatement.md - - docs/pkg/models/shared/reportinput.md - - docs/pkg/models/shared/reportbasis.md - - docs/pkg/models/shared/accountingprofitandlossreport.md - - docs/pkg/models/shared/profitandlossreport.md - - docs/pkg/models/shared/datatypes.md - - docs/pkg/models/shared/datastatus.md - - docs/pkg/models/shared/pulloperationstatus.md - - docs/pkg/models/shared/pulloperation.md - - docs/pkg/models/shared/schemadatatype.md - - docs/pkg/models/shared/pulloperations.md + - docs/pkg/models/shared/errorstatus.md + - docs/pkg/models/shared/errorvalidation.md + - docs/pkg/models/shared/errorvalidationitem.md + - docs/pkg/models/shared/excelreporttypes.md + - docs/pkg/models/shared/excelstatus.md + - docs/pkg/models/shared/file.md + - docs/pkg/models/shared/fileupload.md + - docs/pkg/models/shared/groupreference.md + - docs/pkg/models/shared/halref.md + - docs/pkg/models/shared/integritystatus.md + - docs/pkg/models/shared/invoicelineitem.md + - docs/pkg/models/shared/invoicestatus.md + - docs/pkg/models/shared/itemref.md + - docs/pkg/models/shared/itemreference.md + - docs/pkg/models/shared/items.md + - docs/pkg/models/shared/journalentryrecordref.md + - docs/pkg/models/shared/journalentryrecordrefdatatype.md + - docs/pkg/models/shared/journalline.md + - docs/pkg/models/shared/journallinedatatype.md + - docs/pkg/models/shared/journallinetracking.md + - docs/pkg/models/shared/journalref.md + - docs/pkg/models/shared/journalstatus.md + - docs/pkg/models/shared/lendingcustomerref.md + - docs/pkg/models/shared/links.md + - docs/pkg/models/shared/loanref.md - docs/pkg/models/shared/loansummary.md - - docs/pkg/models/shared/loansummaryreportitem.md + - docs/pkg/models/shared/loansummaryintegrationtype.md - docs/pkg/models/shared/loansummaryrecordref.md - docs/pkg/models/shared/loansummaryrecordreftype.md - - docs/pkg/models/shared/loansummaryintegrationtype.md - docs/pkg/models/shared/loansummaryreportinfo.md + - docs/pkg/models/shared/loansummaryreportitem.md - docs/pkg/models/shared/loantransactions.md + - docs/pkg/models/shared/loantransactionsreportinfo.md - docs/pkg/models/shared/loantransactiontype.md + - docs/pkg/models/shared/locationref.md + - docs/pkg/models/shared/metadata.md + - docs/pkg/models/shared/orderdiscountallocation.md + - docs/pkg/models/shared/orderlineitem.md + - docs/pkg/models/shared/path.md + - docs/pkg/models/shared/payment.md + - docs/pkg/models/shared/paymentallocationpayment.md + - docs/pkg/models/shared/paymentline.md + - docs/pkg/models/shared/paymentlinelink.md + - docs/pkg/models/shared/paymentlinktype.md + - docs/pkg/models/shared/paymentmethodref.md + - docs/pkg/models/shared/paymentref.md + - docs/pkg/models/shared/paymentstatus.md + - docs/pkg/models/shared/paymenttype.md + - docs/pkg/models/shared/periodunit.md + - docs/pkg/models/shared/phonenumber.md + - docs/pkg/models/shared/phonenumbertype.md + - docs/pkg/models/shared/productinventory.md + - docs/pkg/models/shared/productinventorylocation.md + - docs/pkg/models/shared/productprice.md + - docs/pkg/models/shared/productref.md + - docs/pkg/models/shared/productvariant.md + - docs/pkg/models/shared/productvariantref.md + - docs/pkg/models/shared/productvariantstatus.md + - docs/pkg/models/shared/profitandlossreport.md + - docs/pkg/models/shared/projectref.md + - docs/pkg/models/shared/propertieitemref.md + - docs/pkg/models/shared/pulloperation.md + - docs/pkg/models/shared/pulloperations.md + - docs/pkg/models/shared/purchaseorderreference.md + - docs/pkg/models/shared/pushchangetype.md + - docs/pkg/models/shared/pushfieldvalidation.md + - docs/pkg/models/shared/pushoperation.md + - docs/pkg/models/shared/pushoperationchange.md + - docs/pkg/models/shared/pushoperationref.md + - docs/pkg/models/shared/pushoperations.md + - docs/pkg/models/shared/pushoperationstatus.md + - docs/pkg/models/shared/pushoption.md + - docs/pkg/models/shared/pushoptionchoice.md + - docs/pkg/models/shared/pushoptionproperty.md + - docs/pkg/models/shared/pushoptiontype.md + - docs/pkg/models/shared/pushvalidationinfo.md + - docs/pkg/models/shared/recordlinereference.md + - docs/pkg/models/shared/recordref.md + - docs/pkg/models/shared/recordreference.md + - docs/pkg/models/shared/reportbasis.md + - docs/pkg/models/shared/reportcomponentmeasure.md + - docs/pkg/models/shared/reportinfo.md + - docs/pkg/models/shared/reportinput.md + - docs/pkg/models/shared/reportitem.md - docs/pkg/models/shared/reportitems.md - - docs/pkg/models/shared/loanref.md - - docs/pkg/models/shared/itemref.md - - docs/pkg/models/shared/loantransactionsreportinfo.md - - docs/pkg/models/shared/dataintegritydetails.md - - docs/pkg/models/shared/dataintegritydetail.md - - docs/pkg/models/shared/dataintegritymatch.md - - docs/pkg/models/shared/dataintegritydatatype.md - - docs/pkg/models/shared/dataintegritystatuses.md - - docs/pkg/models/shared/dataintegritystatus.md - - docs/pkg/models/shared/dataintegritystatusinfo.md - - docs/pkg/models/shared/integritystatus.md - - docs/pkg/models/shared/dataintegritydates.md - - docs/pkg/models/shared/dataintegrityconnectionid.md - - docs/pkg/models/shared/dataintegrityamounts.md - - docs/pkg/models/shared/dataintegritysummaries.md - - docs/pkg/models/shared/dataintegritysummary.md - - docs/pkg/models/shared/dataintegritybycount.md - - docs/pkg/models/shared/dataintegritybyamount.md - - docs/pkg/models/shared/excelreporttypes.md - - docs/pkg/models/shared/excelstatus.md + - docs/pkg/models/shared/reportline.md + - docs/pkg/models/shared/salesorderreference.md + - docs/pkg/models/shared/schemadatatype.md - docs/pkg/models/shared/security.md - - docs/pkg/models/shared/accountcategoriesupdatedwebhook.md - - docs/pkg/models/shared/accountcategoriesupdatedwebhookdata.md - - docs/pkg/models/shared/clientratelimitreachedwebhook.md - - docs/pkg/models/shared/clientratelimitreachedwebhookdata.md - - docs/pkg/models/shared/clientratelimitresetwebhook.md - - docs/pkg/models/shared/clientratelimitresetwebhookdata.md - - docs/pkg/models/sdkerrors/errormessage.md + - docs/pkg/models/shared/servicecharge.md + - docs/pkg/models/shared/servicechargetype.md + - docs/pkg/models/shared/source.md + - docs/pkg/models/shared/sourceref.md + - docs/pkg/models/shared/sourcetype.md + - docs/pkg/models/shared/startuploadsessionrequest.md + - docs/pkg/models/shared/startuploadsessionrequestdatatype.md + - docs/pkg/models/shared/status.md + - docs/pkg/models/shared/supplementaldata.md + - docs/pkg/models/shared/supplierref.md + - docs/pkg/models/shared/supplierstatus.md + - docs/pkg/models/shared/tags.md + - docs/pkg/models/shared/taxcomponentallocation.md + - docs/pkg/models/shared/taxcomponentref.md + - docs/pkg/models/shared/taxrateref.md + - docs/pkg/models/shared/taxratereference.md + - docs/pkg/models/shared/tracking.md + - docs/pkg/models/shared/trackingcategoryref.md + - docs/pkg/models/shared/trackingrecordref.md + - docs/pkg/models/shared/trackingrecordrefdatatype.md + - docs/pkg/models/shared/transactioncategory.md + - docs/pkg/models/shared/transactioncategoryref.md + - docs/pkg/models/shared/transactioncategorystatus.md + - docs/pkg/models/shared/transactioncode.md + - docs/pkg/models/shared/transactionsourceref.md + - docs/pkg/models/shared/transactionsourcetype.md + - docs/pkg/models/shared/transactiontype.md + - docs/pkg/models/shared/transferaccount.md + - docs/pkg/models/shared/type.md + - docs/pkg/models/shared/validation.md + - docs/pkg/models/shared/validationitem.md + - docs/pkg/models/shared/validdatatypelinks.md + - docs/pkg/models/shared/weblink.md + - docs/pkg/models/shared/withholdingtax.md + - docs/pkg/models/shared/zero.md + - docs/pkg/models/shared/zerodatatype.md - docs/pkg/models/webhooks/accountcategoriesupdatedresponse.md - docs/pkg/models/webhooks/clientratelimitreachedresponse.md + - docs/pkg/models/webhooks/clientratelimitreachedresponse1.md - docs/pkg/models/webhooks/clientratelimitresetresponse.md - - docs/sdks/codatlending/README.md - - docs/pkg/models/operations/option.md - - docs/sdks/companies/README.md - - docs/sdks/connections/README.md - - docs/sdks/transactions/README.md - - docs/sdks/accounttransactions/README.md - - docs/sdks/codatlendingdirectcosts/README.md - - docs/sdks/codatlendingtransfers/README.md - - docs/sdks/journalentries/README.md - - docs/sdks/journals/README.md - - docs/sdks/codatlendingaccountingbankdata/README.md - - docs/sdks/accounts/README.md - - docs/sdks/banking/README.md + - docs/pkg/models/webhooks/clientratelimitresetresponse1.md - docs/sdks/accountbalances/README.md - - docs/sdks/codatlendingaccounts/README.md - - docs/sdks/transactioncategories/README.md - - docs/sdks/codatlendingbankingtransactions/README.md - - docs/sdks/categorizedstatement/README.md + - docs/sdks/accounts/README.md - docs/sdks/accountspayable/README.md - - docs/sdks/bills/README.md - - docs/sdks/suppliers/README.md + - docs/sdks/accountsreceivable/README.md + - docs/sdks/accounttransactions/README.md + - docs/sdks/balancesheet/README.md + - docs/sdks/bankaccounts/README.md + - docs/sdks/banking/README.md + - docs/sdks/bankstatements/README.md + - docs/sdks/banktransactions/README.md - docs/sdks/billcreditnotes/README.md - docs/sdks/billpayments/README.md - - docs/sdks/sales/README.md + - docs/sdks/bills/README.md + - docs/sdks/cashflow/README.md + - docs/sdks/categorizedstatement/README.md + - docs/sdks/codatlending/README.md + - docs/sdks/codatlendingaccountingbankdata/README.md + - docs/sdks/codatlendingaccounts/README.md + - docs/sdks/codatlendingbankingtransactions/README.md - docs/sdks/codatlendingcustomers/README.md - - docs/sdks/disputes/README.md - - docs/sdks/locations/README.md - - docs/sdks/orders/README.md - - docs/sdks/paymentmethods/README.md + - docs/sdks/codatlendingdirectcosts/README.md + - docs/sdks/codatlendingfinancialstatementsaccounts/README.md + - docs/sdks/codatlendingloanwritebackaccounts/README.md + - docs/sdks/codatlendingpayments/README.md + - docs/sdks/codatlendingreports/README.md - docs/sdks/codatlendingsalespayments/README.md - - docs/sdks/productcategories/README.md - - docs/sdks/products/README.md + - docs/sdks/codatlendingsuppliers/README.md - docs/sdks/codatlendingtransactions/README.md - - docs/sdks/metrics/README.md - - docs/sdks/codatlendingreports/README.md + - docs/sdks/codatlendingtransfers/README.md + - docs/sdks/companies/README.md - docs/sdks/companyinfo/README.md - - docs/sdks/accountsreceivable/README.md + - docs/sdks/connections/README.md + - docs/sdks/createoperations/README.md + - docs/sdks/creditnotes/README.md - docs/sdks/customers/README.md + - docs/sdks/dataintegrity/README.md + - docs/sdks/directcosts/README.md - docs/sdks/directincomes/README.md - - docs/sdks/invoices/README.md - - docs/sdks/creditnotes/README.md - - docs/sdks/payments/README.md - - docs/sdks/reports/README.md + - docs/sdks/disputes/README.md + - docs/sdks/excelreports/README.md - docs/sdks/fileupload/README.md - - docs/sdks/loanwriteback/README.md - - docs/sdks/bankaccounts/README.md - - docs/sdks/banktransactions/README.md - - docs/sdks/codatlendingloanwritebackaccounts/README.md - - docs/sdks/directcosts/README.md - - docs/sdks/codatlendingpayments/README.md - - docs/sdks/codatlendingsuppliers/README.md - - docs/sdks/transfers/README.md - - docs/sdks/createoperations/README.md - docs/sdks/financialstatements/README.md - - docs/sdks/codatlendingfinancialstatementsaccounts/README.md - - docs/sdks/balancesheet/README.md - - docs/sdks/cashflow/README.md - - docs/sdks/profitandloss/README.md + - docs/sdks/invoices/README.md + - docs/sdks/journalentries/README.md + - docs/sdks/journals/README.md + - docs/sdks/liabilities/README.md + - docs/sdks/loanwriteback/README.md + - docs/sdks/locations/README.md - docs/sdks/managedata/README.md - - docs/sdks/refresh/README.md + - docs/sdks/metrics/README.md + - docs/sdks/orders/README.md + - docs/sdks/paymentmethods/README.md + - docs/sdks/payments/README.md + - docs/sdks/productcategories/README.md + - docs/sdks/products/README.md + - docs/sdks/profitandloss/README.md - docs/sdks/pulloperations/README.md - - docs/sdks/liabilities/README.md - - docs/sdks/dataintegrity/README.md - - docs/sdks/excelreports/README.md - - USAGE.md + - docs/sdks/refresh/README.md + - docs/sdks/reports/README.md + - docs/sdks/sales/README.md + - docs/sdks/suppliers/README.md + - docs/sdks/transactioncategories/README.md + - docs/sdks/transactions/README.md + - docs/sdks/transfers/README.md + - docs/types/date.md + - excelreports.go + - fileupload.go + - financialstatements.go + - go.mod + - internal/hooks/hooks.go + - invoices.go + - journalentries.go + - journals.go + - liabilities.go + - loanwriteback.go + - locations.go + - managedata.go + - metrics.go + - orders.go + - paymentmethods.go + - payments.go - pkg/models/operations/options.go - - .gitattributes + - pkg/models/sdkerrors/sdkerror.go + - pkg/retry/config.go + - pkg/types/bigint.go + - pkg/types/date.go + - pkg/types/datetime.go + - pkg/types/decimal.go + - pkg/types/pointers.go + - pkg/utils/contenttype.go + - pkg/utils/form.go + - pkg/utils/headers.go + - pkg/utils/json.go + - pkg/utils/pathparams.go + - pkg/utils/queryparams.go + - pkg/utils/requestbody.go + - pkg/utils/retries.go + - pkg/utils/security.go + - pkg/utils/utils.go + - productcategories.go + - products.go + - profitandloss.go + - pulloperations.go + - refresh.go + - reports.go + - sales.go + - suppliers.go + - transactioncategories.go + - transactions.go + - transfers.go +examples: + create-company: + With no description: + requestBody: + application/json: {"description": "Requested early access to the new financing scheme.", "groups": [], "name": "Technicalium"} + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0"} + "400": {} + With a description: + requestBody: + application/json: {"description": "Technology services, including web and app design and development", "groups": [], "name": "Technicalium"} + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "Technology services, including web and app design and development", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0"} + "400": {} + With a group: + requestBody: + application/json: {"description": "Requested early access to the new financing scheme.", "groups": [{"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"}], "name": "Technicalium"} + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0"} + "400": {} + Malformed query: + requestBody: + application/json: {"description": "Requested early access to the new financing scheme.", "groups": [], "name": "Bank of Dave"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + delete-company: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-company: + Simple company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "My First Company", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0"} + With groups: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "My First Company", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-companies: + "": + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739"}], "totalResults": 1} + "400": {} + One company: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies?page=1&pageSize=100"}, "self": {"href": "/companies"}}, "pageNumber": 1, "pageSize": 100, "results": [{"created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "dataConnectionErrors": [], "id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "My Test Company make testing software", "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "name": "My Test Company", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6"}], "totalResults": 1} + List of Companies: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies?page=1&pageSize=100"}, "self": {"href": "/companies"}}, "pageNumber": 1, "pageSize": 100, "results": [{"created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "dataConnectionErrors": [], "id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "Technology services, including web and app design and development", "id": "d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002"}, {"created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "dataConnectionErrors": [], "id": "a70bc148-dc21-46b2-a257-d9c58ac15cbb", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/096db70b-78de-4ff0-aa98-299cb5fe17a0/connections/a70bc148-dc21-46b2-a257-d9c58ac15cbb/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "A new digital agency with a passion for creating amazing digital experiences", "id": "096db70b-78de-4ff0-aa98-299cb5fe17a0", "lastSync": "2022-01-01T12:30:00.000Z", "name": "Godata", "redirect": "https://link.codat.io/company/096db70b-78de-4ff0-aa98-299cb5fe17a0"}], "totalResults": 2} + Malformed query: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + update-company: + Update name: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"description": "Requested early access to the new financing scheme.", "groups": [], "name": "New Name"} + responses: + "200": + application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739"} + "401": {} + Update description: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"description": "Additional documents required", "groups": [], "name": "Same name"} + responses: + "200": + application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739"} + "401": {} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"description": "Requested early access to the new financing scheme.", "groups": [], "name": "Bank of Dave"} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-connection: + Connection: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"platformKey": "gbol"} + responses: + "200": + application/json: {"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"platformKey": "gbol"} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + delete-connection: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-connection: + Connection: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-connections: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "totalResults": 1} + "400": {} + Connections: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "string"}, "next": {"href": "string"}, "previous": {"href": "string"}, "self": {"href": "string"}}, "pageNumber": 0, "pageSize": 0, "results": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "totalResults": 0} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + unlink-connection: + Example: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + requestBody: + application/json: {"status": "Unlinked"} + responses: + "200": + application/json: {"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"} + "401": {} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + end-bank-statement-upload-session: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + datasetId: "d58db2ab-edef-4881-8b6b-a7e79d33244c" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-bank-statement-upload-configuration: + Codat: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"accountId": "abc123-ABC", "source": "codat"} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + set-bank-statement-upload-configuration: + Codat: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + requestBody: + application/json: {"accountId": "abc123-ABC", "source": "codat"} + responses: + "200": + application/json: {"accountId": "abc123-ABC", "source": "codat"} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + start-bank-statement-upload-session: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + upload-bank-statement-data: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + datasetId: "15fc5ae4-359b-4dee-ba7c-3a22596ededc" + query: {} + requestBody: + application/json: {"currency": "Lek", "id": "", "identifiers": {"type": "Investment"}, "modifiedDate": "2022-10-23T00:00:00Z", "name": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "type": "Credit"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-accounting-account-transaction: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountTransactionId: "" + responses: + "200": + application/json: {"bankAccountRef": {"id": "ff8fdc4c-2aad-4ec1-9430-6bd201832eb3", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "date": "2022-04-19T00:00:00", "id": "062b3a9b-b04f-4d9c-9ebc-81dcb5bbf285", "lines": [{"amount": 188.33, "description": "Payment for direct income $38e8c917-0afc-4583-8ffe-1b53ad601197", "recordRef": {"dataType": "directIncomes", "id": "38e8c917-0afc-4583-8ffe-1b53ad601197"}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18", "note": "Direct income 38e8c917-0afc-4583-8ffe-1b53ad601197", "sourceModifiedDate": "2022-05-13T01:06:00", "status": "Unreconciled", "totalAmount": 188.33, "transactionId": "356deb9f-98e6-4d6f-8db3-b378241895a1"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountTransactionId: "" + responses: + "200": + application/json: {"bankAccountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "date": "2022-12-01T00:00:00", "id": "D7B-933784104", "lines": [{"amount": -1200, "recordRef": {"dataType": "directCosts", "id": "D7B-933784104"}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:13:23", "sourceModifiedDate": "2023-12-16T05:04:10", "status": "Unknown", "totalAmount": -1200, "transactionId": "D7B-933784104"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountTransactionId: "" + responses: + "200": + application/json: {"bankAccountRef": {"id": "57", "name": "Visa Credit Card"}, "currency": "GBP", "currencyRate": 1, "date": "2015-08-12T00:00:00", "id": "85", "lines": [{"amount": -3831.8, "description": "Opening Balance from Bank", "recordRef": {"dataType": "directCosts", "id": "PUR-85"}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:37:16", "note": "Opening Balance from Bank", "sourceModifiedDate": "2016-09-12T18:13:07Z", "status": "Unknown", "totalAmount": -3831.8, "transactionId": "85"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountTransactionId: "" + responses: + "200": + application/json: {"bankAccountRef": {"id": "61", "name": "Dave PP Current"}, "currency": "GBP", "currencyRate": 1, "date": "2018-09-21T00:00:00", "id": "1", "lines": [{"amount": 170.23, "recordRef": {"dataType": "directIncomes", "id": "1"}}], "modifiedDate": "2023-01-18T11:03:12", "note": "Opening Balance from Bank", "sourceModifiedDate": "2018-12-17T14:56:20Z", "status": "Unknown", "totalAmount": 170.23, "transactionId": "1"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountTransactionId: "" + responses: + "200": + application/json: {"bankAccountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "date": "2021-12-20T00:00:00", "id": "74004690-82a1-4810-aaca-6ce575af94b4", "lines": [{"amount": -7267.2, "recordRef": {"dataType": "billPayments", "id": "74004690-82a1-4810-aaca-6ce575af94b4"}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:37:10", "sourceModifiedDate": "2021-01-02T22:51:40", "status": "Reconciled", "totalAmount": -7267.2, "transactionId": "74004690-82a1-4810-aaca-6ce575af94b4"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountTransactionId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounting-account-transactions: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/connections/57b731ba-1d45-4386-ba58-2a1ca0234624/data/accountTransactions?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/connections/57b731ba-1d45-4386-ba58-2a1ca0234624/data/accountTransactions?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/connections/57b731ba-1d45-4386-ba58-2a1ca0234624/data/accountTransactions"}}, "pageNumber": 1, "pageSize": 2, "results": [{"bankAccountRef": {"id": "ff8fdc4c-2aad-4ec1-9430-6bd201832eb3", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "date": "2022-04-19T00:00:00", "id": "062b3a9b-b04f-4d9c-9ebc-81dcb5bbf285", "lines": [{"amount": 188.33, "description": "Payment for direct income $38e8c917-0afc-4583-8ffe-1b53ad601197", "recordRef": {"dataType": "directIncomes", "id": "38e8c917-0afc-4583-8ffe-1b53ad601197"}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18", "note": "Direct income 38e8c917-0afc-4583-8ffe-1b53ad601197", "sourceModifiedDate": "2022-05-13T01:06:00", "status": "Unreconciled", "totalAmount": 188.33, "transactionId": "356deb9f-98e6-4d6f-8db3-b378241895a1"}, {"bankAccountRef": {"id": "ff8fdc4c-2aad-4ec1-9430-6bd201832eb3", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "date": "2022-04-19T00:00:00", "id": "f2656119-9521-4d51-a24d-003b44c1410b", "lines": [{"amount": 32095.91, "description": "Payment for direct income $c31a3778-e3ea-4d01-9281-dd2f291c8cb8", "recordRef": {"dataType": "directIncomes", "id": "c31a3778-e3ea-4d01-9281-dd2f291c8cb8"}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18", "note": "Direct income c31a3778-e3ea-4d01-9281-dd2f291c8cb8", "sourceModifiedDate": "2023-02-13T00:34:00", "status": "Void", "totalAmount": 32095.91, "transactionId": "1fde4f8f-68ca-48fc-8fe7-79ac467d2946"}], "totalResults": 1745} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/accountTransactions?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/accountTransactions?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/accountTransactions"}}, "pageNumber": 1, "pageSize": 2, "results": [{"bankAccountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "date": "2022-12-01T00:00:00", "id": "D7B-933784104", "lines": [{"amount": -1200, "recordRef": {"dataType": "directCosts", "id": "D7B-933784104"}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:13:23", "sourceModifiedDate": "2023-12-16T05:04:10", "status": "Unknown", "totalAmount": -1200, "transactionId": "D7B-933784104"}, {"bankAccountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "date": "2022-12-05T00:00:00", "id": "DFA-933785132", "lines": [{"amount": -35, "recordRef": {"dataType": "directCosts", "id": "DFA-933785132"}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:13:23", "sourceModifiedDate": "2023-12-16T05:04:11", "status": "Unknown", "totalAmount": -35, "transactionId": "DFA-933785132"}], "totalResults": 652} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/accountTransactions?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/accountTransactions?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/accountTransactions"}}, "pageNumber": 1, "pageSize": 2, "results": [{"bankAccountRef": {"id": "57", "name": "Visa Credit Card"}, "currency": "GBP", "currencyRate": 1, "date": "2015-08-12T00:00:00", "id": "85", "lines": [{"amount": -3831.8, "description": "Opening Balance from Bank", "recordRef": {"dataType": "directCosts", "id": "PUR-85"}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:37:16", "note": "Opening Balance from Bank", "sourceModifiedDate": "2016-09-12T18:13:07Z", "status": "Unknown", "totalAmount": -3831.8, "transactionId": "85"}, {"bankAccountRef": {"id": "81", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "date": "2015-11-24T00:00:00", "id": "5", "lines": [{"amount": 10000, "description": "contribution to start business", "recordRef": {"dataType": "directIncomes", "id": "5-1"}}, {"amount": 25000, "description": "funds borrowed to start business", "recordRef": {"dataType": "directIncomes", "id": "5-2"}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:37:17", "sourceModifiedDate": "2016-09-12T15:26:26Z", "status": "Unknown", "totalAmount": 35000, "transactionId": "5"}], "totalResults": 9141} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/accountTransactions?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/accountTransactions?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/accountTransactions"}}, "pageNumber": 1, "pageSize": 2, "results": [{"bankAccountRef": {"id": "61", "name": "Dave PP Current"}, "currency": "GBP", "currencyRate": 1, "date": "2018-09-21T00:00:00", "id": "1", "lines": [{"amount": 170.23, "recordRef": {"dataType": "directIncomes", "id": "1"}}], "modifiedDate": "2023-01-18T11:03:12", "note": "Opening Balance from Bank", "sourceModifiedDate": "2018-12-17T14:56:20Z", "status": "Unknown", "totalAmount": 170.23, "transactionId": "1"}, {"bankAccountRef": {"id": "61", "name": "Dave PP Current"}, "currency": "GBP", "currencyRate": 1, "date": "2018-09-21T00:00:00", "id": "15", "lines": [{"amount": -1.59, "description": "Payment to Google", "recordRef": {"dataType": "directCosts", "id": "PUR-15"}}], "modifiedDate": "2023-01-18T11:03:11", "note": "Payment to Google", "sourceModifiedDate": "2018-12-17T14:56:44Z", "status": "Unknown", "totalAmount": -1.59, "transactionId": "15"}], "totalResults": 5984} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/accountTransactions?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/accountTransactions?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/accountTransactions"}}, "pageNumber": 1, "pageSize": 2, "results": [{"bankAccountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "date": "2021-12-20T00:00:00", "id": "74004690-82a1-4810-aaca-6ce575af94b4", "lines": [{"amount": -7267.2, "recordRef": {"dataType": "billPayments", "id": "74004690-82a1-4810-aaca-6ce575af94b4"}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:37:10", "sourceModifiedDate": "2021-01-02T22:51:40", "status": "Reconciled", "totalAmount": -7267.2, "transactionId": "74004690-82a1-4810-aaca-6ce575af94b4"}, {"bankAccountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "date": "2022-02-17T00:00:00", "id": "65b746c8-9a5d-4a95-8096-d2316fcff592", "lines": [{"amount": 4200, "recordRef": {"dataType": "payments", "id": "65b746c8-9a5d-4a95-8096-d2316fcff592"}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:37:10", "sourceModifiedDate": "2021-01-02T22:50:58", "status": "Reconciled", "totalAmount": 4200, "transactionId": "65b746c8-9a5d-4a95-8096-d2316fcff592"}], "totalResults": 70} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + download-accounting-direct-cost-attachment: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directCostId: "" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-direct-cost: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directCostId: "" + responses: + "200": + application/json: {"contactRef": {"dataType": "suppliers", "id": "D4Q4iYwHou"}, "currency": "GBP", "currencyRate": 1, "id": "994ad234-ca05-466e-8e6a-117783b38cf6", "issueDate": "2022-04-27T00:00:00", "lineItems": [{"accountRef": {"id": "7403e960-5b72-42ff-abf4-c870ad8910bd", "name": "Purchases"}, "description": "Underground - Drain Saddle Branches 160mm x 110mm x 87 �", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "2", "name": "Solvent Weld Branch 160mm x 110mm x 87 �"}, "quantity": 1, "subTotal": 220.18, "taxAmount": 22.02, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 242.2, "tracking": {"invoiceTo": {"dataType": "accountTransaction"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 220.18}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18Z", "note": "Direct Cost with 1 line items, totaling 242.20", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-04-27T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -242.2}, "payment": {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "994ad234-ca05-466e-8e6a-117783b38cf6", "note": "Payment for direct cost 994ad234-ca05-466e-8e6a-117783b38cf6", "paidOnDate": "2022-04-27T00:00:00", "reference": "Direct Cost 994ad234-ca05-466e-8e6a-117783b38cf6", "totalAmount": 242.2}}], "reference": "005b7b62-dc9f-42d2-85a2-4a2cefc6bab2", "sourceModifiedDate": "2022-09-18T20:59:02", "subTotal": 220.18, "taxAmount": 22.02, "totalAmount": 242.2} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directCostId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "id": "6ab3e391-97d7-ec11-8e7e-000d3a0cfe40", "issueDate": "2022-05-21T00:00:00", "lineItems": [{"accountRef": {"id": "30"}, "description": "test expenses 2", "quantity": -1, "subTotal": -17.89, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "cc81fea8-2917-ed11-90eb-002248009df3", "name": ""}, "totalAmount": -17.89, "tracking": {"invoiceTo": {"dataType": "journalEntry"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 17.89}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "3931", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-05-21T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -17.89}, "payment": {"accountRef": {"id": "TEST"}, "currency": "GBP", "currencyRate": 1, "id": "6ab3e391-97d7-ec11-8e7e-000d3a0cfe40", "paidOnDate": "2022-05-21T00:00:00", "totalAmount": -17.89}}], "reference": "INS000090", "sourceModifiedDate": "2022-05-19T17:17:33Z", "subTotal": -17.89, "taxAmount": 0, "totalAmount": -17.89} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directCostId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "id": "190325254", "issueDate": "2017-11-23T00:00:00", "lineItems": [{"accountRef": {"id": "285", "name": "Accommodation and Meals"}, "description": "Atomic Software Limite Wellington,Nzl", "quantity": 1, "subTotal": 11.92, "taxAmount": 2.38, "totalAmount": 14.3, "tracking": {"invoiceTo": {"dataType": "accountTransaction"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 11.92}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:20:36Z", "note": "Atomic Software Limite Wellington,Nzl", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2017-11-23T00:00:00", "currency": "GBP", "totalAmount": 14.3}, "payment": {"accountRef": {"id": "750-1", "name": "Bank Account: Business Current Account"}, "currency": "GBP", "id": "190325254", "note": "Atomic Software Limite Wellington,Nzl", "paidOnDate": "2017-11-23T00:00:00", "totalAmount": 14.3}}], "sourceModifiedDate": "2019-11-22T14:31:14Z", "subTotal": 11.92, "taxAmount": 2.38, "totalAmount": 14.3} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directCostId: "" + responses: + "200": + application/json: {"contactRef": {"dataType": "suppliers", "id": "Sainsburys"}, "currency": "GBP", "currencyRate": 1, "id": "29870062", "issueDate": "2019-02-12T00:00:00", "lineItems": [{"accountRef": {"id": "3361426", "name": "Meals & Entertainment"}, "description": "Food to keep me working", "quantity": 1, "subTotal": 10, "taxAmount": 0, "totalAmount": 10, "tracking": {"invoiceTo": {"dataType": "transfer"}, "recordRefs": []}, "trackingCategoryRefs": [{"id": "4370503", "name": "Meals & Entertainment"}], "unitAmount": 10}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "note": "Food to keep me working", "paymentAllocations": [], "reference": "Food to keep me working", "sourceModifiedDate": "2021-10-28T15:21:46", "subTotal": 10, "taxAmount": 0, "totalAmount": 10} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directCostId: "" + responses: + "200": + application/json: {"contactRef": {"dataType": "suppliers", "id": "360000-933272659"}, "currency": "GBP", "currencyRate": 1, "id": "D7B-933784104", "issueDate": "2022-12-01T00:00:00", "lineItems": [{"accountRef": {"id": "3C0000-933270542", "name": "Rent"}, "quantity": 1, "subTotal": 1200, "totalAmount": 1200, "tracking": {"invoiceTo": {"dataType": "accountTransaction"}, "recordRefs": [{"dataType": "trackingCategories", "id": "80000007-1197713802"}, {"dataType": "customers", "id": "800000B0-1197755238"}]}, "trackingCategoryRefs": [{"id": "80000007-1197713802", "name": "Overhead"}], "unitAmount": 1200}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:13:57Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-12-01T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 1200}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "D7B-933784104", "paidOnDate": "2022-12-01T00:00:00", "totalAmount": 1200}}], "reference": "93", "sourceModifiedDate": "2023-12-16T05:04:10", "subTotal": 1200, "taxAmount": 0, "totalAmount": 1200} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directCostId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "id": "PUR-85", "issueDate": "2015-08-12T00:00:00", "lineItems": [{"accountRef": {"id": "55", "name": "Opening Balance Equity"}, "quantity": 1, "subTotal": 3831.8, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 3831.8, "tracking": {"invoiceTo": {"dataType": "transfer"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 3831.8}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:40Z", "note": "Opening Balance from Bank", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2015-08-12T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -3831.8}, "payment": {"accountRef": {"id": "57", "name": "Visa Credit Card"}, "currency": "GBP", "currencyRate": 1, "id": "85", "paidOnDate": "2015-08-12T00:00:00", "reference": "Opening Balance from Bank", "totalAmount": 3831.8}}], "sourceModifiedDate": "2016-09-12T18:13:07Z", "subTotal": 3831.8, "taxAmount": 0, "totalAmount": 3831.8} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directCostId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "id": "PUR-15", "issueDate": "2018-09-21T00:00:00", "lineItems": [{"accountRef": {"id": "37", "name": "Computer equipment accumulated depreciation brought forward"}, "description": "Payment to Google", "quantity": 1, "subTotal": 1.59, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 1.59, "tracking": {"invoiceTo": {"dataType": "accountTransaction"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 1.59}], "modifiedDate": "2023-01-18T11:02:59Z", "note": "Payment to Google", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2018-09-21T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -1.59}, "payment": {"accountRef": {"id": "61", "name": "Dave PP Current"}, "currency": "GBP", "currencyRate": 1, "id": "15", "paidOnDate": "2018-09-21T00:00:00", "reference": "Payment to Google", "totalAmount": 1.59}}], "sourceModifiedDate": "2018-12-17T14:56:44Z", "subTotal": 1.59, "taxAmount": 0, "totalAmount": 1.59} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directCostId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "id": "73", "issueDate": "2021-01-29T00:00:00", "lineItems": [{"accountRef": {"id": "7200", "name": "Electricity"}, "description": "Electrcity Direct Debit", "quantity": 1, "subTotal": 150, "taxAmount": 12, "taxRateRef": {"id": "3"}, "totalAmount": 162, "tracking": {"invoiceTo": {"dataType": "journalEntry"}, "recordRefs": []}, "trackingCategoryRefs": [{"id": "department_0", "name": "Default"}], "unitAmount": 150}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:35Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2021-01-29T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 162}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "73", "paidOnDate": "2021-01-29T00:00:00", "reference": "DD/STO", "totalAmount": 162}}], "reference": "DD/STO", "sourceModifiedDate": "2022-11-25T09:43:54", "subTotal": 150, "taxAmount": 12, "totalAmount": 162} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directCostId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "id": "CCTRANSACTION:4355", "issueDate": "2020-01-20T00:00:00", "lineItems": [{"accountRef": {"id": "195", "name": "Insurance"}, "quantity": 1, "subTotal": 9.99, "taxAmount": 2, "taxRateRef": {"id": "62018"}, "totalAmount": 11.99, "tracking": {"invoiceTo": {"dataType": "transfer"}, "recordRefs": []}, "trackingCategoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}], "unitAmount": 9.99}], "modifiedDate": "2022-10-28T11:10:28Z", "note": "Test 1", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2020-01-20T00:00:00", "currency": "GBP", "totalAmount": 11.99}, "payment": {"accountRef": {"id": "348", "name": "CMRR Renewal"}, "currency": "GBP", "id": "4355", "note": "", "paidOnDate": "2020-01-20T00:00:00", "reference": "", "totalAmount": 11.99}}], "reference": "", "sourceModifiedDate": "2022-08-22T09:26:42", "subTotal": 9.99, "taxAmount": 2, "totalAmount": 11.99} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directCostId: "" + responses: + "200": + application/json: {"contactRef": {"dataType": "suppliers", "id": "737982b0-2811-44c9-bdb3-3b26a3a6ef8c"}, "currency": "GBP", "currencyRate": 1, "id": "dc1bb034-7bbf-4e84-b418-b7f4aee59d72", "issueDate": "2022-11-22T00:00:00", "lineItems": [{"accountRef": {"id": "2c410b86-de57-49d1-b540-4e8ce824979c", "name": "Bank Fees"}, "description": "Bank fee", "quantity": 1, "subTotal": 15, "taxAmount": 0, "totalAmount": 15, "tracking": {"invoiceTo": {"dataType": "transfer"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 15}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-11-22T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 15}, "payment": {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "dc1bb034-7bbf-4e84-b418-b7f4aee59d72", "paidOnDate": "2022-11-22T00:00:00", "totalAmount": 15}}], "reference": "", "sourceModifiedDate": "2021-01-03T21:43:46", "subTotal": 15, "taxAmount": 0, "totalAmount": 15} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directCostId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-direct-cost-attachment: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directCostId: "" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounting-direct-costs: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/connections/57b731ba-1d45-4386-ba58-2a1ca0234624/data/directCosts?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/connections/57b731ba-1d45-4386-ba58-2a1ca0234624/data/directCosts?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/connections/57b731ba-1d45-4386-ba58-2a1ca0234624/data/directCosts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"contactRef": {"dataType": "suppliers", "id": "D4Q4iYwHou"}, "currency": "GBP", "currencyRate": 1, "id": "994ad234-ca05-466e-8e6a-117783b38cf6", "issueDate": "2022-04-27T00:00:00", "lineItems": [{"accountRef": {"id": "7403e960-5b72-42ff-abf4-c870ad8910bd", "name": "Purchases"}, "description": "Underground - Drain Saddle Branches 160mm x 110mm x 87 �", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "2", "name": "Solvent Weld Branch 160mm x 110mm x 87 �"}, "quantity": 1, "subTotal": 220.18, "taxAmount": 22.02, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 242.2, "tracking": {"invoiceTo": {"dataType": "transfer"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 220.18}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18Z", "note": "Direct Cost with 1 line items, totaling 242.20", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-04-27T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -242.2}, "payment": {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "994ad234-ca05-466e-8e6a-117783b38cf6", "note": "Payment for direct cost 994ad234-ca05-466e-8e6a-117783b38cf6", "paidOnDate": "2022-04-27T00:00:00", "reference": "Direct Cost 994ad234-ca05-466e-8e6a-117783b38cf6", "totalAmount": 242.2}}], "reference": "005b7b62-dc9f-42d2-85a2-4a2cefc6bab2", "sourceModifiedDate": "2022-09-18T20:59:02", "subTotal": 220.18, "taxAmount": 22.02, "totalAmount": 242.2}, {"contactRef": {"dataType": "suppliers", "id": "d3tf43eghS"}, "currency": "GBP", "currencyRate": 1, "id": "735b5f9b-9e58-4f8f-8a9d-083de599986c", "issueDate": "2022-05-02T00:00:00", "lineItems": [{"accountRef": {"id": "7403e960-5b72-42ff-abf4-c870ad8910bd", "name": "Purchases"}, "description": "Underground - Drain Yard Gully", "discountAmount": 73.62, "discountPercentage": 9.89, "itemRef": {"id": "00491160-6ee5-4d76-9f34-998f00687481", "name": "Aluminium Silt Bucket"}, "quantity": 5, "subTotal": 670.78, "taxAmount": 67.08, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 737.86, "tracking": {"invoiceTo": {"dataType": "journalEntry"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 148.88}, {"accountRef": {"id": "7403e960-5b72-42ff-abf4-c870ad8910bd", "name": "Purchases"}, "description": "Underground - Drain Bottle Gullies 90 degree Rectangular", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "6", "name": "Back Inlet Roddable Gully 90� Outlet Rectangular Grid"}, "quantity": 3, "subTotal": 248.04, "taxAmount": 24.8, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 272.84, "tracking": {"invoiceTo": {"dataType": "accountTransaction"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 82.68}, {"accountRef": {"id": "7403e960-5b72-42ff-abf4-c870ad8910bd", "name": "Purchases"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 8, "subTotal": 9540.08, "taxAmount": 954.01, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 10494.09, "tracking": {"invoiceTo": {"dataType": "invoice"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 1192.51}, {"accountRef": {"id": "7403e960-5b72-42ff-abf4-c870ad8910bd", "name": "Purchases"}, "description": "Underground - Drain Saddle Branches 160mm x 110mm x 87 �", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "2", "name": "Solvent Weld Branch 160mm x 110mm x 87 �"}, "quantity": 9, "subTotal": 1981.62, "taxAmount": 198.16, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 2179.78, "tracking": {"invoiceTo": {"dataType": "accountTransaction"}, "recordRefs": []}, "trackingCategoryRefs": [{"id": "costcode_1", "name": "Green Concrete"}], "unitAmount": 220.18}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18Z", "note": "Direct Cost with 4 line items, totaling 13684.57", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-05-02T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -13684.57}, "payment": {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "735b5f9b-9e58-4f8f-8a9d-083de599986c", "note": "Payment for direct cost 735b5f9b-9e58-4f8f-8a9d-083de599986c", "paidOnDate": "2022-05-02T00:00:00", "reference": "Direct Cost 735b5f9b-9e58-4f8f-8a9d-083de599986c", "totalAmount": 13684.57}}], "reference": "7d011ce8-89ae-43e7-a2ed-cf028534ccdc", "sourceModifiedDate": "2022-10-13T07:15:02", "subTotal": 12440.52, "taxAmount": 1244.05, "totalAmount": 13684.57}], "totalResults": 90} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/directCosts?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/directCosts?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/directCosts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "id": "6ab3e391-97d7-ec11-8e7e-000d3a0cfe40", "issueDate": "2022-05-21T00:00:00", "lineItems": [{"accountRef": {"id": "30"}, "description": "test expenses 2", "quantity": -1, "subTotal": -17.89, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "cc81fea8-2917-ed11-90eb-002248009df3", "name": ""}, "totalAmount": -17.89, "tracking": {"invoiceTo": {"dataType": "invoice"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 17.89}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "3931", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-05-21T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -17.89}, "payment": {"accountRef": {"id": "TEST"}, "currency": "GBP", "currencyRate": 1, "id": "6ab3e391-97d7-ec11-8e7e-000d3a0cfe40", "paidOnDate": "2022-05-21T00:00:00", "totalAmount": -17.89}}], "reference": "INS000090", "sourceModifiedDate": "2022-05-19T17:17:33Z", "subTotal": -17.89, "taxAmount": 0, "totalAmount": -17.89}, {"currency": "GBP", "currencyRate": 1, "id": "b832f518-88d7-ec11-8e7e-000d3a0cfe40", "issueDate": "2022-05-23T00:00:00", "lineItems": [{"accountRef": {"id": "31300"}, "description": "Utilities Expense", "quantity": 1, "subTotal": 14.76, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "cc81fea8-2917-ed11-90eb-002248009df3", "name": ""}, "totalAmount": 14.76, "tracking": {"invoiceTo": {"dataType": "journalEntry"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 14.76}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "3915", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-05-23T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 14.76}, "payment": {"accountRef": {"id": "TEST"}, "currency": "GBP", "currencyRate": 1, "id": "b832f518-88d7-ec11-8e7e-000d3a0cfe40", "paidOnDate": "2022-05-23T00:00:00", "totalAmount": 14.76}}], "reference": "INS000050", "sourceModifiedDate": "2022-05-19T15:26:48Z", "subTotal": 14.76, "taxAmount": 0, "totalAmount": 14.76}], "totalResults": 67} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/directCosts?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/directCosts?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/directCosts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "id": "190325254", "issueDate": "2017-11-23T00:00:00", "lineItems": [{"accountRef": {"id": "285", "name": "Accommodation and Meals"}, "description": "Atomic Software Limite Wellington,Nzl", "quantity": 1, "subTotal": 11.92, "taxAmount": 2.38, "totalAmount": 14.3, "tracking": {"invoiceTo": {"dataType": "accountTransaction"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 11.92}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:20:36Z", "note": "Atomic Software Limite Wellington,Nzl", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2017-11-23T00:00:00", "currency": "GBP", "totalAmount": 14.3}, "payment": {"accountRef": {"id": "750-1", "name": "Bank Account: Business Current Account"}, "currency": "GBP", "id": "190325254", "note": "Atomic Software Limite Wellington,Nzl", "paidOnDate": "2017-11-23T00:00:00", "totalAmount": 14.3}}], "sourceModifiedDate": "2019-11-22T14:31:14Z", "subTotal": 11.92, "taxAmount": 2.38, "totalAmount": 14.3}, {"currency": "GBP", "currencyRate": 1, "id": "348108455", "issueDate": "2017-11-23T00:00:00", "lineItems": [{"accountRef": {"id": "285", "name": "Accommodation and Meals"}, "description": "Atomic Software Limite Wellington,Nzl", "quantity": 1, "subTotal": 11.92, "taxAmount": 2.38, "totalAmount": 14.3, "tracking": {"invoiceTo": {"dataType": "journalEntry"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 11.92}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:20:36Z", "note": "Atomic Software Limite Wellington,Nzl", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2017-11-23T00:00:00", "currency": "GBP", "totalAmount": 14.3}, "payment": {"accountRef": {"id": "750-1", "name": "Bank Account: Business Current Account"}, "currency": "GBP", "id": "348108455", "note": "Atomic Software Limite Wellington,Nzl", "paidOnDate": "2017-11-23T00:00:00", "totalAmount": 14.3}}], "sourceModifiedDate": "2022-10-24T12:35:29Z", "subTotal": 11.92, "taxAmount": 2.38, "totalAmount": 14.3}], "totalResults": 456} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/connections/100d8da9-91b1-495c-ae2e-2219c244acae/data/directCosts?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/connections/100d8da9-91b1-495c-ae2e-2219c244acae/data/directCosts?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/connections/100d8da9-91b1-495c-ae2e-2219c244acae/data/directCosts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"contactRef": {"dataType": "suppliers", "id": "Sainsburys"}, "currency": "GBP", "currencyRate": 1, "id": "29870062", "issueDate": "2019-02-12T00:00:00", "lineItems": [{"accountRef": {"id": "3361426", "name": "Meals & Entertainment"}, "description": "Food to keep me working", "quantity": 1, "subTotal": 10, "taxAmount": 0, "totalAmount": 10, "tracking": {"invoiceTo": {"dataType": "journalEntry"}, "recordRefs": []}, "trackingCategoryRefs": [{"id": "4370503", "name": "Meals & Entertainment"}], "unitAmount": 10}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "note": "Food to keep me working", "paymentAllocations": [], "reference": "Food to keep me working", "sourceModifiedDate": "2021-10-28T15:21:46", "subTotal": 10, "taxAmount": 0, "totalAmount": 10}, {"contactRef": {"dataType": "suppliers", "id": "Pencils Wholesale"}, "currency": "GBP", "currencyRate": 1, "id": "107509561", "issueDate": "2020-01-27T00:00:00", "lineItems": [{"accountRef": {"id": "3380551", "name": "Supplies"}, "description": "Buying pencils", "quantity": 1, "subTotal": 43.48, "taxAmount": 6.52, "totalAmount": 50, "tracking": {"invoiceTo": {"dataType": "journalEntry"}, "recordRefs": []}, "trackingCategoryRefs": [{"id": "5397997", "name": "Supplies"}], "unitAmount": 43.48}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "note": "Buying pencils", "paymentAllocations": [], "reference": "Buying pencils", "sourceModifiedDate": "2021-10-28T15:21:47", "subTotal": 43.48, "taxAmount": 6.52, "totalAmount": 50}], "totalResults": 73} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/directCosts?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/directCosts?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/directCosts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"contactRef": {"dataType": "suppliers", "id": "360000-933272659"}, "currency": "GBP", "currencyRate": 1, "id": "D7B-933784104", "issueDate": "2022-12-01T00:00:00", "lineItems": [{"accountRef": {"id": "3C0000-933270542", "name": "Rent"}, "quantity": 1, "subTotal": 1200, "totalAmount": 1200, "tracking": {"invoiceTo": {"dataType": "transfer"}, "recordRefs": [{"dataType": "trackingCategories", "id": "80000007-1197713802"}, {"dataType": "customers", "id": "800000B0-1197755238"}]}, "trackingCategoryRefs": [{"id": "80000007-1197713802", "name": "Overhead"}], "unitAmount": 1200}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:13:57Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-12-01T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 1200}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "D7B-933784104", "paidOnDate": "2022-12-01T00:00:00", "totalAmount": 1200}}], "reference": "93", "sourceModifiedDate": "2023-12-16T05:04:10", "subTotal": 1200, "taxAmount": 0, "totalAmount": 1200}, {"contactRef": {"dataType": "suppliers", "id": "320000-933272659"}, "currency": "GBP", "currencyRate": 1, "id": "DFA-933785132", "issueDate": "2022-12-05T00:00:00", "lineItems": [{"accountRef": {"id": "280000-933270542", "name": "Freight & Delivery"}, "quantity": 1, "subTotal": 35, "totalAmount": 35, "tracking": {"invoiceTo": {"dataType": "accountTransaction"}, "recordRefs": [{"dataType": "trackingCategories", "id": "40000-933272658"}, {"dataType": "customers", "id": "1E0000-933272658"}]}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": 35}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:13:57Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-12-05T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 35}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "DFA-933785132", "paidOnDate": "2022-12-05T00:00:00", "totalAmount": 35}}], "reference": "95", "sourceModifiedDate": "2023-12-16T05:04:11", "subTotal": 35, "taxAmount": 0, "totalAmount": 35}], "totalResults": 250} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/directCosts?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/directCosts?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/directCosts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "id": "PUR-85", "issueDate": "2015-08-12T00:00:00", "lineItems": [{"accountRef": {"id": "55", "name": "Opening Balance Equity"}, "quantity": 1, "subTotal": 3831.8, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 3831.8, "tracking": {"invoiceTo": {"dataType": "transfer"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 3831.8}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:40Z", "note": "Opening Balance from Bank", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2015-08-12T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -3831.8}, "payment": {"accountRef": {"id": "57", "name": "Visa Credit Card"}, "currency": "GBP", "currencyRate": 1, "id": "85", "paidOnDate": "2015-08-12T00:00:00", "reference": "Opening Balance from Bank", "totalAmount": 3831.8}}], "sourceModifiedDate": "2016-09-12T18:13:07Z", "subTotal": 3831.8, "taxAmount": 0, "totalAmount": 3831.8}, {"contactRef": {"dataType": "suppliers", "id": "27"}, "currency": "GBP", "currencyRate": 1, "id": "PUR-3617", "issueDate": "2015-11-27T00:00:00", "lineItems": [{"accountRef": {"id": "22", "name": "Insurance Expense-General Liability Insurance"}, "description": "Insurance - general liability", "quantity": 1, "subTotal": 750, "taxAmount": 150, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Bills", "name": "20.0% S Bills"}, "totalAmount": 900, "tracking": {"invoiceTo": {"dataType": "accountTransaction"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 750}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:40Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2015-11-27T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -900}, "payment": {"accountRef": {"id": "81", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "id": "3617", "note": "2001", "paidOnDate": "2015-11-27T00:00:00", "totalAmount": 900}}], "reference": "2001", "sourceModifiedDate": "2022-08-19T10:19:56Z", "subTotal": 750, "taxAmount": 150, "totalAmount": 900}], "totalResults": 4460} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/directCosts?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/directCosts?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/directCosts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "id": "PUR-15", "issueDate": "2018-09-21T00:00:00", "lineItems": [{"accountRef": {"id": "37", "name": "Computer equipment accumulated depreciation brought forward"}, "description": "Payment to Google", "quantity": 1, "subTotal": 1.59, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 1.59, "tracking": {"invoiceTo": {"dataType": "invoice"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 1.59}], "modifiedDate": "2023-01-18T11:02:59Z", "note": "Payment to Google", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2018-09-21T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -1.59}, "payment": {"accountRef": {"id": "61", "name": "Dave PP Current"}, "currency": "GBP", "currencyRate": 1, "id": "15", "paidOnDate": "2018-09-21T00:00:00", "reference": "Payment to Google", "totalAmount": 1.59}}], "sourceModifiedDate": "2018-12-17T14:56:44Z", "subTotal": 1.59, "taxAmount": 0, "totalAmount": 1.59}, {"contactRef": {"dataType": "suppliers", "id": "4"}, "currency": "GBP", "currencyRate": 1, "id": "PUR-9303", "issueDate": "2018-09-21T00:00:00", "lineItems": [{"accountRef": {"id": "37", "name": "Computer equipment accumulated depreciation brought forward"}, "description": "Payment to Google", "quantity": 1, "subTotal": 1.59, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 1.59, "tracking": {"invoiceTo": {"dataType": "journalEntry"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 1.59}], "modifiedDate": "2023-01-18T11:02:59Z", "note": "Payment to Google", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2018-09-21T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -1.59}, "payment": {"accountRef": {"id": "61", "name": "Dave PP Current"}, "currency": "GBP", "currencyRate": 1, "id": "9303", "paidOnDate": "2018-09-21T00:00:00", "reference": "Payment to Google", "totalAmount": 1.59}}], "sourceModifiedDate": "2022-07-11T10:32:16Z", "subTotal": 1.59, "taxAmount": 0, "totalAmount": 1.59}], "totalResults": 2176} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/directCosts?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/directCosts?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/directCosts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "id": "73", "issueDate": "2021-01-29T00:00:00", "lineItems": [{"accountRef": {"id": "7200", "name": "Electricity"}, "description": "Electrcity Direct Debit", "quantity": 1, "subTotal": 150, "taxAmount": 12, "taxRateRef": {"id": "3"}, "totalAmount": 162, "tracking": {"invoiceTo": {"dataType": "transfer"}, "recordRefs": []}, "trackingCategoryRefs": [{"id": "department_0", "name": "Default"}], "unitAmount": 150}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:35Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2021-01-29T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 162}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "73", "paidOnDate": "2021-01-29T00:00:00", "reference": "DD/STO", "totalAmount": 162}}], "reference": "DD/STO", "sourceModifiedDate": "2022-11-25T09:43:54", "subTotal": 150, "taxAmount": 12, "totalAmount": 162}, {"currency": "GBP", "currencyRate": 1, "id": "52", "issueDate": "2021-01-30T00:00:00", "lineItems": [{"accountRef": {"id": "2202", "name": "VAT Liability"}, "description": "Vat Payment Quater End 3112.96", "quantity": 1, "subTotal": 1497.58, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "9", "name": "Non-Vatable Tax Code"}, "totalAmount": 1497.58, "tracking": {"invoiceTo": {"dataType": "accountTransaction"}, "recordRefs": []}, "trackingCategoryRefs": [{"id": "department_0", "name": "Default"}], "unitAmount": 1497.58}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:35Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2021-01-30T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 1497.58}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "52", "paidOnDate": "2021-01-30T00:00:00", "reference": "568953", "totalAmount": 1497.58}}], "reference": "568953", "sourceModifiedDate": "2022-11-25T09:43:54", "subTotal": 1497.58, "taxAmount": 0, "totalAmount": 1497.58}], "totalResults": 106} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/71ca2b28-8e86-41e7-8c55-f681042b11a0/connections/be80adfc-1157-4db4-9170-f8bcbbc051ba/data/directCosts?page=1&pageSize=2"}, "next": {"href": "/companies/71ca2b28-8e86-41e7-8c55-f681042b11a0/connections/be80adfc-1157-4db4-9170-f8bcbbc051ba/data/directCosts?page=2&pageSize=2"}, "self": {"href": "/companies/71ca2b28-8e86-41e7-8c55-f681042b11a0/connections/be80adfc-1157-4db4-9170-f8bcbbc051ba/data/directCosts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "id": "CCTRANSACTION:4355", "issueDate": "2020-01-20T00:00:00", "lineItems": [{"accountRef": {"id": "195", "name": "Insurance"}, "quantity": 1, "subTotal": 9.99, "taxAmount": 2, "taxRateRef": {"id": "62018"}, "totalAmount": 11.99, "tracking": {"invoiceTo": {"dataType": "transfer"}, "recordRefs": []}, "trackingCategoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}], "unitAmount": 9.99}], "modifiedDate": "2022-10-28T11:10:28Z", "note": "Test 1", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2020-01-20T00:00:00", "currency": "GBP", "totalAmount": 11.99}, "payment": {"accountRef": {"id": "348", "name": "CMRR Renewal"}, "currency": "GBP", "id": "4355", "note": "", "paidOnDate": "2020-01-20T00:00:00", "reference": "", "totalAmount": 11.99}}], "reference": "", "sourceModifiedDate": "2022-08-22T09:26:42", "subTotal": 9.99, "taxAmount": 2, "totalAmount": 11.99}, {"currency": "GBP", "currencyRate": 1, "id": "CCTRANSACTION:4356", "issueDate": "2020-01-20T00:00:00", "lineItems": [{"accountRef": {"id": "195", "name": "Insurance"}, "quantity": 1, "subTotal": 9.99, "taxAmount": 2, "taxRateRef": {"id": "62022"}, "totalAmount": 11.99, "tracking": {"invoiceTo": {"dataType": "journalEntry"}, "recordRefs": []}, "trackingCategoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}], "unitAmount": 9.99}], "modifiedDate": "2022-10-28T11:10:28Z", "note": "Test 1", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2020-01-20T00:00:00", "currency": "GBP", "totalAmount": 11.99}, "payment": {"accountRef": {"id": "348", "name": "CMRR Renewal"}, "currency": "GBP", "id": "4356", "note": "", "paidOnDate": "2020-01-20T00:00:00", "reference": "", "totalAmount": 11.99}}], "reference": "", "sourceModifiedDate": "2022-02-17T23:26:16", "subTotal": 9.99, "taxAmount": 2, "totalAmount": 11.99}], "totalResults": 57} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/directCosts?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/directCosts?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/directCosts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"contactRef": {"dataType": "suppliers", "id": "737982b0-2811-44c9-bdb3-3b26a3a6ef8c"}, "currency": "GBP", "currencyRate": 1, "id": "dc1bb034-7bbf-4e84-b418-b7f4aee59d72", "issueDate": "2022-11-22T00:00:00", "lineItems": [{"accountRef": {"id": "2c410b86-de57-49d1-b540-4e8ce824979c", "name": "Bank Fees"}, "description": "Bank fee", "quantity": 1, "subTotal": 15, "taxAmount": 0, "totalAmount": 15, "tracking": {"invoiceTo": {"dataType": "invoice"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 15}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-11-22T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 15}, "payment": {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "dc1bb034-7bbf-4e84-b418-b7f4aee59d72", "paidOnDate": "2022-11-22T00:00:00", "totalAmount": 15}}], "reference": "", "sourceModifiedDate": "2021-01-03T21:43:46", "subTotal": 15, "taxAmount": 0, "totalAmount": 15}, {"contactRef": {"dataType": "suppliers", "id": "74ea95ea-6e1e-435d-9c30-0dff8ae1bd80"}, "currency": "GBP", "currencyRate": 1, "id": "521c2396-7f74-404c-9cca-31115296b808", "issueDate": "2022-11-23T00:00:00", "lineItems": [{"accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a", "name": "Printing & Stationery"}, "description": "Misc stationery", "quantity": 1, "subTotal": 18.09, "taxAmount": 3.62, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 21.71, "tracking": {"invoiceTo": {"dataType": "journalEntry"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 18.09}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-11-23T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 21.71}, "payment": {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "521c2396-7f74-404c-9cca-31115296b808", "paidOnDate": "2022-11-23T00:00:00", "totalAmount": 21.71}}], "reference": "Eft", "sourceModifiedDate": "2021-01-03T21:43:51", "subTotal": 18.09, "taxAmount": 3.62, "totalAmount": 21.71}], "totalResults": 15} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + list-accounting-direct-cost-attachments: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directCostId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-transfer: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transferId: "" + responses: + "200": + application/json: {"contactRef": {"dataType": "customers", "id": "e4baf949-cb1d-4341-8452-200a93baa3fa"}, "date": "2022-04-25T07:20:00", "depositedRecordRefs": [{"dataType": "directIncomes", "id": "fc253cca-0dfe-46e8-b75f-c7fb3db760b2"}], "description": "depositing 16531.08 into Current Account", "from": {"accountRef": {"id": "ff8fdc4c-2aad-4ec1-9430-6bd201832eb3"}, "amount": 16531.08, "currency": "GBP"}, "id": "0bd2f801-6f02-44d6-a2ab-5431553d16f9", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18", "sourceModifiedDate": "2022-04-25T07:20:00", "to": {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918"}, "amount": 16531.08, "currency": "GBP"}, "trackingCategoryRefs": []} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transferId: "" + responses: + "200": + application/json: {"date": "2020-11-26T00:00:00", "depositedRecordRefs": [], "from": {"accountRef": {"id": "cf1417b3-89d1-ea11-bbaa-000d3a2b9185"}, "amount": 20, "currency": "GBP"}, "id": "G00001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:26", "sourceModifiedDate": "2020-11-26T12:16:44Z", "to": {"accountRef": {"id": "ce1417b3-89d1-ea11-bbaa-000d3a2b9185"}, "amount": 20, "currency": "GBP"}, "trackingCategoryRefs": []} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transferId: "" + responses: + "200": + application/json: {"date": "2018-06-14T00:00:00", "depositedRecordRefs": [], "description": "Transfer from Savings Account to Freeagent Test12", "from": {"accountRef": {"id": "532100"}, "amount": 0.69, "currency": "GBP"}, "id": "307335275", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:21:36", "sourceModifiedDate": "2022-03-23T15:55:58Z", "to": {"accountRef": {"id": "708504"}, "amount": 0.69, "currency": "GBP"}, "trackingCategoryRefs": [{"id": "761"}]} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transferId: "" + responses: + "200": + application/json: {"contactRef": {"dataType": "customers", "id": "417"}, "date": "2021-03-10T00:00:00", "depositedRecordRefs": [{"dataType": "payments", "id": "428"}], "from": {"accountRef": {"id": "122"}, "amount": 90, "currency": "GBP"}, "id": "2-1", "modifiedDate": "2022-09-20T08:16:26", "sourceModifiedDate": "2022-04-28T13:36:47", "to": {"accountRef": {"id": "513"}, "amount": 90, "currency": "GBP"}, "trackingCategoryRefs": [{"id": "location-1"}]} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transferId: "" + responses: + "200": + application/json: {"date": "2024-10-14T00:00:00", "depositedRecordRefs": [], "description": "Funds Transfer", "from": {"accountRef": {"id": "30000-933270541"}, "amount": 15000, "currency": "GBP"}, "id": "4B1-933288922", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:13:45", "sourceModifiedDate": "2023-12-16T05:03:58", "to": {"accountRef": {"id": "20000-933270541"}, "amount": 15000, "currency": "GBP"}, "trackingCategoryRefs": []} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transferId: "" + responses: + "200": + application/json: {"date": "2020-08-21T00:00:00", "depositedRecordRefs": [], "from": {"accountRef": {"id": "102"}, "amount": 73.41, "currency": "GBP"}, "id": "646", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:33", "sourceModifiedDate": "2020-08-26T11:41:20Z", "to": {"accountRef": {"id": "108"}, "amount": 73.41, "currency": "GBP"}, "trackingCategoryRefs": []} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transferId: "" + responses: + "200": + application/json: {"date": "2020-08-29T00:00:00", "depositedRecordRefs": [], "from": {"accountRef": {"id": "60"}, "amount": 86.19, "currency": "GBP"}, "id": "1881", "modifiedDate": "2023-01-18T11:03:00", "sourceModifiedDate": "2020-09-03T11:19:54Z", "to": {"accountRef": {"id": "61"}, "amount": 86.19, "currency": "GBP"}, "trackingCategoryRefs": []} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transferId: "" + responses: + "200": + application/json: {"date": "2018-03-06T00:00:00", "depositedRecordRefs": [], "description": "Some cheque", "from": {"accountRef": {"id": "9a3f0ed6267a11e797950a57719b2edb"}, "amount": 1000, "currency": "GBP"}, "id": "434bce57215a11e8b45c025132dab352", "modifiedDate": "2022-10-24T14:54:11", "sourceModifiedDate": "2018-03-06T16:20:19Z", "to": {"accountRef": {"id": "9a2c3770267a11e797950a57719b2edb"}, "amount": 1000, "currency": "GBP"}, "trackingCategoryRefs": []} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transferId: "" + responses: + "200": + application/json: {"date": "2022-03-10T00:00:00", "depositedRecordRefs": [], "description": "Description", "from": {"accountRef": {"id": "CHECKINGACCOUNT:12"}, "amount": 418.27, "currency": "ZAR"}, "id": "4844", "metadata": {"isDeleted": false}, "modifiedDate": "2023-02-23T14:18:48", "sourceModifiedDate": "2022-03-10T12:38:23", "to": {"accountRef": {"id": "CHECKINGACCOUNT:9"}, "amount": 35.45, "currency": "CAD"}, "trackingCategoryRefs": [{"id": "LOCATION-10", "name": "South Africa"}]} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transferId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounting-transfers: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/connections/57b731ba-1d45-4386-ba58-2a1ca0234624/data/transfers?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/connections/57b731ba-1d45-4386-ba58-2a1ca0234624/data/transfers?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/connections/57b731ba-1d45-4386-ba58-2a1ca0234624/data/transfers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"contactRef": {"dataType": "customers", "id": "e4baf949-cb1d-4341-8452-200a93baa3fa"}, "date": "2022-04-25T07:20:00", "depositedRecordRefs": [{"dataType": "directIncomes", "id": "fc253cca-0dfe-46e8-b75f-c7fb3db760b2"}], "description": "depositing 16531.08 into Current Account", "from": {"accountRef": {"id": "ff8fdc4c-2aad-4ec1-9430-6bd201832eb3"}, "amount": 16531.08, "currency": "GBP"}, "id": "0bd2f801-6f02-44d6-a2ab-5431553d16f9", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18", "sourceModifiedDate": "2022-04-25T07:20:00", "to": {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918"}, "amount": 16531.08, "currency": "GBP"}, "trackingCategoryRefs": []}, {"contactRef": {"dataType": "customers", "id": "51f03576-f6b0-40d5-9fba-81a490411c03"}, "date": "2022-04-25T07:20:00", "depositedRecordRefs": [{"dataType": "directIncomes", "id": "38e8c917-0afc-4583-8ffe-1b53ad601197"}], "description": "depositing 188.33 into Current Account", "from": {"accountRef": {"id": "ff8fdc4c-2aad-4ec1-9430-6bd201832eb3"}, "amount": 188.33, "currency": "GBP"}, "id": "78373000-29e1-4ef4-a2e6-9b573ed656e4", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18", "sourceModifiedDate": "2022-04-25T07:20:00", "to": {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918"}, "amount": 188.33, "currency": "GBP"}, "trackingCategoryRefs": []}], "totalResults": 357} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/transfers?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/transfers?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/transfers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"date": "2020-11-26T00:00:00", "depositedRecordRefs": [], "from": {"accountRef": {"id": "cf1417b3-89d1-ea11-bbaa-000d3a2b9185"}, "amount": 20, "currency": "GBP"}, "id": "G00001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:26", "sourceModifiedDate": "2020-11-26T12:16:44Z", "to": {"accountRef": {"id": "ce1417b3-89d1-ea11-bbaa-000d3a2b9185"}, "amount": 20, "currency": "GBP"}, "trackingCategoryRefs": []}, {"date": "2022-10-25T00:00:00", "depositedRecordRefs": [], "from": {"accountRef": {"id": "8277672c-b8e6-ec11-82f8-0022481a77f0"}, "amount": 3.6, "currency": "USD"}, "id": "TST-001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:26", "sourceModifiedDate": "2022-10-25T15:47:48Z", "to": {"accountRef": {"id": "8982e7d8-cb19-eb11-bbf9-0022481ad2f4"}, "amount": 2.34, "currency": "GBP"}, "trackingCategoryRefs": []}], "totalResults": 10} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/transfers?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/transfers?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/transfers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"date": "2018-06-14T00:00:00", "depositedRecordRefs": [], "description": "Transfer from Savings Account to Freeagent Test12", "from": {"accountRef": {"id": "532100"}, "amount": 0.69, "currency": "GBP"}, "id": "307335275", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:21:36", "sourceModifiedDate": "2022-03-23T15:55:58Z", "to": {"accountRef": {"id": "708504"}, "amount": 0.69, "currency": "GBP"}, "trackingCategoryRefs": [{"id": "761"}]}, {"date": "2019-12-23T00:00:00", "depositedRecordRefs": [], "description": "Transfer from Business Current Account to Nic Test11", "from": {"accountRef": {"id": "469976"}, "amount": 250, "currency": "GBP"}, "id": "308682395", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:21:36", "sourceModifiedDate": "2022-03-31T16:09:27Z", "to": {"accountRef": {"id": "691393"}, "amount": 250, "currency": "GBP"}, "trackingCategoryRefs": [{"id": "761"}]}], "totalResults": 99} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/connections/5f07dcfb-23c0-49e6-895c-4498ea728ff3/data/transfers?page=1&pageSize=2"}, "next": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/connections/5f07dcfb-23c0-49e6-895c-4498ea728ff3/data/transfers?page=2&pageSize=2"}, "self": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/connections/5f07dcfb-23c0-49e6-895c-4498ea728ff3/data/transfers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"contactRef": {"dataType": "customers", "id": "417"}, "date": "2021-03-10T00:00:00", "depositedRecordRefs": [{"dataType": "payments", "id": "428"}], "from": {"accountRef": {"id": "122"}, "amount": 90, "currency": "GBP"}, "id": "2-1", "modifiedDate": "2022-09-20T08:16:26", "sourceModifiedDate": "2022-04-28T13:36:47", "to": {"accountRef": {"id": "513"}, "amount": 90, "currency": "GBP"}, "trackingCategoryRefs": [{"id": "location-1"}]}, {"contactRef": {"dataType": "customers", "id": "417"}, "date": "2022-04-28T00:00:00", "depositedRecordRefs": [{"dataType": "payments", "id": "7526"}], "from": {"accountRef": {"id": "513"}, "amount": 1200, "currency": "GBP"}, "id": "2-11822", "modifiedDate": "2022-09-20T08:16:26", "sourceModifiedDate": "2022-04-28T14:14:33", "to": {"accountRef": {"id": "122"}, "amount": 1200, "currency": "GBP"}, "trackingCategoryRefs": [{"id": "location-1"}]}], "totalResults": 47} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/transfers?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/transfers?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/transfers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"date": "2024-10-14T00:00:00", "depositedRecordRefs": [], "description": "Funds Transfer", "from": {"accountRef": {"id": "30000-933270541"}, "amount": 15000, "currency": "GBP"}, "id": "4B1-933288922", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:13:45", "sourceModifiedDate": "2023-12-16T05:03:58", "to": {"accountRef": {"id": "20000-933270541"}, "amount": 15000, "currency": "GBP"}, "trackingCategoryRefs": []}, {"date": "2024-11-25T00:00:00", "depositedRecordRefs": [], "description": "Funds Transfer", "from": {"accountRef": {"id": "20000-933270541"}, "amount": 42300, "currency": "GBP"}, "id": "C2A-933780606", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:13:45", "sourceModifiedDate": "2023-12-16T05:04:07", "to": {"accountRef": {"id": "30000-933270541"}, "amount": 42300, "currency": "GBP"}, "trackingCategoryRefs": []}], "totalResults": 4} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/transfers?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/transfers?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/transfers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"date": "2020-08-21T00:00:00", "depositedRecordRefs": [], "from": {"accountRef": {"id": "102"}, "amount": 73.41, "currency": "GBP"}, "id": "646", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:33", "sourceModifiedDate": "2020-08-26T11:41:20Z", "to": {"accountRef": {"id": "108"}, "amount": 73.41, "currency": "GBP"}, "trackingCategoryRefs": []}, {"date": "2020-08-22T00:00:00", "depositedRecordRefs": [], "from": {"accountRef": {"id": "124"}, "amount": 66.66, "currency": "GBP"}, "id": "678", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:33", "sourceModifiedDate": "2020-08-29T00:01:20Z", "to": {"accountRef": {"id": "109"}, "amount": 66.66, "currency": "GBP"}, "trackingCategoryRefs": []}], "totalResults": 442} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/transfers?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/transfers?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/transfers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"date": "2020-08-29T00:00:00", "depositedRecordRefs": [], "from": {"accountRef": {"id": "60"}, "amount": 86.19, "currency": "GBP"}, "id": "1881", "modifiedDate": "2023-01-18T11:03:00", "sourceModifiedDate": "2020-09-03T11:19:54Z", "to": {"accountRef": {"id": "61"}, "amount": 86.19, "currency": "GBP"}, "trackingCategoryRefs": []}, {"date": "2020-09-02T00:00:00", "depositedRecordRefs": [], "from": {"accountRef": {"id": "60"}, "amount": 45.73, "currency": "GBP"}, "id": "1885", "modifiedDate": "2023-01-18T11:03:00", "sourceModifiedDate": "2020-09-03T11:23:44Z", "to": {"accountRef": {"id": "61"}, "amount": 45.73, "currency": "GBP"}, "trackingCategoryRefs": []}], "totalResults": 18} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/transfers?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/transfers?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/transfers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"date": "2018-03-06T00:00:00", "depositedRecordRefs": [], "description": "Some cheque", "from": {"accountRef": {"id": "9a3f0ed6267a11e797950a57719b2edb"}, "amount": 1000, "currency": "GBP"}, "id": "434bce57215a11e8b45c025132dab352", "modifiedDate": "2022-10-24T14:54:11", "sourceModifiedDate": "2018-03-06T16:20:19Z", "to": {"accountRef": {"id": "9a2c3770267a11e797950a57719b2edb"}, "amount": 1000, "currency": "GBP"}, "trackingCategoryRefs": []}, {"date": "2018-03-06T00:00:00", "depositedRecordRefs": [], "description": "Some cash", "from": {"accountRef": {"id": "9a3f0ed6267a11e797950a57719b2edb"}, "amount": 465, "currency": "GBP"}, "id": "73d909a4215a11e8b45c025132dab352", "modifiedDate": "2022-10-24T14:54:11", "sourceModifiedDate": "2018-03-06T16:21:40Z", "to": {"accountRef": {"id": "9a2c3770267a11e797950a57719b2edb"}, "amount": 465, "currency": "GBP"}, "trackingCategoryRefs": []}], "totalResults": 646} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b53cfc9f-1a00-4a20-936f-34e8efbe07c5/connections/d891700f-d906-4e57-998a-0cf03d2a05d3/data/transfers?page=1&pageSize=2"}, "self": {"href": "/companies/b53cfc9f-1a00-4a20-936f-34e8efbe07c5/connections/d891700f-d906-4e57-998a-0cf03d2a05d3/data/transfers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"date": "2022-03-10T00:00:00", "depositedRecordRefs": [], "description": "Description", "from": {"accountRef": {"id": "CHECKINGACCOUNT:12"}, "amount": 418.27, "currency": "ZAR"}, "id": "4844", "metadata": {"isDeleted": false}, "modifiedDate": "2023-02-23T14:18:48", "sourceModifiedDate": "2022-03-10T12:38:23", "to": {"accountRef": {"id": "CHECKINGACCOUNT:9"}, "amount": 35.45, "currency": "CAD"}, "trackingCategoryRefs": [{"id": "LOCATION-10", "name": "South Africa"}]}, {"date": "2022-10-05T00:00:00", "depositedRecordRefs": [], "description": "From bank account '700_CHK' to bank account 'Test Savings Account'", "from": {"accountRef": {"id": "CHECKINGACCOUNT:12"}, "amount": 4040.62, "currency": "ZAR"}, "id": "18828", "metadata": {"isDeleted": false}, "modifiedDate": "2023-02-23T14:18:48", "sourceModifiedDate": "2022-10-05T15:28:15", "to": {"accountRef": {"id": "SAVINGSACCOUNT:17"}, "amount": 200, "currency": "GBP"}, "trackingCategoryRefs": [{"id": "LOCATION-10", "name": "South Africa"}]}], "totalResults": 2} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-accounting-journal-entry: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalEntryId: "" + responses: + "200": + application/json: {"createdOn": "2022-04-19T00:00:00", "id": "770c89bb-3d6a-449a-9243-739378b4cd7d", "journalLines": [{"accountRef": {"id": "ff8fdc4c-2aad-4ec1-9430-6bd201832eb3", "name": "Undeposited Funds"}, "currency": "GBP", "description": "", "netAmount": 32095.91, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "3a872b81-d1af-4d31-9bfa-a37280b8f68c", "name": "VAT"}, "currency": "GBP", "description": "Tax for direct income c31a3778-e3ea-4d01-9281-dd2f291c8cb8", "netAmount": -2917.81, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "currency": "GBP", "description": "", "netAmount": -29178.09, "tracking": {"recordRefs": []}}], "journalRef": {"id": "90bb7784-083b-4bcb-a534-b30756cee65d", "name": "General Journal"}, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18Z", "postedOn": "2022-04-19T00:00:00", "recordRef": {"dataType": "directIncomes", "id": "c31a3778-e3ea-4d01-9281-dd2f291c8cb8"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "updatedOn": "2022-10-23T00:00:00Z"} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalEntryId: "" + responses: + "200": + application/json: {"createdOn": "2018-12-31T00:00:00", "id": "START", "journalLines": [{"accountRef": {"id": "ac1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Retained Earnings"}, "currency": "GBP", "description": "Opening Entry", "netAmount": -69723.14, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "aa1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Share Capital"}, "currency": "GBP", "description": "Opening Entry", "netAmount": -20000, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "8a1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Accounts Payable"}, "currency": "GBP", "description": "Opening Entry", "netAmount": -2329.42, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "6e1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Accumulated Depreciation"}, "currency": "GBP", "description": "Opening Entry", "netAmount": 3499, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "6c1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Equipment"}, "currency": "GBP", "description": "Opening Entry", "netAmount": 5498, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "6a1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Inventory"}, "currency": "GBP", "description": "Opening Entry", "netAmount": 28547.16, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "641217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Accounts Receivable"}, "currency": "GBP", "description": "Opening Entry", "netAmount": 31638.4, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "641217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Accounts Receivable"}, "currency": "GBP", "description": "Opening Entry", "netAmount": 2870, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "621217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Petty Cash"}, "currency": "GBP", "description": "Opening Entry", "netAmount": 20000, "tracking": {"recordRefs": []}}], "journalRef": {"id": "4caabc3e-3d64-ed11-8c34-000d3a870cba", "name": "DEFAULT"}, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:31Z", "postedOn": "2018-12-31T00:00:00", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2020-07-29T10:56:12Z", "updatedOn": "2022-10-23T00:00:00Z"} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalEntryId: "" + responses: + "200": + application/json: {"createdOn": "2022-01-11T14:18:54", "id": "00002c0a-8061-4ad2-84fa-c879eea880a7", "journalLines": [{"accountRef": {"id": "e0217fbf-8963-4134-80ef-929d5de8612d", "name": "Kosten 13e maand"}, "currency": "EUR", "description": "1 transactions of type CARD_PAYMENT_FEE_REFUND", "netAmount": -6.94, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "0166c96b-adf2-4667-a755-87e67c741f41", "name": "Resultaat verkoop activa"}, "currency": "EUR", "description": "1 transactions of type CARD_PAYMENT_FEE_REFUND", "netAmount": 6.94, "tracking": {"recordRefs": []}}], "journalRef": {"id": "55ff34a3-0857-4202-b7ec-a399cfc26a4e", "name": "Memoriaal"}, "modifiedDate": "2022-10-26T13:37:10Z", "postedOn": "2022-10-23T00:00:00Z", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2022-01-11T14:18:54Z", "updatedOn": "2022-01-11T14:18:54"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalEntryId: "" + responses: + "200": + application/json: {"createdOn": "2020-07-03T10:51:46", "id": "0008ef00-c5f8-4f97-bce9-5094b2f569dd", "journalLines": [{"accountRef": {"id": "45ae4323-c93b-48b1-8393-db54254e4e6c", "name": "VAT To Pay"}, "currency": "GBP", "netAmount": -9.1, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "43acd218-6a95-445f-994c-660273e0ced9", "name": "Sales"}, "currency": "GBP", "description": "6 service charges with 0.0% vat", "netAmount": -11.21, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "43acd218-6a95-445f-994c-660273e0ced9", "name": "Sales"}, "currency": "GBP", "description": "28.0 items with VatPercentage of 0.0", "netAmount": -308.61, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "febc52c4-a1ed-4000-b51a-76f9f525445d", "name": "Salary Control Account"}, "currency": "GBP", "description": "Gratuity", "netAmount": -25.87, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "45ae4323-c93b-48b1-8393-db54254e4e6c", "name": "VAT To Pay"}, "currency": "GBP", "netAmount": -47.14, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "43acd218-6a95-445f-994c-660273e0ced9", "name": "Sales"}, "currency": "GBP", "description": "19.0 items with VatPercentage of 20.0", "netAmount": -235.72, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "43acd218-6a95-445f-994c-660273e0ced9", "name": "Sales"}, "currency": "GBP", "description": "13.0 items with VatPercentage of 5.0", "netAmount": -182.06, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "febc52c4-a1ed-4000-b51a-76f9f525445d", "name": "Salary Control Account"}, "currency": "GBP", "description": "1.0 gift cards", "netAmount": -1, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "cf9572e7-8afa-4339-9113-af32a66d9df9", "name": "Trade Debtors"}, "currency": "GBP", "netAmount": 820.71, "tracking": {"recordRefs": []}}], "journalRef": {"id": "ed5068ff-cb0e-4edd-9777-36ac94a5d6f0", "name": "Sales journal"}, "modifiedDate": "2022-10-26T13:35:45Z", "postedOn": "2022-10-23T00:00:00Z", "recordRef": {"dataType": "invoices", "id": "0008ef00-c5f8-4f97-bce9-5094b2f569dd"}, "sourceModifiedDate": "2020-07-03T10:51:46Z", "updatedOn": "2020-07-03T10:51:46"} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalEntryId: "" + responses: + "200": + application/json: {"createdOn": "1987-10-01T00:00:00", "id": "24389149", "journalLines": [{"accountRef": {"id": "128611", "name": "Accounts Receivable"}, "currency": "GBP", "description": "", "netAmount": 222.88, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "128613", "name": "Sales"}, "currency": "GBP", "description": "Creative Writing Editorial", "netAmount": -222.88, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "128613", "name": "Sales"}, "currency": "GBP", "description": "", "netAmount": 0, "tracking": {"recordRefs": []}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:38Z", "postedOn": "1987-10-01T00:00:00", "recordRef": {"dataType": "invoices", "id": "2596455"}, "sourceModifiedDate": "1987-10-01T00:00:00", "updatedOn": "1987-10-01T00:00:00"} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalEntryId: "" + responses: + "200": + application/json: {"createdOn": "2021-03-26T10:31:05", "id": "112", "journalLines": [{"accountRef": {"id": "825", "name": "Codat Europe Bank"}, "currency": "GBP", "netAmount": -120, "tracking": {"recordRefs": [{"dataType": "trackingCategories", "id": "location-4"}, {"dataType": "suppliers", "id": "724"}]}}, {"accountRef": {"id": "111", "name": "Accounts Payable"}, "currency": "GBP", "netAmount": 120, "tracking": {"recordRefs": [{"dataType": "trackingCategories", "id": "location-4"}, {"dataType": "suppliers", "id": "724"}]}}], "modifiedDate": "2023-01-30T14:49:07Z", "postedOn": "2021-03-26T00:00:00", "recordRef": {"dataType": "billPayments", "id": "112"}, "sourceModifiedDate": "2021-03-26T10:31:06", "updatedOn": "2021-03-26T10:31:06"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalEntryId: "" + responses: + "200": + application/json: {"createdOn": "2022-11-28T00:00:00", "id": "2453-1071526256", "journalLines": [{"accountRef": {"id": "40000-933270541", "name": "Accounts Receivable"}, "currency": "GBP", "description": "", "netAmount": 431.95, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "190000-933270541", "name": "Labor Income"}, "currency": "GBP", "description": "Foundation slab - prep and pouring", "netAmount": -167.5, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "100000-933270541", "name": "Sales Tax Payable"}, "currency": "GBP", "description": "CA sales tax, San Domingo County", "netAmount": -18.45, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1A0000-933270542", "name": "Materials Income"}, "currency": "GBP", "description": "Rough lumber", "netAmount": -48, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1A0000-933270542", "name": "Materials Income"}, "currency": "GBP", "description": "Trim lumber", "netAmount": -38, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1A0000-933270542", "name": "Materials Income"}, "currency": "GBP", "description": "Window", "netAmount": -50, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1A0000-933270542", "name": "Materials Income"}, "currency": "GBP", "description": "Flooring", "netAmount": -50, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1A0000-933270542", "name": "Materials Income"}, "currency": "GBP", "description": "Window", "netAmount": -60, "tracking": {"recordRefs": []}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:11:56Z", "postedOn": "2022-11-28T00:00:00", "recordRef": {"dataType": "invoices", "id": "2453-1071526256"}, "sourceModifiedDate": "2023-12-16T05:04:21", "updatedOn": "2022-10-23T00:00:00Z"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalEntryId: "" + responses: + "200": + application/json: {"createdOn": "2018-09-21T00:00:00", "id": "1", "journalLines": [{"accountRef": {"id": "61", "name": "Dave PP Current"}, "currency": "GBP", "description": "Opening Balance from Bank", "netAmount": 170.23, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "53", "name": "Retained profit balance forward account"}, "currency": "GBP", "description": "", "netAmount": -170.23, "tracking": {"recordRefs": []}}], "modifiedDate": "2023-01-18T11:03:25Z", "postedOn": "2018-09-21T00:00:00", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2018-12-17T14:56:20Z", "updatedOn": "2022-10-23T00:00:00Z"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalEntryId: "" + responses: + "200": + application/json: {"createdOn": "2015-02-23T00:00:00", "id": "12", "journalLines": [{"accountRef": {"id": "55", "name": "Opening Balance Equity"}, "currency": "GBP", "description": "Opening stock for Guest Book", "netAmount": 0, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "65", "name": "Stock Asset"}, "currency": "GBP", "description": "Opening stock for Guest Book", "netAmount": 0, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "65", "name": "Stock Asset"}, "currency": "GBP", "description": "Opening stock for Guest Book", "netAmount": 250, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "55", "name": "Opening Balance Equity"}, "currency": "GBP", "description": "Opening stock for Guest Book", "netAmount": -250, "tracking": {"recordRefs": []}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:42Z", "postedOn": "2015-02-23T00:00:00", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2016-09-12T16:02:02Z", "updatedOn": "2022-10-23T00:00:00Z"} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalEntryId: "" + responses: + "200": + application/json: {"createdOn": "2010-04-27T17:16:57", "description": "Opening Stock", "id": "88", "journalLines": [{"accountRef": {"id": "1001", "name": "Stock"}, "currency": "GBP", "description": "Opening Stock", "netAmount": -40710, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "5200", "name": "Opening Stock"}, "currency": "GBP", "description": "Opening Stock", "netAmount": 40710, "tracking": {"recordRefs": []}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:38Z", "postedOn": "2021-01-01T00:00:00", "recordRef": {"dataType": "journalEntries", "id": "88"}, "sourceModifiedDate": "2022-11-25T09:43:54", "updatedOn": "2022-10-23T00:00:00Z"} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalEntryId: "" + responses: + "200": + application/json: {"createdOn": "2017-05-08T11:08:39", "id": "b0489c4b33de11e797950a57719b2edb", "journalLines": [{"accountRef": {"id": "9a9931b4267a11e797950a57719b2edb", "name": "VAT on Sales - Holding Account"}, "currency": "GBP", "description": "Consulting services", "netAmount": 1440, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "9a994b92267a11e797950a57719b2edb", "name": "Sales Type A"}, "currency": "GBP", "description": "Consulting services", "netAmount": 7200, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "9a991c56267a11e797950a57719b2edb", "name": "Trade Debtors"}, "currency": "GBP", "netAmount": -8640, "tracking": {"recordRefs": []}}], "modifiedDate": "2022-10-24T15:31:26Z", "postedOn": "2017-05-08T11:08:39", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2017-05-08T11:08:39Z", "updatedOn": "2017-05-08T11:08:39"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalEntryId: "" + responses: + "200": + application/json: {"createdOn": "2021-04-22T10:44:27", "description": "Invoices - 1100: 2021/04/22 03:44:26:7042 Batch Summary Entry", "id": "262177", "journalLines": [{"accountRef": {"id": "176", "name": "Revenue - Services"}, "currency": "GBP", "description": "", "netAmount": -100, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "306", "name": "Sales Tax Payable"}, "currency": "GBP", "description": "", "netAmount": -20, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "2", "name": "Accounts Receivable"}, "currency": "GBP", "description": "", "netAmount": 120, "tracking": {"recordRefs": []}}], "journalRef": {"id": "1", "name": "Accounts Receivable Journal"}, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:37Z", "postedOn": "2021-04-22T00:00:00", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2021-04-22T10:44:27", "updatedOn": "2021-04-22T10:44:27"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalEntryId: "" + responses: + "200": + application/json: {"createdOn": "2023-02-17T21:07:12", "id": "033d79c7-565b-419a-9e1b-33ab58efcf3d", "journalLines": [{"accountRef": {"id": "e0faa299-ca0d-4b0a-9e32-0dfabdf9179a", "name": "Accounts Payable"}, "currency": "GBP", "description": "", "netAmount": -7267.2, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10", "name": "Consulting"}, "currency": "GBP", "description": "Half day training - Microsoft Office", "netAmount": 1800, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce", "name": "General Expenses"}, "currency": "GBP", "description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "netAmount": 4000, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a", "name": "Printing & Stationery"}, "currency": "GBP", "description": "Stationery charges", "netAmount": 256, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "b12f79b9-a082-4b8b-971e-d321292943c7", "name": "VAT"}, "currency": "GBP", "description": "", "netAmount": 1211.2, "tracking": {"recordRefs": []}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:37:09Z", "postedOn": "2021-11-19T00:00:00", "recordRef": {"dataType": "bills", "id": "3945273c-cc04-479f-a4b5-1e3dc7a55ed1"}, "sourceModifiedDate": "2023-02-17T21:07:12", "updatedOn": "2022-10-23T00:00:00Z"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalEntryId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounting-journal-entries: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/journalEntries?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/journalEntries?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/journalEntries"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2022-04-19T00:00:00", "id": "770c89bb-3d6a-449a-9243-739378b4cd7d", "journalLines": [{"accountRef": {"id": "ff8fdc4c-2aad-4ec1-9430-6bd201832eb3", "name": "Undeposited Funds"}, "currency": "GBP", "description": "", "netAmount": 32095.91, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "3a872b81-d1af-4d31-9bfa-a37280b8f68c", "name": "VAT"}, "currency": "GBP", "description": "Tax for direct income c31a3778-e3ea-4d01-9281-dd2f291c8cb8", "netAmount": -2917.81, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "currency": "GBP", "description": "", "netAmount": -29178.09, "tracking": {"recordRefs": []}}], "journalRef": {"id": "90bb7784-083b-4bcb-a534-b30756cee65d", "name": "General Journal"}, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18Z", "postedOn": "2022-04-19T00:00:00", "recordRef": {"dataType": "directIncomes", "id": "c31a3778-e3ea-4d01-9281-dd2f291c8cb8"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "updatedOn": "2022-10-23T00:00:00Z"}, {"createdOn": "2022-04-19T00:00:00", "id": "9f96606f-6846-40c6-b423-9b1753458e75", "journalLines": [{"accountRef": {"id": "ff8fdc4c-2aad-4ec1-9430-6bd201832eb3", "name": "Undeposited Funds"}, "currency": "GBP", "description": "", "netAmount": 188.33, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "3a872b81-d1af-4d31-9bfa-a37280b8f68c", "name": "VAT"}, "currency": "GBP", "description": "Tax for direct income 38e8c917-0afc-4583-8ffe-1b53ad601197", "netAmount": -17.12, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "currency": "GBP", "description": "", "netAmount": -171.21, "tracking": {"recordRefs": []}}], "journalRef": {"id": "90bb7784-083b-4bcb-a534-b30756cee65d", "name": "General Journal"}, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18Z", "postedOn": "2022-04-19T00:00:00", "recordRef": {"dataType": "directIncomes", "id": "38e8c917-0afc-4583-8ffe-1b53ad601197"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "updatedOn": "2022-10-23T00:00:00Z"}], "totalResults": 1862} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/journalEntries?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/journalEntries?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/journalEntries"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2018-12-31T00:00:00", "id": "START", "journalLines": [{"accountRef": {"id": "ac1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Retained Earnings"}, "currency": "GBP", "description": "Opening Entry", "netAmount": -69723.14, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "aa1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Share Capital"}, "currency": "GBP", "description": "Opening Entry", "netAmount": -20000, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "8a1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Accounts Payable"}, "currency": "GBP", "description": "Opening Entry", "netAmount": -2329.42, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "6e1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Accumulated Depreciation"}, "currency": "GBP", "description": "Opening Entry", "netAmount": 3499, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "6c1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Equipment"}, "currency": "GBP", "description": "Opening Entry", "netAmount": 5498, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "6a1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Inventory"}, "currency": "GBP", "description": "Opening Entry", "netAmount": 28547.16, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "641217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Accounts Receivable"}, "currency": "GBP", "description": "Opening Entry", "netAmount": 31638.4, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "641217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Accounts Receivable"}, "currency": "GBP", "description": "Opening Entry", "netAmount": 2870, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "621217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Petty Cash"}, "currency": "GBP", "description": "Opening Entry", "netAmount": 20000, "tracking": {"recordRefs": []}}], "journalRef": {"id": "4caabc3e-3d64-ed11-8c34-000d3a870cba", "name": "DEFAULT"}, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:31Z", "postedOn": "2018-12-31T00:00:00", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2020-07-29T10:56:12Z", "updatedOn": "2022-10-23T00:00:00Z"}, {"createdOn": "2019-01-01T00:00:00", "id": "01-2019", "journalLines": [{"accountRef": {"id": "5e1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Checking account"}, "currency": "GBP", "description": "January 2019", "netAmount": -2000, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "401217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Salaries Expense"}, "currency": "GBP", "description": "January 2019", "netAmount": 1000, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "341217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Rent Expense"}, "currency": "GBP", "description": "January 2019", "netAmount": 1000, "tracking": {"recordRefs": []}}], "journalRef": {"id": "4caabc3e-3d64-ed11-8c34-000d3a870cba", "name": "DEFAULT"}, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:31Z", "postedOn": "2019-01-01T00:00:00", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2020-07-29T10:56:12Z", "updatedOn": "2022-10-23T00:00:00Z"}], "totalResults": 825} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/journalEntries?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/journalEntries?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/journalEntries"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2022-01-11T14:18:54", "id": "00002c0a-8061-4ad2-84fa-c879eea880a7", "journalLines": [{"accountRef": {"id": "e0217fbf-8963-4134-80ef-929d5de8612d", "name": "Kosten 13e maand"}, "currency": "EUR", "description": "1 transactions of type CARD_PAYMENT_FEE_REFUND", "netAmount": -6.94, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "0166c96b-adf2-4667-a755-87e67c741f41", "name": "Resultaat verkoop activa"}, "currency": "EUR", "description": "1 transactions of type CARD_PAYMENT_FEE_REFUND", "netAmount": 6.94, "tracking": {"recordRefs": []}}], "journalRef": {"id": "55ff34a3-0857-4202-b7ec-a399cfc26a4e", "name": "Memoriaal"}, "modifiedDate": "2022-10-26T13:37:10Z", "postedOn": "2022-10-23T00:00:00Z", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2022-01-11T14:18:54Z", "updatedOn": "2022-01-11T14:18:54"}, {"createdOn": "2020-04-22T13:56:46", "id": "000154f0-e83a-4012-96a3-7db0b036b96b", "journalLines": [{"accountRef": {"id": "0741cc89-e33a-4358-bcbd-3acb07b005dc", "name": "Nominal Card"}, "currency": "EUR", "description": "Refunds with payment type of Cash", "netAmount": -144.36, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "ef2fde36-4416-4bc5-b239-315b2929348c", "name": "Debiteuren"}, "currency": "EUR", "description": "Refunds with payment type of Cash", "netAmount": 144.36, "tracking": {"recordRefs": []}}], "journalRef": {"id": "151313ae-55b1-4ba0-b32a-e2ef6a8ce52a", "name": "Nominal Card"}, "modifiedDate": "2022-10-26T13:37:08Z", "postedOn": "2022-10-23T00:00:00Z", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2020-04-22T13:56:46Z", "updatedOn": "2020-04-22T13:56:46"}], "totalResults": 35972} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/journalEntries?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/journalEntries?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/journalEntries"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2020-07-03T10:51:46", "id": "0008ef00-c5f8-4f97-bce9-5094b2f569dd", "journalLines": [{"accountRef": {"id": "45ae4323-c93b-48b1-8393-db54254e4e6c", "name": "VAT To Pay"}, "currency": "GBP", "netAmount": -9.1, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "43acd218-6a95-445f-994c-660273e0ced9", "name": "Sales"}, "currency": "GBP", "description": "6 service charges with 0.0% vat", "netAmount": -11.21, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "43acd218-6a95-445f-994c-660273e0ced9", "name": "Sales"}, "currency": "GBP", "description": "28.0 items with VatPercentage of 0.0", "netAmount": -308.61, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "febc52c4-a1ed-4000-b51a-76f9f525445d", "name": "Salary Control Account"}, "currency": "GBP", "description": "Gratuity", "netAmount": -25.87, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "45ae4323-c93b-48b1-8393-db54254e4e6c", "name": "VAT To Pay"}, "currency": "GBP", "netAmount": -47.14, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "43acd218-6a95-445f-994c-660273e0ced9", "name": "Sales"}, "currency": "GBP", "description": "19.0 items with VatPercentage of 20.0", "netAmount": -235.72, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "43acd218-6a95-445f-994c-660273e0ced9", "name": "Sales"}, "currency": "GBP", "description": "13.0 items with VatPercentage of 5.0", "netAmount": -182.06, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "febc52c4-a1ed-4000-b51a-76f9f525445d", "name": "Salary Control Account"}, "currency": "GBP", "description": "1.0 gift cards", "netAmount": -1, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "cf9572e7-8afa-4339-9113-af32a66d9df9", "name": "Trade Debtors"}, "currency": "GBP", "netAmount": 820.71, "tracking": {"recordRefs": []}}], "journalRef": {"id": "ed5068ff-cb0e-4edd-9777-36ac94a5d6f0", "name": "Sales journal"}, "modifiedDate": "2022-10-26T13:35:45Z", "postedOn": "2022-10-23T00:00:00Z", "recordRef": {"dataType": "invoices", "id": "0008ef00-c5f8-4f97-bce9-5094b2f569dd"}, "sourceModifiedDate": "2020-07-03T10:51:46Z", "updatedOn": "2020-07-03T10:51:46"}, {"createdOn": "2021-07-30T18:02:23", "id": "001a8d63-2d5b-4b00-b17f-894108b6ce81", "journalLines": [{"accountRef": {"id": "cf9572e7-8afa-4339-9113-af32a66d9df9", "name": "Trade Debtors"}, "currency": "GBP", "netAmount": 1038.01, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "cc0ab812-d89a-452b-88a8-61666a0f0211", "name": "Accruals"}, "currency": "GBP", "description": "1.0 gift cards", "netAmount": -1, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "45ae4323-c93b-48b1-8393-db54254e4e6c", "name": "VAT To Pay"}, "currency": "GBP", "netAmount": -19.29, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "45ae4323-c93b-48b1-8393-db54254e4e6c", "name": "VAT To Pay"}, "currency": "GBP", "netAmount": -60.82, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "ba7d27d1-72cf-411b-8ef3-55ca4b13dac3", "name": "Sundry Non-Operating Expenses"}, "currency": "GBP", "description": "15.0 items with VatPercentage of 0.0", "netAmount": -248.28, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "8f27a6b8-101d-4613-a059-2b462fb01b2f", "name": "anna_test_prod"}, "currency": "GBP", "description": "Gratuity", "netAmount": -8.97, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "ba7d27d1-72cf-411b-8ef3-55ca4b13dac3", "name": "Sundry Non-Operating Expenses"}, "currency": "GBP", "description": "28.0 items with VatPercentage of 5.0", "netAmount": -385.7, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "ba7d27d1-72cf-411b-8ef3-55ca4b13dac3", "name": "Sundry Non-Operating Expenses"}, "currency": "GBP", "description": "2 service charges with 0.0% vat", "netAmount": -9.85, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "ba7d27d1-72cf-411b-8ef3-55ca4b13dac3", "name": "Sundry Non-Operating Expenses"}, "currency": "GBP", "description": "27.0 items with VatPercentage of 20.0", "netAmount": -304.1, "tracking": {"recordRefs": []}}], "journalRef": {"id": "ed5068ff-cb0e-4edd-9777-36ac94a5d6f0", "name": "Sales journal"}, "modifiedDate": "2022-10-26T13:35:45Z", "postedOn": "2022-10-23T00:00:00Z", "recordRef": {"dataType": "invoices", "id": "001a8d63-2d5b-4b00-b17f-894108b6ce81"}, "sourceModifiedDate": "2021-07-30T18:02:23Z", "updatedOn": "2021-07-30T18:02:23"}], "totalResults": 6785} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/journalEntries?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/journalEntries?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/journalEntries"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "1987-10-01T00:00:00", "id": "24389149", "journalLines": [{"accountRef": {"id": "128611", "name": "Accounts Receivable"}, "currency": "GBP", "description": "", "netAmount": 222.88, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "128613", "name": "Sales"}, "currency": "GBP", "description": "Creative Writing Editorial", "netAmount": -222.88, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "128613", "name": "Sales"}, "currency": "GBP", "description": "", "netAmount": 0, "tracking": {"recordRefs": []}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:38Z", "postedOn": "1987-10-01T00:00:00", "recordRef": {"dataType": "invoices", "id": "2596455"}, "sourceModifiedDate": "1987-10-01T00:00:00", "updatedOn": "1987-10-01T00:00:00"}, {"createdOn": "1987-10-01T00:00:00", "id": "24389396", "journalLines": [{"accountRef": {"id": "128611", "name": "Accounts Receivable"}, "currency": "GBP", "description": "", "netAmount": -222.88, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "128613", "name": "Sales"}, "currency": "GBP", "description": "Creative Writing Editorial", "netAmount": 222.88, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "128613", "name": "Sales"}, "currency": "GBP", "description": "", "netAmount": 0, "tracking": {"recordRefs": []}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:38Z", "postedOn": "1987-10-01T00:00:00", "recordRef": {"dataType": "invoices", "id": "2596455"}, "sourceModifiedDate": "1987-10-01T00:00:00", "updatedOn": "1987-10-01T00:00:00"}], "totalResults": 734} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/journalEntries?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/journalEntries?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/journalEntries"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2021-03-26T10:31:05", "id": "112", "journalLines": [{"accountRef": {"id": "825", "name": "Codat Europe Bank"}, "currency": "GBP", "netAmount": -120, "tracking": {"recordRefs": [{"dataType": "trackingCategories", "id": "location-4"}, {"dataType": "suppliers", "id": "724"}]}}, {"accountRef": {"id": "111", "name": "Accounts Payable"}, "currency": "GBP", "netAmount": 120, "tracking": {"recordRefs": [{"dataType": "trackingCategories", "id": "location-4"}, {"dataType": "suppliers", "id": "724"}]}}], "modifiedDate": "2023-01-30T14:49:07Z", "postedOn": "2021-03-26T00:00:00", "recordRef": {"dataType": "billPayments", "id": "112"}, "sourceModifiedDate": "2021-03-26T10:31:06", "updatedOn": "2021-03-26T10:31:06"}, {"createdOn": "2021-03-26T10:02:18", "id": "7", "journalLines": [{"accountRef": {"id": "111", "name": "Accounts Payable"}, "currency": "GBP", "netAmount": -144, "tracking": {"recordRefs": [{"dataType": "suppliers", "id": "724"}]}}, {"accountRef": {"id": "716", "name": "Inventory In Transit"}, "currency": "GBP", "netAmount": 120, "tracking": {"recordRefs": [{"dataType": "trackingCategories", "id": "location-4"}]}}, {"accountRef": {"id": "211", "name": "VAT on Purchases"}, "currency": "GBP", "description": "VAT", "netAmount": 24, "tracking": {"recordRefs": [{"dataType": "suppliers", "id": "713"}]}}], "modifiedDate": "2023-01-30T14:49:07Z", "postedOn": "2021-03-26T00:00:00", "recordRef": {"dataType": "bills", "id": "7"}, "sourceModifiedDate": "2022-07-05T13:38:10", "updatedOn": "2022-07-05T13:38:10"}], "totalResults": 11} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journalEntries?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journalEntries?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journalEntries"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2022-11-28T00:00:00", "id": "2453-1071526256", "journalLines": [{"accountRef": {"id": "40000-933270541", "name": "Accounts Receivable"}, "currency": "GBP", "description": "", "netAmount": 431.95, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "190000-933270541", "name": "Labor Income"}, "currency": "GBP", "description": "Foundation slab - prep and pouring", "netAmount": -167.5, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "100000-933270541", "name": "Sales Tax Payable"}, "currency": "GBP", "description": "CA sales tax, San Domingo County", "netAmount": -18.45, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1A0000-933270542", "name": "Materials Income"}, "currency": "GBP", "description": "Rough lumber", "netAmount": -48, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1A0000-933270542", "name": "Materials Income"}, "currency": "GBP", "description": "Trim lumber", "netAmount": -38, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1A0000-933270542", "name": "Materials Income"}, "currency": "GBP", "description": "Window", "netAmount": -50, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1A0000-933270542", "name": "Materials Income"}, "currency": "GBP", "description": "Flooring", "netAmount": -50, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1A0000-933270542", "name": "Materials Income"}, "currency": "GBP", "description": "Window", "netAmount": -60, "tracking": {"recordRefs": []}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:11:56Z", "postedOn": "2022-11-28T00:00:00", "recordRef": {"dataType": "invoices", "id": "2453-1071526256"}, "sourceModifiedDate": "2023-12-16T05:04:21", "updatedOn": "2022-10-23T00:00:00Z"}, {"createdOn": "2022-11-30T00:00:00", "id": "469E-1071530054", "journalLines": [{"accountRef": {"id": "40000-933270541", "name": "Accounts Receivable"}, "currency": "GBP", "description": "", "netAmount": 14488.64, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "190000-933270541", "name": "Labor Income"}, "currency": "GBP", "description": "Installation labor", "netAmount": -45.5, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1C0000-933270542", "name": "Subcontracted Labor Income"}, "currency": "GBP", "description": "Install drywall", "netAmount": -1320, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1C0000-933270542", "name": "Subcontracted Labor Income"}, "currency": "GBP", "description": "Electrical work", "netAmount": -1650, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1C0000-933270542", "name": "Subcontracted Labor Income"}, "currency": "GBP", "description": "Metal Work", "netAmount": -660, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1C0000-933270542", "name": "Subcontracted Labor Income"}, "currency": "GBP", "description": "Install insulation", "netAmount": -1100, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1C0000-933270542", "name": "Subcontracted Labor Income"}, "currency": "GBP", "description": "Plumbing", "netAmount": -1650, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1C0000-933270542", "name": "Subcontracted Labor Income"}, "currency": "GBP", "description": "Painting", "netAmount": -2420, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1C0000-933270542", "name": "Subcontracted Labor Income"}, "currency": "GBP", "description": "Install carpeting", "netAmount": -3300, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1A0000-933270542", "name": "Materials Income"}, "currency": "GBP", "description": "Custom Bay Window", "netAmount": -1925, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "1A0000-933270542", "name": "Materials Income"}, "currency": "GBP", "description": "Window", "netAmount": -115.5, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "190000-933270541", "name": "Labor Income"}, "currency": "GBP", "description": "Equipment Rental", "netAmount": -700, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "70000-933270541", "name": "Retainage Receivable"}, "currency": "GBP", "description": "10% retainage to be billed after job is complete and approved.", "netAmount": 555.5, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "100000-933270541", "name": "Sales Tax Payable"}, "currency": "GBP", "description": "CA sales tax, San Tomas County", "netAmount": -158.14, "tracking": {"recordRefs": []}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:11:56Z", "postedOn": "2022-11-30T00:00:00", "recordRef": {"dataType": "invoices", "id": "469E-1071530054"}, "sourceModifiedDate": "2023-12-16T05:05:41", "updatedOn": "2022-10-23T00:00:00Z"}], "totalResults": 140} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/journalEntries?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/journalEntries?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/journalEntries"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2018-09-21T00:00:00", "id": "1", "journalLines": [{"accountRef": {"id": "61", "name": "Dave PP Current"}, "currency": "GBP", "description": "Opening Balance from Bank", "netAmount": 170.23, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "53", "name": "Retained profit balance forward account"}, "currency": "GBP", "description": "", "netAmount": -170.23, "tracking": {"recordRefs": []}}], "modifiedDate": "2023-01-18T11:03:25Z", "postedOn": "2018-09-21T00:00:00", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2018-12-17T14:56:20Z", "updatedOn": "2022-10-23T00:00:00Z"}, {"createdOn": "2018-09-21T00:00:00", "id": "15", "journalLines": [{"accountRef": {"id": "61", "name": "Dave PP Current"}, "currency": "GBP", "description": "Payment to Google", "netAmount": -1.59, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "37", "name": "Computer equipment accumulated depreciation brought forward"}, "currency": "GBP", "description": "Payment to Google", "netAmount": 1.59, "tracking": {"recordRefs": []}}], "modifiedDate": "2023-01-18T11:03:25Z", "postedOn": "2018-09-21T00:00:00", "recordRef": {"dataType": "directCosts", "id": "PUR-15"}, "sourceModifiedDate": "2018-12-17T14:56:44Z", "updatedOn": "2022-10-23T00:00:00Z"}], "totalResults": 9405} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/journalEntries?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/journalEntries?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/journalEntries"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2015-02-23T00:00:00", "id": "12", "journalLines": [{"accountRef": {"id": "55", "name": "Opening Balance Equity"}, "currency": "GBP", "description": "Opening stock for Guest Book", "netAmount": 0, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "65", "name": "Stock Asset"}, "currency": "GBP", "description": "Opening stock for Guest Book", "netAmount": 0, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "65", "name": "Stock Asset"}, "currency": "GBP", "description": "Opening stock for Guest Book", "netAmount": 250, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "55", "name": "Opening Balance Equity"}, "currency": "GBP", "description": "Opening stock for Guest Book", "netAmount": -250, "tracking": {"recordRefs": []}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:42Z", "postedOn": "2015-02-23T00:00:00", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2016-09-12T16:02:02Z", "updatedOn": "2022-10-23T00:00:00Z"}, {"createdOn": "2015-02-23T00:00:00", "id": "13", "journalLines": [{"accountRef": {"id": "55", "name": "Opening Balance Equity"}, "currency": "GBP", "description": "Opening stock for Name Badges", "netAmount": 0, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "65", "name": "Stock Asset"}, "currency": "GBP", "description": "Opening stock for Name Badges", "netAmount": 0, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "65", "name": "Stock Asset"}, "currency": "GBP", "description": "Opening stock for Name Badges", "netAmount": 7500, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "55", "name": "Opening Balance Equity"}, "currency": "GBP", "description": "Opening stock for Name Badges", "netAmount": -7500, "tracking": {"recordRefs": []}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:42Z", "postedOn": "2015-02-23T00:00:00", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2016-09-12T16:02:04Z", "updatedOn": "2022-10-23T00:00:00Z"}], "totalResults": 9190} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/journalEntries?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/journalEntries?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/journalEntries"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2010-04-27T17:16:57", "description": "Opening Stock", "id": "88", "journalLines": [{"accountRef": {"id": "1001", "name": "Stock"}, "currency": "GBP", "description": "Opening Stock", "netAmount": -40710, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "5200", "name": "Opening Stock"}, "currency": "GBP", "description": "Opening Stock", "netAmount": 40710, "tracking": {"recordRefs": []}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:38Z", "postedOn": "2021-01-01T00:00:00", "recordRef": {"dataType": "journalEntries", "id": "88"}, "sourceModifiedDate": "2022-11-25T09:43:54", "updatedOn": "2022-10-23T00:00:00Z"}, {"createdOn": "2010-04-27T17:16:57", "description": "Goods", "id": "92", "journalLines": [{"accountRef": {"id": "2100", "name": "Creditors Control Account"}, "currency": "GBP", "description": "Goods/Services - Goods", "netAmount": -5875, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "5000", "name": "Materials Purchased"}, "currency": "GBP", "description": "Goods/Services - Goods", "netAmount": 5000, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "2201", "name": "Purchase Tax Control Account"}, "currency": "GBP", "description": "Goods/Services - Goods", "netAmount": 875, "tracking": {"recordRefs": []}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:38Z", "postedOn": "2021-01-01T00:00:00", "recordRef": {"dataType": "bills", "id": "92"}, "sourceModifiedDate": "2022-11-25T09:43:54", "updatedOn": "2022-10-23T00:00:00Z"}], "totalResults": 1119} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/journalEntries?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/journalEntries?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/journalEntries"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2017-05-08T11:08:39", "id": "b0489c4b33de11e797950a57719b2edb", "journalLines": [{"accountRef": {"id": "9a9931b4267a11e797950a57719b2edb", "name": "VAT on Sales - Holding Account"}, "currency": "GBP", "description": "Consulting services", "netAmount": 1440, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "9a994b92267a11e797950a57719b2edb", "name": "Sales Type A"}, "currency": "GBP", "description": "Consulting services", "netAmount": 7200, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "9a991c56267a11e797950a57719b2edb", "name": "Trade Debtors"}, "currency": "GBP", "netAmount": -8640, "tracking": {"recordRefs": []}}], "modifiedDate": "2022-10-24T15:31:26Z", "postedOn": "2017-05-08T11:08:39", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2017-05-08T11:08:39Z", "updatedOn": "2017-05-08T11:08:39"}, {"createdOn": "2017-05-08T11:09:09", "id": "c23efa4233de11e797950a57719b2edb", "journalLines": [{"accountRef": {"id": "9a991c56267a11e797950a57719b2edb", "name": "Trade Debtors"}, "currency": "GBP", "netAmount": 1080, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "9a9931b4267a11e797950a57719b2edb", "name": "VAT on Sales - Holding Account"}, "currency": "GBP", "description": "Consulting services", "netAmount": -180, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "9a994b92267a11e797950a57719b2edb", "name": "Sales Type A"}, "currency": "GBP", "description": "Consulting services", "netAmount": -900, "tracking": {"recordRefs": []}}], "modifiedDate": "2022-10-24T15:31:26Z", "postedOn": "2017-05-08T11:09:09", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2017-05-08T11:09:09Z", "updatedOn": "2017-05-08T11:09:09"}], "totalResults": 24386} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/journalEntries?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/journalEntries?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/journalEntries"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2021-04-22T10:44:27", "description": "Invoices - 1100: 2021/04/22 03:44:26:7042 Batch Summary Entry", "id": "262177", "journalLines": [{"accountRef": {"id": "176", "name": "Revenue - Services"}, "currency": "GBP", "description": "", "netAmount": -100, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "306", "name": "Sales Tax Payable"}, "currency": "GBP", "description": "", "netAmount": -20, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "2", "name": "Accounts Receivable"}, "currency": "GBP", "description": "", "netAmount": 120, "tracking": {"recordRefs": []}}], "journalRef": {"id": "1", "name": "Accounts Receivable Journal"}, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:37Z", "postedOn": "2021-04-22T00:00:00", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2021-04-22T10:44:27", "updatedOn": "2021-04-22T10:44:27"}, {"createdOn": "2021-04-22T11:01:11", "description": "Receipts(Bank-501_CHK) - 1100: April 2021 Batch Summary Entry", "id": "262179", "journalLines": [{"accountRef": {"id": "2", "name": "Accounts Receivable"}, "currency": "GBP", "description": "", "netAmount": -120, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "description": "", "netAmount": 120, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "description": "", "netAmount": 150, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "179", "name": "Revenue - Other"}, "currency": "GBP", "description": "", "netAmount": -150, "tracking": {"recordRefs": []}}], "journalRef": {"id": "7", "name": "Cash Receipts Journal"}, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:37Z", "postedOn": "2021-04-30T00:00:00", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2022-04-19T13:38:45", "updatedOn": "2022-04-19T13:38:45"}], "totalResults": 21} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/journalEntries?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/journalEntries?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/journalEntries"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2023-02-17T21:07:12", "id": "033d79c7-565b-419a-9e1b-33ab58efcf3d", "journalLines": [{"accountRef": {"id": "e0faa299-ca0d-4b0a-9e32-0dfabdf9179a", "name": "Accounts Payable"}, "currency": "GBP", "description": "", "netAmount": -7267.2, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10", "name": "Consulting"}, "currency": "GBP", "description": "Half day training - Microsoft Office", "netAmount": 1800, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce", "name": "General Expenses"}, "currency": "GBP", "description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "netAmount": 4000, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a", "name": "Printing & Stationery"}, "currency": "GBP", "description": "Stationery charges", "netAmount": 256, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "b12f79b9-a082-4b8b-971e-d321292943c7", "name": "VAT"}, "currency": "GBP", "description": "", "netAmount": 1211.2, "tracking": {"recordRefs": []}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:37:09Z", "postedOn": "2021-11-19T00:00:00", "recordRef": {"dataType": "bills", "id": "3945273c-cc04-479f-a4b5-1e3dc7a55ed1"}, "sourceModifiedDate": "2023-02-17T21:07:12", "updatedOn": "2022-10-23T00:00:00Z"}, {"createdOn": "2023-02-17T21:07:23", "id": "98ac5060-c9ed-4359-bcd5-711e649e7899", "journalLines": [{"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "description": "", "netAmount": -7267.2, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "e0faa299-ca0d-4b0a-9e32-0dfabdf9179a", "name": "Accounts Payable"}, "currency": "GBP", "description": "", "netAmount": 7267.2, "tracking": {"recordRefs": []}}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:37:09Z", "postedOn": "2021-12-20T00:00:00", "recordRef": {"dataType": "billPayments", "id": "74004690-82a1-4810-aaca-6ce575af94b4"}, "sourceModifiedDate": "2023-02-17T21:07:23", "updatedOn": "2022-10-23T00:00:00Z"}], "totalResults": 290} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-accounting-journal: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalId: "" + responses: + "200": + application/json: {"createdOn": "2021-12-11T13:04:02", "hasChildren": true, "id": "90bb7784-083b-4bcb-a534-b30756cee65d", "journalCode": "GJ", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18Z", "name": "General Journal", "sourceModifiedDate": "2022-07-15T20:19:02", "status": "Active", "type": "General Journal"} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalId: "" + responses: + "200": + application/json: {"createdOn": "2022-10-23T00:00:00Z", "hasChildren": true, "id": "211317b3-89d1-ea11-bbaa-000d3a2b9185", "journalCode": "ASSETS", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "name": "ASSETS", "sourceModifiedDate": "2023-02-02T10:26:25Z", "status": "Active", "type": "Assets"} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalId: "" + responses: + "200": + application/json: {"createdOn": "2019-11-05T14:44:51", "hasChildren": false, "id": "aae31284-e23d-456b-9957-fbf4bcef6c19", "journalCode": "21", "modifiedDate": "2022-10-26T13:31:58Z", "name": "12345678", "sourceModifiedDate": "2020-01-24T11:41:25Z", "status": "Active", "type": "Bank"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalId: "" + responses: + "200": + application/json: {"createdOn": "2021-04-26T16:44:47", "hasChildren": false, "id": "05b9febe-34b3-4836-8277-002294b233a9", "journalCode": "25", "modifiedDate": "2022-10-26T13:33:08Z", "name": "annaBankAccount1", "sourceModifiedDate": "2021-04-26T16:44:47Z", "status": "Active", "type": "Bank"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalId: "" + responses: + "200": + application/json: {"createdOn": "2022-01-17T10:44:23", "hasChildren": false, "id": "207", "journalCode": "AJPT", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:30Z", "name": "A Journal Push Test", "sourceModifiedDate": "2022-01-17T10:44:23", "status": "Active", "type": ""} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounting-journals: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2021-12-11T13:04:02", "hasChildren": true, "id": "90bb7784-083b-4bcb-a534-b30756cee65d", "journalCode": "GJ", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18Z", "name": "General Journal", "sourceModifiedDate": "2022-07-15T20:19:02", "status": "Active", "type": "General Journal"}, {"createdOn": "2021-12-11T13:04:02", "hasChildren": false, "id": "07b94827-c0a5-4cc7-ba58-3f9efec3b4b3", "journalCode": "PAY", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18Z", "name": "Payroll Journal", "parentId": "90bb7784-083b-4bcb-a534-b30756cee65d", "sourceModifiedDate": "2022-07-24T14:17:02", "status": "Active", "type": "Payroll Journal"}], "totalResults": 4} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2022-10-23T00:00:00Z", "hasChildren": true, "id": "211317b3-89d1-ea11-bbaa-000d3a2b9185", "journalCode": "ASSETS", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "name": "ASSETS", "sourceModifiedDate": "2023-02-02T10:26:25Z", "status": "Active", "type": "Assets"}, {"createdOn": "2022-06-15T10:03:59", "hasChildren": false, "id": "9a94ef78-92ec-ec11-82f9-000d3a8746a9", "journalCode": "BNKDEPOSIT-BNKD", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "name": "BNKD", "parentId": "af7d7e6b-e5c8-ec11-8e7e-000d3a86e04a", "sourceModifiedDate": "2022-06-15T22:45:30Z", "status": "Active", "type": "Bank Deposits"}], "totalResults": 46} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2019-11-05T14:44:51", "hasChildren": false, "id": "aae31284-e23d-456b-9957-fbf4bcef6c19", "journalCode": "21", "modifiedDate": "2022-10-26T13:31:58Z", "name": "12345678", "sourceModifiedDate": "2020-01-24T11:41:25Z", "status": "Active", "type": "Bank"}, {"createdOn": "2019-11-22T13:35:57", "hasChildren": false, "id": "74677165-1bd3-49b4-87d0-32d974674f86", "journalCode": "23", "modifiedDate": "2022-10-26T13:31:58Z", "name": "Abraham's Billion Dollar stuff", "sourceModifiedDate": "2019-11-22T13:35:57Z", "status": "Active", "type": "Bank"}], "totalResults": 47} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2021-04-26T16:44:47", "hasChildren": false, "id": "05b9febe-34b3-4836-8277-002294b233a9", "journalCode": "25", "modifiedDate": "2022-10-26T13:33:08Z", "name": "annaBankAccount1", "sourceModifiedDate": "2021-04-26T16:44:47Z", "status": "Active", "type": "Bank"}, {"createdOn": "2021-05-18T10:24:18", "hasChildren": false, "id": "b9c3d6a6-4ce2-4714-9ff6-fb15892300f7", "journalCode": "31", "modifiedDate": "2022-10-26T13:33:08Z", "name": "annaBankAccount10", "sourceModifiedDate": "2021-05-18T10:24:18Z", "status": "Active", "type": "Bank"}], "totalResults": 21} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2022-01-17T10:44:23", "hasChildren": false, "id": "207", "journalCode": "AJPT", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:30Z", "name": "A Journal Push Test", "sourceModifiedDate": "2022-01-17T10:44:23", "status": "Active", "type": ""}, {"createdOn": "2022-01-18T15:39:07", "hasChildren": false, "id": "223", "journalCode": "AJPT2", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:30Z", "name": "A Journal Push Test 2", "sourceModifiedDate": "2022-01-18T15:39:07", "status": "Active", "type": ""}], "totalResults": 1211} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + list-accounting-bank-account-transactions: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts/c9a41bc7-6e5b-ed11-8c34-0022481b8b5b/bankTransactions"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts/c9a41bc7-6e5b-ed11-8c34-0022481b8b5b/bankTransactions"}}, "pageNumber": 1, "pageSize": 100, "results": [{"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": 1, "balance": 1, "clearedOnDate": "2022-11-17T00:00:00", "description": "Share Capital", "id": "07c891b4-f67a-ed11-9989-0022481ae525", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": 1, "balance": 2, "clearedOnDate": "2022-11-17T00:00:00", "description": "Share Capital", "id": "5ced3895-f77a-ed11-9989-0022481b6241", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -19, "balance": -17, "clearedOnDate": "2022-12-02T00:00:00", "description": "", "id": "cd12966b-8871-ed11-8c34-6045bd0c6935", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Other"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -30, "balance": -72, "clearedOnDate": "2023-01-30T00:00:00", "description": "", "id": "b13392b6-95a0-ed11-9a88-6045bdd16279", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -10, "balance": -122, "clearedOnDate": "2023-01-30T00:00:00", "description": "Income, Services", "id": "b3696a16-1fa2-ed11-9a88-000d3ad59051", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -40, "balance": -112, "clearedOnDate": "2023-01-30T00:00:00", "description": "Child", "id": "b73392b6-95a0-ed11-9a88-6045bdd16279", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -13, "balance": -160, "clearedOnDate": "2023-01-30T00:00:00", "description": "Child Child", "id": "befdd569-22a2-ed11-9a88-000d3ad59051", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Other"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -25, "balance": -147, "clearedOnDate": "2023-01-30T00:00:00", "description": "Income, Services", "id": "cb71c33a-22a2-ed11-9a88-000d3ad59051", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Other"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -10, "balance": -27, "clearedOnDate": "2023-01-30T00:00:00", "description": "Child Child", "id": "e7ec12c9-94a0-ed11-9a88-6045bdd16279", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -15, "balance": -42, "clearedOnDate": "2023-01-30T00:00:00", "description": "", "id": "fef7a026-95a0-ed11-9a88-6045bdd16279", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -14, "balance": -184, "clearedOnDate": "2023-02-01T00:00:00", "description": "Accounts Payable", "id": "20869cb1-39a2-ed11-9a88-000d3ad59051", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -10, "balance": -170, "clearedOnDate": "2023-02-01T00:00:00", "description": "", "id": "8c298754-20a2-ed11-9a88-000d3ad59051", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -17, "balance": -201, "clearedOnDate": "2023-02-01T00:00:00", "description": "", "id": "935d5578-3ca2-ed11-9a88-000d3ad59051", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -17, "balance": -239, "clearedOnDate": "2023-02-01T00:00:00", "description": "", "id": "935f4303-e3a2-ed11-9a88-002248010b7e", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -21, "balance": -222, "clearedOnDate": "2023-02-01T00:00:00", "description": "", "id": "d8ceb342-dba2-ed11-9a88-002248010b7e", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Other"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -20, "balance": -292.69, "clearedOnDate": "2023-02-02T00:00:00", "description": "", "id": "15719c0c-22a6-ed11-9a88-002248010b7e", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -9.35, "balance": -265.19, "clearedOnDate": "2023-02-02T00:00:00", "description": "", "id": "213d027d-b1a3-ed11-9a88-000d3ad59051", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -7.5, "balance": -272.69, "clearedOnDate": "2023-02-02T00:00:00", "description": "Account no cat Balance Sheet", "id": "273d027d-b1a3-ed11-9a88-000d3ad59051", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": 2.16, "balance": -236.84, "clearedOnDate": "2023-02-02T00:00:00", "description": "", "id": "978c4a27-e0a2-ed11-9a88-002248010b7e", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Other"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -7.01, "balance": -262.85, "clearedOnDate": "2023-02-02T00:00:00", "description": "", "id": "a80f63ae-b0a3-ed11-9a88-000d3ad59051", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": 7.01, "balance": -255.84, "clearedOnDate": "2023-02-02T00:00:00", "description": "Account no cat Balance Sheet", "id": "ad0f63ae-b0a3-ed11-9a88-000d3ad59051", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -4.91, "balance": -260.75, "clearedOnDate": "2023-02-02T00:00:00", "description": "", "id": "b5de7b74-afa3-ed11-9a88-000d3ad59051", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": 4.91, "balance": -255.84, "clearedOnDate": "2023-02-02T00:00:00", "description": "", "id": "bbde7b74-afa3-ed11-9a88-000d3ad59051", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -19, "balance": -255.84, "clearedOnDate": "2023-02-02T00:00:00", "description": "", "id": "f9540bf4-e5a2-ed11-9a88-000d3ad5d945", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -20, "balance": -312.69, "clearedOnDate": "2023-02-06T00:00:00", "description": "", "id": "feca50d8-22a6-ed11-9a88-002248010b7e", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -2.34, "balance": -315.03, "clearedOnDate": "2023-02-07T00:00:00", "description": "", "id": "4777d7ec-cfa6-ed11-9a88-000d3a7fb2e5", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -10, "balance": -315.03, "clearedOnDate": "2023-02-09T00:00:00", "description": "Invalid VAT Posting Setup", "id": "38b632de-7aac-ed11-9a88-002248410639", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": 10, "balance": -305.03, "clearedOnDate": "2023-02-09T00:00:00", "description": "", "id": "ffc0b740-68a8-ed11-9a88-6045bdd12fc1", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -10, "balance": -325.03, "clearedOnDate": "2023-02-14T00:00:00", "description": "", "id": "95f27455-7cac-ed11-9a88-002248410639", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -12, "balance": -337.03, "clearedOnDate": "2023-02-16T00:00:00", "description": "Bank Account Line", "id": "0d6b1378-acae-ed11-9a88-6045bdd16279", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": 6, "balance": -342.03, "clearedOnDate": "2023-02-18T00:00:00", "description": "Bank", "id": "978da9f7-baae-ed11-9a88-6045bdc1c1f3", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -1, "balance": -338.03, "clearedOnDate": "2023-02-18T00:00:00", "description": "G/L", "id": "dd34e6eb-b6ae-ed11-9a88-6045bdc1c1f3", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": 2, "balance": -336.03, "clearedOnDate": "2023-02-18T00:00:00", "description": "Customer", "id": "e234e6eb-b6ae-ed11-9a88-6045bdc1c1f3", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -3, "balance": -339.03, "clearedOnDate": "2023-02-18T00:00:00", "description": "Vendor", "id": "e734e6eb-b6ae-ed11-9a88-6045bdc1c1f3", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -4, "balance": -343.03, "clearedOnDate": "2023-02-18T00:00:00", "description": "Bank", "id": "ed34e6eb-b6ae-ed11-9a88-6045bdc1c1f3", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -5, "balance": -348.03, "clearedOnDate": "2023-02-18T00:00:00", "description": "Employee", "id": "f234e6eb-b6ae-ed11-9a88-6045bdc1c1f3", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "amount": -10, "balance": -352.03, "clearedOnDate": "2023-02-21T00:00:00", "description": "", "id": "39de1293-d3b1-ed11-9a88-6045bd0f94d6", "modifiedDate": "2023-03-27T14:21:19Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Credit"}], "totalResults": 37} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts/738783/bankTransactions"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts/738783/bankTransactions?page=2&pageSize=100"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts/738783/bankTransactions"}}, "pageNumber": 1, "pageSize": 100, "results": [{"accountId": "738783", "amount": 111, "clearedOnDate": "2020-10-28T00:00:00", "description": "Invoice receipt against 1762", "id": "261197890", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": true, "sourceModifiedDate": "2020-10-28T16:27:10Z", "transactionType": "Credit"}, {"accountId": "738783", "amount": 10, "clearedOnDate": "2021-04-23T00:00:00", "description": "Invoice receipt against 1980", "id": "290878530", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": true, "sourceModifiedDate": "2021-04-27T04:55:42Z", "transactionType": "Credit"}, {"accountId": "738783", "amount": 10, "clearedOnDate": "2021-04-26T00:00:00", "description": "Invoice receipt against 1976", "id": "290825614", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": true, "sourceModifiedDate": "2021-04-26T14:05:15Z", "transactionType": "Credit"}, {"accountId": "738783", "amount": 20, "clearedOnDate": "2021-04-26T00:00:00", "description": "Invoice receipt against 1981", "id": "290878531", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": true, "sourceModifiedDate": "2021-04-27T04:55:44Z", "transactionType": "Credit"}, {"accountId": "738783", "amount": 20, "clearedOnDate": "2021-04-28T00:00:00", "description": "Invoice receipt against 2002", "id": "291227300", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": true, "sourceModifiedDate": "2021-04-28T13:43:56Z", "transactionType": "Credit"}, {"accountId": "738783", "amount": 40, "clearedOnDate": "2021-04-28T00:00:00", "description": "Invoice receipt against 2012", "id": "291242296", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": true, "sourceModifiedDate": "2021-04-28T16:14:16Z", "transactionType": "Credit"}, {"accountId": "738783", "amount": 1, "clearedOnDate": "2022-03-21T00:00:00", "description": "Invoice receipt against 2304", "id": "346437532", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": true, "sourceModifiedDate": "2022-03-21T14:59:40Z", "transactionType": "Credit"}, {"accountId": "738783", "amount": 1, "clearedOnDate": "2022-03-21T00:00:00", "description": "Invoice receipt against 2304", "id": "346444438", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": true, "sourceModifiedDate": "2022-03-21T15:37:54Z", "transactionType": "Credit"}, {"accountId": "738783", "amount": 1, "clearedOnDate": "2022-03-21T00:00:00", "description": "Invoice receipt against 2304", "id": "346444989", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": true, "sourceModifiedDate": "2022-03-21T15:41:22Z", "transactionType": "Credit"}, {"accountId": "738783", "amount": -1, "clearedOnDate": "2022-03-21T00:00:00", "description": "Credit Note refund against 2313", "id": "346457774", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": true, "sourceModifiedDate": "2022-03-21T17:07:50Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": 1, "clearedOnDate": "2022-03-21T00:00:00", "description": "Invoice receipt against 2311", "id": "346458196", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": true, "sourceModifiedDate": "2022-03-21T17:14:15Z", "transactionType": "Credit"}, {"accountId": "738783", "amount": -12.78, "clearedOnDate": "2022-12-20T00:00:00", "description": "MCDONALDS - ROYSTON - Card Ending: 9271//OTHER/", "id": "414441841", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:33Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -7.98, "clearedOnDate": "2022-12-20T00:00:00", "description": "HERMES PARCELNET LTD T/A - 08445437147 - Card Ending: 2327//OTHER/", "id": "414441842", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:33Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -648.63, "clearedOnDate": "2022-12-20T00:00:00", "description": "TRAVELODGE GB0000 - THAME - Card Ending: 4999//OTHER/", "id": "414441845", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:33Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -324.31, "clearedOnDate": "2022-12-20T00:00:00", "description": "TRAVELODGE GB0000 - THAME - Card Ending: 4999//OTHER/", "id": "414441847", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:33Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -11.45, "clearedOnDate": "2022-12-20T00:00:00", "description": "RUGBY, PRET A MANGER - RUGBY - Card Ending: 9271//OTHER/", "id": "414441849", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:33Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -22.52, "clearedOnDate": "2022-12-20T00:00:00", "description": "Just Eat - London - Card Ending: 9271//OTHER/", "id": "414441851", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:33Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -340.13, "clearedOnDate": "2022-12-20T00:00:00", "description": "CN TAR TAROM SA-MOBILP - ORAS OTOPENI - Card Ending: 4999//OTHER/", "id": "414441852", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:33Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -126.12, "clearedOnDate": "2022-12-21T00:00:00", "description": "MOTO RUGBY SERVICES - RUGBY - Card Ending: 9271//OTHER/", "id": "414441854", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:33Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -9.99, "clearedOnDate": "2022-12-21T00:00:00", "description": "POMANDA.COM - 138 HOLBORN, - Card Ending: 2327//OTHER/", "id": "414441855", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:33Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -267.97, "clearedOnDate": "2022-12-21T00:00:00", "description": "RYANAIR 224BEZ3YM - LONDON - Card Ending: 4999//OTHER/", "id": "414441856", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:33Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -9.35, "clearedOnDate": "2022-12-21T00:00:00", "description": "TESCO STORES 5956 - LONDON - Card Ending: 9271//OTHER/", "id": "414441857", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:33Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -16.99, "clearedOnDate": "2022-12-21T00:00:00", "description": "SPOTIFY - LONDON - Card Ending: 4999//OTHER/", "id": "414441859", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:33Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -149, "clearedOnDate": "2022-12-21T00:00:00", "description": "Revive My Device - London - Card Ending: 5913//OTHER/", "id": "414441860", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:33Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -39.36, "clearedOnDate": "2022-12-22T00:00:00", "description": "DELIVEROO - LONDON - Card Ending: 9271//OTHER/", "id": "414441861", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:33Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -2.4, "clearedOnDate": "2022-12-22T00:00:00", "description": "UPS LTD - FELTHAM - Card Ending: 2327//OTHER/", "id": "414441862", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:33Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -17.76, "clearedOnDate": "2022-12-22T00:00:00", "description": "Amazon.co.uk*1N0N04VK4 - AMAZON.CO.UK - Card Ending: 2327//OTHER/", "id": "414441863", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -10.65, "clearedOnDate": "2022-12-22T00:00:00", "description": "TESCO STORES 5956 - LONDON - Card Ending: 9271//OTHER/", "id": "414441864", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -16.75, "clearedOnDate": "2022-12-22T00:00:00", "description": "GATHER & GATHER 3401 - LONDON - Card Ending: 9271//OTHER/", "id": "414441865", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -4.55, "clearedOnDate": "2022-12-22T00:00:00", "description": "GATHER & GATHER 3401 - LONDON - Card Ending: 9271//OTHER/", "id": "414441866", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -10.75, "clearedOnDate": "2022-12-22T00:00:00", "description": "TRAVELODGE GB0937 - LONDON - Card Ending: 9271//OTHER/", "id": "414441867", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -34.2, "clearedOnDate": "2022-12-22T00:00:00", "description": "DELIVEROO - LONDON - Card Ending: 9271//OTHER/", "id": "414441868", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -2.8, "clearedOnDate": "2022-12-22T00:00:00", "description": "TFL TRAVEL CH - TFL.GOV.UK/CP - Card Ending: 5913//OTHER/", "id": "414441869", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -5.99, "clearedOnDate": "2022-12-23T00:00:00", "description": "SIDS DIY - LONDON E1 - Card Ending: 9271//OTHER/", "id": "414441870", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -368.72, "clearedOnDate": "2022-12-23T00:00:00", "description": "RESOLUTION GB LTD - WHITCHURCH - Card Ending: 2327//OTHER/", "id": "414441871", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -6.15, "clearedOnDate": "2022-12-23T00:00:00", "description": "GATHER & GATHER 3401 - LONDON - Card Ending: 9271//OTHER/", "id": "414441872", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -5.34, "clearedOnDate": "2022-12-23T00:00:00", "description": "HERMES PARCELNET LTD T/A - 08445437147 - Card Ending: 2327//OTHER/", "id": "414441874", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": 6.8, "clearedOnDate": "2022-12-23T00:00:00", "description": "Refund: SCREWFIX DIR LTD - WHITECHAP1983 - Card Ending: 9271//OTHER/", "id": "414441875", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Credit"}, {"accountId": "738783", "amount": 12.49, "clearedOnDate": "2022-12-23T00:00:00", "description": "Refund: SCREWFIX DIR LTD - WHITECHAP1983 - Card Ending: 9271//OTHER/", "id": "414441876", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Credit"}, {"accountId": "738783", "amount": -6.5, "clearedOnDate": "2022-12-23T00:00:00", "description": "SCREWFIX DIR LTD - WHITECHAP1983 - Card Ending: 9271//OTHER/", "id": "414441877", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -27.15, "clearedOnDate": "2022-12-23T00:00:00", "description": "SCREWFIX DIR LTD - WHITECHAP1983 - Card Ending: 9271//OTHER/", "id": "414441878", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -8, "clearedOnDate": "2022-12-23T00:00:00", "description": "GOODMANS FIELD - LONDON - Card Ending: 9271//OTHER/", "id": "414441879", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -25.7, "clearedOnDate": "2022-12-23T00:00:00", "description": "GOODMANS FIELD - LONDON - Card Ending: 9271//OTHER/", "id": "414441880", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -50, "clearedOnDate": "2022-12-23T00:00:00", "description": "CREAMLINE DAIRIES ONLINE - MANCHESTER - Card Ending: 2327//OTHER/", "id": "414441881", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:34Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -388.24, "clearedOnDate": "2022-12-24T00:00:00", "description": "AIRBNB * HMYDEXRY4N - 203-318-1111 - Card Ending: 5913//OTHER/", "id": "414441883", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -9.35, "clearedOnDate": "2022-12-24T00:00:00", "description": "UPS LTD - FELTHAM - Card Ending: 2327//OTHER/", "id": "414441884", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -11.9, "clearedOnDate": "2022-12-24T00:00:00", "description": "UBER *TRIP - HELP.UBER.COM - Card Ending: 9271//OTHER/", "id": "414441886", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -6.84, "clearedOnDate": "2022-12-24T00:00:00", "description": "UBER *TRIP - HELP.UBER.COM - Card Ending: 9271//OTHER/", "id": "414441889", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -102.23, "clearedOnDate": "2022-12-24T00:00:00", "description": "WELCOME BREAK - NEWPORT PAGNE - Card Ending: 9271//OTHER/", "id": "414441891", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -15.38, "clearedOnDate": "2022-12-24T00:00:00", "description": "SUBWAY 63582 London Gatew - Mill Hill, Lo - Card Ending: 9271//OTHER/", "id": "414441892", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -40.65, "clearedOnDate": "2022-12-26T00:00:00", "description": "UBER *TRIP - HELP.UBER.COM - Card Ending: 1332//OTHER/", "id": "414441893", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -2, "clearedOnDate": "2022-12-26T00:00:00", "description": "UBER *TRIP - HELP.UBER.COM - Card Ending: 1332//OTHER/", "id": "414441894", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -34.06, "clearedOnDate": "2022-12-26T00:00:00", "description": "UBER *TRIP - HELP.UBER.COM - Card Ending: 1332//OTHER/", "id": "414441895", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -2, "clearedOnDate": "2022-12-26T00:00:00", "description": "UBER *TRIP - HELP.UBER.COM - Card Ending: 1332//OTHER/", "id": "414441897", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -9.99, "clearedOnDate": "2022-12-28T00:00:00", "description": "Tesla - West Drayton - Card Ending: 1332//OTHER/", "id": "414441901", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -20.65, "clearedOnDate": "2022-12-28T00:00:00", "description": "Box Deansgate - Manchester - Card Ending: 0614//OTHER/", "id": "414441904", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -26.5, "clearedOnDate": "2022-12-28T00:00:00", "description": "MANCHESTER UNITED KIOSK - MANCHESTER - Card Ending: 0614//OTHER/", "id": "414441906", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -2.8, "clearedOnDate": "2022-12-29T00:00:00", "description": "TFL TRAVEL CH - TFL.GOV.UK/CP - Card Ending: 5913//OTHER/", "id": "414441908", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -1.65, "clearedOnDate": "2022-12-31T00:00:00", "description": "TFL TRAVEL CH - TFL.GOV.UK/CP - Card Ending: 5913//OTHER/", "id": "414441909", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -2, "clearedOnDate": "2023-01-01T00:00:00", "description": "UBER* TRIP - LONDON - Card Ending: 1332//OTHER/", "id": "414441910", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -11.95, "clearedOnDate": "2023-01-01T00:00:00", "description": "UBER* TRIP - LONDON - Card Ending: 1332//OTHER/", "id": "414441911", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:35Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -13.68, "clearedOnDate": "2023-01-02T00:00:00", "description": "UBER* TRIP - LONDON - Card Ending: 9271//OTHER/", "id": "414441912", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -22.8, "clearedOnDate": "2023-01-02T00:00:00", "description": "WWW.KASHFLOW.COM - DATCHET - Card Ending: 1332//OTHER/", "id": "414441913", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -9.14, "clearedOnDate": "2023-01-02T00:00:00", "description": "UBER *TRIP - HELP.UBER.COM - Card Ending: 1332//OTHER/", "id": "414441914", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -216.2, "clearedOnDate": "2023-01-02T00:00:00", "description": "GOOGLE*GSUITE ISOMI.CO - DUBLIN 2 - Card Ending: 1332//OTHER/", "id": "414441915", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": 10.97, "clearedOnDate": "2023-01-03T00:00:00", "description": "Refund: AMZ*quickpickdeals - amazon.co.uk - Card Ending: 4999//OTHER/", "id": "414441916", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Credit"}, {"accountId": "738783", "amount": -0.41, "clearedOnDate": "2023-01-04T00:00:00", "description": "Finance Charge//OTHER/", "id": "414441917", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -22.8, "clearedOnDate": "2023-01-04T00:00:00", "description": "WWW.KASHFLOW.COM - DATCHET - Card Ending: 1332//OTHER/", "id": "414441918", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -86.34, "clearedOnDate": "2023-01-04T00:00:00", "description": "ACCU.CO.UK - HUDDERSFIELD - Card Ending: 2327//OTHER/", "id": "414441919", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -6.5, "clearedOnDate": "2023-01-04T00:00:00", "description": "ASDA GROCERIES ONLINE - INTERNET - Card Ending: 2327//OTHER/", "id": "414441920", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -96, "clearedOnDate": "2023-01-04T00:00:00", "description": "AMAZON PRIME*164AU3UZ4 AM - AMZN.CO.UK/PM - Card Ending: 1332//OTHER/", "id": "414441922", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -44.62, "clearedOnDate": "2023-01-05T00:00:00", "description": "Amazon.co.uk*162DC7II4 - AMAZON.CO.UK - Card Ending: 2327//OTHER/", "id": "414441924", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -65.46, "clearedOnDate": "2023-01-05T00:00:00", "description": "trainline - +443332022222 - Card Ending: 5913//OTHER/", "id": "414441926", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -124.35, "clearedOnDate": "2023-01-05T00:00:00", "description": "VITAL PARTS LTD - MAIDSTONE - Card Ending: 2327//OTHER/", "id": "414441931", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -2.52, "clearedOnDate": "2023-01-05T00:00:00", "description": "Amazon.co.uk*168E49IU4 - AMAZON.CO.UK - Card Ending: 2327//OTHER/", "id": "414441934", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -108.16, "clearedOnDate": "2023-01-05T00:00:00", "description": "ASDA GROCERIES ONLINE - INTERNET - Card Ending: 2327//OTHER/", "id": "414441935", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": 22.96, "clearedOnDate": "2023-01-05T00:00:00", "description": "Refund: ASDA GROCERIES ONLINE - INTERNET - Card Ending: 2327//OTHER/", "id": "414441936", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Credit"}, {"accountId": "738783", "amount": -20.52, "clearedOnDate": "2023-01-05T00:00:00", "description": "Amazon.co.uk*1H31B0CO4 - AMAZON.CO.UK - Card Ending: 2327//OTHER/", "id": "414441937", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:36Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -13.69, "clearedOnDate": "2023-01-05T00:00:00", "description": "Amazon.co.uk*1H4GR4CH4 - AMAZON.CO.UK - Card Ending: 2327//OTHER/", "id": "414441939", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -16.83, "clearedOnDate": "2023-01-05T00:00:00", "description": "Amazon.co.uk*162V47WY4 - AMAZON.CO.UK - Card Ending: 2327//OTHER/", "id": "414441941", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -17.68, "clearedOnDate": "2023-01-05T00:00:00", "description": "Amazon.co.uk*160J00WI4 - AMAZON.CO.UK - Card Ending: 2327//OTHER/", "id": "414441945", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -29.74, "clearedOnDate": "2023-01-06T00:00:00", "description": "Amazon.co.uk*1692Y9YY4 - AMAZON.CO.UK - Card Ending: 2327//OTHER/", "id": "414441946", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -29.74, "clearedOnDate": "2023-01-06T00:00:00", "description": "Amazon.co.uk*166I62Y14 - AMAZON.CO.UK - Card Ending: 2327//OTHER/", "id": "414441947", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -121.3, "clearedOnDate": "2023-01-06T00:00:00", "description": "GMELIUS GROWTH - MEYRIN - Card Ending: 5913//OTHER/", "id": "414441948", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -116.34, "clearedOnDate": "2023-01-07T00:00:00", "description": "ACCU.CO.UK - HUDDERSFIELD - Card Ending: 2327//OTHER/", "id": "414441949", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -66.79, "clearedOnDate": "2023-01-07T00:00:00", "description": "AMZNMktplace - amazon.co.uk - Card Ending: 2327//OTHER/", "id": "414441950", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -77.88, "clearedOnDate": "2023-01-07T00:00:00", "description": "TOOLSTATION UK - NORTHAMPTON - Card Ending: 2327//OTHER/", "id": "414441951", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -112.24, "clearedOnDate": "2023-01-07T00:00:00", "description": "SHELL CHESTER - CHESTER - Card Ending: 9271//OTHER/", "id": "414441952", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -450.85, "clearedOnDate": "2023-01-08T00:00:00", "description": "BRITISH A 1252150515112 - LONDON - Card Ending: 4999//OTHER/", "id": "414441953", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -65, "clearedOnDate": "2023-01-08T00:00:00", "description": "BRITISH A 1254217966962 - LONDON - Card Ending: 4999//OTHER/", "id": "414441954", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -3.3, "clearedOnDate": "2023-01-08T00:00:00", "description": "TFL TRAVEL CH - TFL.GOV.UK/CP - Card Ending: 5913//OTHER/", "id": "414441955", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -17.45, "clearedOnDate": "2023-01-09T00:00:00", "description": "Amazon.co.uk*1H97Y6TL4 - AMAZON.CO.UK - Card Ending: 2327//OTHER/", "id": "414441956", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -15.03, "clearedOnDate": "2023-01-09T00:00:00", "description": "UBER *TRIP - HELP.UBER.COM - Card Ending: 1332//OTHER/", "id": "414441957", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -16.43, "clearedOnDate": "2023-01-09T00:00:00", "description": "UBER *TRIP - HELP.UBER.COM - Card Ending: 1332//OTHER/", "id": "414441959", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": 5000, "clearedOnDate": "2023-01-09T00:00:00", "description": "Payment made (BACS)//OTHER/", "id": "414441960", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:37Z", "transactionType": "Credit"}, {"accountId": "738783", "amount": -32.57, "clearedOnDate": "2023-01-10T00:00:00", "description": "AMZNMktplace - amazon.co.uk - Card Ending: 2327//OTHER/", "id": "414441961", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:38Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -3.9, "clearedOnDate": "2023-01-10T00:00:00", "description": "TESCO STORES - LONDON - Card Ending: 5913//OTHER/", "id": "414441962", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:38Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -15.5, "clearedOnDate": "2023-01-10T00:00:00", "description": "VICTORIA INN - PECKHAM - Card Ending: 5913//OTHER/", "id": "414441963", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:38Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -7.7, "clearedOnDate": "2023-01-10T00:00:00", "description": "TFL TRAVEL CH - TFL.GOV.UK/CP - Card Ending: 5913//OTHER/", "id": "414441965", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:38Z", "transactionType": "Debit"}, {"accountId": "738783", "amount": -13.8, "clearedOnDate": "2023-01-10T00:00:00", "description": "PRET A MANGER - 326 - Card Ending: 5913//OTHER/", "id": "414441967", "modifiedDate": "2023-04-25T14:21:41Z", "reconciled": false, "sourceModifiedDate": "2023-02-08T09:05:38Z", "transactionType": "Debit"}], "totalResults": 153} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts/765768/bankTransactions"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts/765768/bankTransactions"}}, "pageNumber": 1, "pageSize": 100, "results": [{"accountId": "765768", "amount": 100, "clearedOnDate": "2020-04-28T00:00:00", "description": "FIRST Transaction", "id": "765768:137014109", "modifiedDate": "2022-09-30T10:29:15Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "765768", "amount": 120, "clearedOnDate": "2020-04-28T00:00:00", "description": "SECOND Transaction", "id": "765768:137014143", "modifiedDate": "2022-09-30T10:29:15Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "765768", "amount": -5, "clearedOnDate": "2020-04-28T00:00:00", "description": "KF00021:", "id": "765768:93269803", "modifiedDate": "2022-09-30T10:29:15Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "765768", "amount": 110, "clearedOnDate": "2020-06-18T00:00:00", "description": "INV #33: Customer overpayment", "id": "765768:141203309", "modifiedDate": "2022-09-30T10:29:15Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "765768", "amount": 1, "clearedOnDate": "2020-10-23T00:00:00", "description": "", "id": "765768:144653342", "modifiedDate": "2022-09-30T10:29:15Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}], "totalResults": 5} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts/20000-933270541/bankTransactions"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts/20000-933270541/bankTransactions?page=2&pageSize=100"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts/20000-933270541/bankTransactions"}}, "pageNumber": 1, "pageSize": 100, "results": [{"accountId": "20000-933270541", "amount": -1200, "clearedOnDate": "2022-12-01T00:00:00", "description": "", "id": "D7B-933784104", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:04:10", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -35, "clearedOnDate": "2022-12-05T00:00:00", "description": "", "id": "DFA-933785132", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:04:11", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -197.59, "clearedOnDate": "2022-12-10T00:00:00", "description": "", "id": "E2E-933785785", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:04:11", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -2100, "clearedOnDate": "2022-12-20T00:00:00", "description": "", "id": "536B-1197755199", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:05:47", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": 27874.62, "clearedOnDate": "2022-12-31T00:00:00", "description": "Opening Balance - Bank Balance - Checking Account", "id": "5C18-1197711471-to", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:06", "transactionType": "Other"}, {"accountId": "20000-933270541", "amount": -532.97, "clearedOnDate": "2023-01-11T00:00:00", "description": "Monthly Truck Payment", "id": "3A09-1071529982", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:04:58", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": -3495.82, "clearedOnDate": "2023-01-15T00:00:00", "description": "941 Deposit for December 2005 Payyroll", "id": "95C6-1197729008", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:19", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -100, "clearedOnDate": "2023-01-15T00:00:00", "description": "FUTA Payment - 4 Qrt 2005", "id": "95CA-1197729081", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:19", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -208.09, "clearedOnDate": "2023-01-15T00:00:00", "description": "State Unemployment and Disability - 4th Quarter 2005", "id": "95D0-1197729222", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:19", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -1214.31, "clearedOnDate": "2023-01-15T00:00:00", "description": "Worker's Compensation - 4th Quarter 2005", "id": "95D4-1197729376", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:19", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": 1228.18, "clearedOnDate": "2023-01-15T00:00:00", "description": "Deposit", "id": "9C06-1181931827", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:23", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -308.34, "clearedOnDate": "2023-01-15T00:00:00", "description": "", "id": "9E3A-1182063799", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:30", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -12362.89, "clearedOnDate": "2023-01-15T00:00:00", "description": "", "id": "A293-1197953458", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:35", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -9521, "clearedOnDate": "2023-01-15T00:00:00", "description": "", "id": "A2AB-1197953786", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:35", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -3146.88, "clearedOnDate": "2023-01-15T00:00:00", "description": "ABCD 11-234567", "id": "A33E-1197955762", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:36", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": 15281.67, "clearedOnDate": "2023-01-17T00:00:00", "description": "Deposit", "id": "6992-1197775718", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:11", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -712.56, "clearedOnDate": "2023-01-21T00:00:00", "description": "786-35", "id": "3E5D-1071498699", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:05:09", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": 31474.25, "clearedOnDate": "2023-01-25T00:00:00", "description": "Deposit", "id": "699D-1197775731", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:11", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -24, "clearedOnDate": "2023-01-31T00:00:00", "description": "Monthly Water - Flat Rate Plan", "id": "53D-933354764", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:04:00", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -205, "clearedOnDate": "2023-01-31T00:00:00", "description": "", "id": "9E3D-1182131998", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:30", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": -532, "clearedOnDate": "2023-01-31T00:00:00", "description": "", "id": "9E42-1182131999", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:30", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": -623, "clearedOnDate": "2023-01-31T00:00:00", "description": "", "id": "9E47-1182131999", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:30", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": -13759, "clearedOnDate": "2023-01-31T00:00:00", "description": "", "id": "9E4C-1182131999", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:30", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": -138, "clearedOnDate": "2023-01-31T00:00:00", "description": "Fuel", "id": "9ED6-1182133365", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:32", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -218, "clearedOnDate": "2023-01-31T00:00:00", "description": "Monthly Vehicle Repairs and Maintenance", "id": "9F2D-1197948760", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:33", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -123.67, "clearedOnDate": "2023-01-31T00:00:00", "description": "Acct #560-82645-99C", "id": "9F96-1197949640", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:33", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -2710.9, "clearedOnDate": "2023-01-31T00:00:00", "description": "Pmt# 1", "id": "A2CD-1197955250", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:36", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -12.5, "clearedOnDate": "2023-01-31T00:00:00", "description": "Checking Account Service Charge", "id": "F29-933787474", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:04:13", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": 1040, "clearedOnDate": "2023-02-02T00:00:00", "description": "Deposit", "id": "698D-1197775698", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:11", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": 271.53, "clearedOnDate": "2023-02-09T00:00:00", "description": "Deposit", "id": "69A8-1197775740", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:11", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -532.97, "clearedOnDate": "2023-02-11T00:00:00", "description": "Monthly Truck Payment", "id": "3A10-1071529997", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:04:58", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": -268.39, "clearedOnDate": "2023-02-15T00:00:00", "description": "", "id": "A0BD-1197950967", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:35", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -4050.98, "clearedOnDate": "2023-02-15T00:00:00", "description": "", "id": "A2AF-1197953842", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:35", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -1466.32, "clearedOnDate": "2023-02-15T00:00:00", "description": "ABCD 11-234567", "id": "A343-1197955826", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:36", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": 25471.56, "clearedOnDate": "2023-02-28T00:00:00", "description": "Deposit", "id": "9C0B-1181931843", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:23", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -2050, "clearedOnDate": "2023-02-28T00:00:00", "description": "For Vetter Basement Remodel", "id": "9E63-1182132109", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:30", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": -142, "clearedOnDate": "2023-02-28T00:00:00", "description": "Fuel", "id": "9ED9-1182133383", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:32", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -222, "clearedOnDate": "2023-02-28T00:00:00", "description": "Monthly Vechiicle Repairs and Maintenance", "id": "9F33-1197948806", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:33", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -125.89, "clearedOnDate": "2023-02-28T00:00:00", "description": "Acct #560-82645-99C", "id": "9F99-1197949656", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:33", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -24, "clearedOnDate": "2023-02-28T00:00:00", "description": "Monthly Water - Flat Rate Plan", "id": "9FBD-1197949852", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:34", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -80, "clearedOnDate": "2023-02-28T00:00:00", "description": "Flat Rate Phone and Long Distance Bundle", "id": "A052-1197950680", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:34", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -12.5, "clearedOnDate": "2023-02-28T00:00:00", "description": "Checking Account Service Charge", "id": "A081-1197950831", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:35", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -2710.9, "clearedOnDate": "2023-02-28T00:00:00", "description": "Pmt# 2", "id": "A2D1-1197955271", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:36", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -532.97, "clearedOnDate": "2023-03-11T00:00:00", "description": "Monthly Truck Payment", "id": "3A17-1071530007", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:04:58", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": -7500, "clearedOnDate": "2023-03-13T00:00:00", "description": "", "id": "9C38-1182054225", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:24", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -1600, "clearedOnDate": "2023-03-15T00:00:00", "description": "", "id": "A296-1197953484", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:35", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -83.6, "clearedOnDate": "2023-03-15T00:00:00", "description": "ABCD 11-234567", "id": "A346-1197955854", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:36", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": 6278.8, "clearedOnDate": "2023-03-20T00:00:00", "description": "Deposit", "id": "9C10-1181931855", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:23", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -435, "clearedOnDate": "2023-03-31T00:00:00", "description": "", "id": "9E72-1182132247", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:30", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": -127, "clearedOnDate": "2023-03-31T00:00:00", "description": "Fuel", "id": "9EDC-1182133383", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:32", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -232, "clearedOnDate": "2023-03-31T00:00:00", "description": "Monthly Vechiicle Repairs and Maintenance", "id": "9F36-1197948806", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:33", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -450, "clearedOnDate": "2023-03-31T00:00:00", "description": "Payment - Quarterly Office Maintenance Contract", "id": "9F7B-1197949443", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:33", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -389.2, "clearedOnDate": "2023-03-31T00:00:00", "description": "Acct #560-82645-99C", "id": "9F9C-1197949656", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:33", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -24, "clearedOnDate": "2023-03-31T00:00:00", "description": "Monthly Water - Flat Rate Plan", "id": "9FC0-1197949852", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:34", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -80, "clearedOnDate": "2023-03-31T00:00:00", "description": "Flat Rate Phone and Long Distance Bundle", "id": "A056-1197950680", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:34", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -12.5, "clearedOnDate": "2023-03-31T00:00:00", "description": "Checking Account Service Charge", "id": "A084-1197950832", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:35", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -2710.9, "clearedOnDate": "2023-03-31T00:00:00", "description": "Pmt# 3", "id": "A2D5-1197955280", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:36", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -532.97, "clearedOnDate": "2023-04-12T00:00:00", "description": "Monthly Truck Payment", "id": "3A1E-1071530019", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:04:58", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": -714, "clearedOnDate": "2023-04-17T00:00:00", "description": "", "id": "4271-1071523732", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:05:32", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": -712.56, "clearedOnDate": "2023-04-19T00:00:00", "description": "786-35", "id": "3E98-1071499056", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:05:11", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": 16500, "clearedOnDate": "2023-04-20T00:00:00", "description": "Deposit", "id": "9C68-1182054440", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:24", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -162, "clearedOnDate": "2023-04-30T00:00:00", "description": "Fuel", "id": "9EDF-1182133383", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:32", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -192, "clearedOnDate": "2023-04-30T00:00:00", "description": "Monthly Vechiicle Repairs and Maintenance", "id": "9F39-1197948806", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:33", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -120.93, "clearedOnDate": "2023-04-30T00:00:00", "description": "Acct #560-82645-99C", "id": "9F9F-1197949656", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:33", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -24, "clearedOnDate": "2023-04-30T00:00:00", "description": "Monthly Water - Flat Rate Plan", "id": "9FC3-1197949852", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:34", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -80, "clearedOnDate": "2023-04-30T00:00:00", "description": "Flat Rate Phone and Long Distance Bundle", "id": "A05A-1197950680", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:34", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -12.5, "clearedOnDate": "2023-04-30T00:00:00", "description": "Checking Account Service Charge", "id": "A087-1197950832", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:35", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -2710.9, "clearedOnDate": "2023-04-30T00:00:00", "description": "Pmt# 4", "id": "A2D9-1197955286", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:36", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -7500, "clearedOnDate": "2023-05-01T00:00:00", "description": "", "id": "9C86-1182054823", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:24", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -532.97, "clearedOnDate": "2023-05-13T00:00:00", "description": "Monthly Truck Payment", "id": "3A25-1071530029", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:04:59", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": -950.23, "clearedOnDate": "2023-05-15T00:00:00", "description": "", "id": "A0C0-1197950991", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:35", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -1400, "clearedOnDate": "2023-05-15T00:00:00", "description": "", "id": "A299-1197953515", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:35", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -318.02, "clearedOnDate": "2023-05-15T00:00:00", "description": "ABCD 11-234567", "id": "A349-1197955899", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:36", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": 16500, "clearedOnDate": "2023-05-31T00:00:00", "description": "Deposit", "id": "9CB8-1182055085", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:25", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -143, "clearedOnDate": "2023-05-31T00:00:00", "description": "Fuel", "id": "9EE2-1182133383", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:32", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -232, "clearedOnDate": "2023-05-31T00:00:00", "description": "Monthly Vechiicle Repairs and Maintenance", "id": "9F3C-1197948806", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:33", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -128.03, "clearedOnDate": "2023-05-31T00:00:00", "description": "Acct #560-82645-99C", "id": "9FA2-1197949656", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:33", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -24, "clearedOnDate": "2023-05-31T00:00:00", "description": "Monthly Water - Flat Rate Plan", "id": "9FC6-1197949852", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:34", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -80, "clearedOnDate": "2023-05-31T00:00:00", "description": "Flat Rate Phone and Long Distance Bundle", "id": "A05E-1197950680", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:34", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -12.5, "clearedOnDate": "2023-05-31T00:00:00", "description": "Checking Account Service Charge", "id": "A08A-1197950832", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:35", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -2710.9, "clearedOnDate": "2023-05-31T00:00:00", "description": "Pmt# 5", "id": "A2DD-1197955294", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:36", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -5275, "clearedOnDate": "2023-06-06T00:00:00", "description": "", "id": "9CBD-1182055262", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:25", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -532.97, "clearedOnDate": "2023-06-10T00:00:00", "description": "Monthly Truck Payment", "id": "3A2C-1071530042", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:04:59", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": -1786, "clearedOnDate": "2023-06-16T00:00:00", "description": "", "id": "5356-1197761596", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:05:46", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -157, "clearedOnDate": "2023-06-30T00:00:00", "description": "Fuel", "id": "9EE5-1182133383", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:32", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -186, "clearedOnDate": "2023-06-30T00:00:00", "description": "Monthly Vechiicle Repairs and Maintenance", "id": "9F3F-1197948806", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:33", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -450, "clearedOnDate": "2023-06-30T00:00:00", "description": "Payment - Quarterly Office Maintenance Contract", "id": "9F7E-1197949458", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:33", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -135.02, "clearedOnDate": "2023-06-30T00:00:00", "description": "Acct #560-82645-99C", "id": "9FA5-1197949656", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:33", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -24, "clearedOnDate": "2023-06-30T00:00:00", "description": "Monthly Water - Flat Rate Plan", "id": "9FC9-1197949852", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:34", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -80, "clearedOnDate": "2023-06-30T00:00:00", "description": "Flat Rate Phone and Long Distance Bundle", "id": "A062-1197950680", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:34", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -12.5, "clearedOnDate": "2023-06-30T00:00:00", "description": "Checking Account Service Charge", "id": "A08D-1197950832", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:35", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -2710.9, "clearedOnDate": "2023-06-30T00:00:00", "description": "Pmt# 6", "id": "A2E1-1197955306", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:36", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -532.97, "clearedOnDate": "2023-07-11T00:00:00", "description": "Monthly Truck Payment", "id": "3A33-1071530066", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:04:59", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": -712.56, "clearedOnDate": "2023-07-19T00:00:00", "description": "786-35", "id": "3E67-1071498733", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:05:09", "transactionType": "Unknown"}, {"accountId": "20000-933270541", "amount": -239.29, "clearedOnDate": "2023-07-23T00:00:00", "description": "", "id": "A0C3-1197951027", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:35", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -126, "clearedOnDate": "2023-07-31T00:00:00", "description": "Fuel", "id": "9EE8-1182133383", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:32", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -126, "clearedOnDate": "2023-07-31T00:00:00", "description": "Monthly Vechiicle Repairs and Maintenance", "id": "9F42-1197948806", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:33", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -128.03, "clearedOnDate": "2023-07-31T00:00:00", "description": "Acct #560-82645-99C", "id": "9FA8-1197949656", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:33", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -24, "clearedOnDate": "2023-07-31T00:00:00", "description": "Monthly Water - Flat Rate Plan", "id": "9FCC-1197949852", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:34", "transactionType": "Payment"}, {"accountId": "20000-933270541", "amount": -80, "clearedOnDate": "2023-07-31T00:00:00", "description": "Flat Rate Phone and Long Distance Bundle", "id": "A066-1197950680", "modifiedDate": "2023-04-26T09:07:14Z", "reconciled": false, "sourceModifiedDate": "2023-12-16T05:06:34", "transactionType": "Payment"}], "totalResults": 495} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts/1200/bankTransactions"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts/1200/bankTransactions?page=2&pageSize=100"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts/1200/bankTransactions"}}, "pageNumber": 1, "pageSize": 100, "results": [{"accountId": "1200", "amount": -162, "balance": -10164.54, "clearedOnDate": "2021-01-29T00:00:00", "description": "DD/STO", "id": "73", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1497.58, "balance": -10302.54, "clearedOnDate": "2021-01-30T00:00:00", "description": "568953", "id": "52", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 500, "balance": -9802.54, "clearedOnDate": "2021-01-30T00:00:00", "description": "5897532", "id": "53", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -250, "balance": -10052.54, "clearedOnDate": "2021-01-30T00:00:00", "description": "TRANS", "id": "54", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 50, "balance": -10002.54, "clearedOnDate": "2021-01-30T00:00:00", "description": "VOID", "id": "58", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -500, "balance": -8804.96, "clearedOnDate": "2021-01-31T00:00:00", "description": "TRANS", "id": "50", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1800, "balance": -11964.54, "clearedOnDate": "2021-01-31T00:00:00", "description": "6565689", "id": "85", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -5932.29, "balance": -17896.83, "clearedOnDate": "2021-01-31T00:00:00", "description": "Salary", "id": "97", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -162, "balance": 11299.91, "clearedOnDate": "2021-09-01T00:00:00", "description": "DD/STO", "id": "1183", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1200, "balance": 10099.91, "clearedOnDate": "2021-09-15T00:00:00", "description": "DD/STO", "id": "1184", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -150, "balance": 9949.91, "clearedOnDate": "2021-09-28T00:00:00", "description": "DD/STO", "id": "1185", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -5.55, "balance": 9944.36, "clearedOnDate": "2021-09-28T00:00:00", "description": "DD/STO", "id": "1186", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1200, "balance": 8744.36, "clearedOnDate": "2021-10-13T00:00:00", "description": "DD/STO", "id": "1187", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -150, "balance": 8594.36, "clearedOnDate": "2021-10-28T00:00:00", "description": "DD/STO", "id": "1188", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -5.55, "balance": 8588.81, "clearedOnDate": "2021-10-28T00:00:00", "description": "DD/STO", "id": "1189", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1200, "balance": 7388.81, "clearedOnDate": "2021-11-10T00:00:00", "description": "DD/STO", "id": "1190", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -150, "balance": 7238.81, "clearedOnDate": "2021-11-28T00:00:00", "description": "DD/STO", "id": "1191", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -5.55, "balance": 7233.26, "clearedOnDate": "2021-11-28T00:00:00", "description": "DD/STO", "id": "1192", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1200, "balance": 6033.26, "clearedOnDate": "2021-12-08T00:00:00", "description": "DD/STO", "id": "1193", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -150, "balance": 5883.26, "clearedOnDate": "2021-12-28T00:00:00", "description": "DD/STO", "id": "1194", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -5.55, "balance": 5877.71, "clearedOnDate": "2021-12-28T00:00:00", "description": "DD/STO", "id": "1195", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -6511.96, "balance": -6511.96, "clearedOnDate": "2021-12-31T00:00:00", "description": "O/Bal", "id": "24", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": true, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 55, "balance": -6456.96, "clearedOnDate": "2021-12-31T00:00:00", "description": "56956", "id": "26", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -150, "balance": -6606.96, "clearedOnDate": "2021-12-31T00:00:00", "description": "656678", "id": "27", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -352, "balance": -6958.96, "clearedOnDate": "2021-12-31T00:00:00", "description": "656679", "id": "28", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -550, "balance": -7508.96, "clearedOnDate": "2021-12-31T00:00:00", "description": "656680", "id": "29", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -250, "balance": -7758.96, "clearedOnDate": "2021-12-31T00:00:00", "description": "656681", "id": "30", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -546, "balance": -8304.96, "clearedOnDate": "2021-12-31T00:00:00", "description": "656869", "id": "31", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -162, "balance": 5715.71, "clearedOnDate": "2022-01-01T00:00:00", "description": "DD/STO", "id": "1196", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1200, "balance": 4515.71, "clearedOnDate": "2022-01-05T00:00:00", "description": "DD/STO", "id": "1197", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -150, "balance": 4365.71, "clearedOnDate": "2022-01-28T00:00:00", "description": "DD/STO", "id": "1198", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -5.55, "balance": 4360.16, "clearedOnDate": "2022-01-28T00:00:00", "description": "DD/STO", "id": "1199", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -370.71, "balance": -18267.54, "clearedOnDate": "2022-01-29T00:00:00", "description": "(BACS)", "id": "255", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -256.36, "balance": -18523.9, "clearedOnDate": "2022-01-29T00:00:00", "description": "100001", "id": "256", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -25.5, "balance": -18549.4, "clearedOnDate": "2022-01-29T00:00:00", "description": "100002", "id": "257", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1977.58, "balance": -20526.98, "clearedOnDate": "2022-01-29T00:00:00", "description": "100003", "id": "258", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -599.03, "balance": -21126.01, "clearedOnDate": "2022-01-29T00:00:00", "description": "100004", "id": "259", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -7141.98, "balance": -28267.99, "clearedOnDate": "2022-01-29T00:00:00", "description": "100005", "id": "260", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -150.96, "balance": -28418.95, "clearedOnDate": "2022-01-29T00:00:00", "description": "100006", "id": "261", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -63, "balance": -28481.95, "clearedOnDate": "2022-01-29T00:00:00", "description": "100007", "id": "262", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -35.01, "balance": -28516.96, "clearedOnDate": "2022-01-29T00:00:00", "description": "100008", "id": "263", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1659.34, "balance": -30176.3, "clearedOnDate": "2022-01-29T00:00:00", "description": "100009", "id": "264", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 1432.17, "balance": -28744.13, "clearedOnDate": "2022-01-29T00:00:00", "description": "4353454", "id": "265", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 2684.26, "balance": -26059.87, "clearedOnDate": "2022-01-29T00:00:00", "description": "", "id": "266", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 1204.57, "balance": -24855.3, "clearedOnDate": "2022-01-29T00:00:00", "description": "", "id": "267", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 1140.78, "balance": -23714.52, "clearedOnDate": "2022-01-29T00:00:00", "description": "", "id": "268", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 4372, "balance": -19342.52, "clearedOnDate": "2022-01-29T00:00:00", "description": "", "id": "269", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 1946.18, "balance": -17396.34, "clearedOnDate": "2022-01-29T00:00:00", "description": "", "id": "270", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 11123.33, "balance": -6273.01, "clearedOnDate": "2022-01-29T00:00:00", "description": "", "id": "271", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1200, "balance": 3160.16, "clearedOnDate": "2022-02-02T00:00:00", "description": "DD/STO", "id": "1200", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -500, "balance": -16588.09, "clearedOnDate": "2022-02-03T00:00:00", "description": "TRANS", "id": "300", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -150, "balance": 3010.16, "clearedOnDate": "2022-02-28T00:00:00", "description": "DD/STO", "id": "1201", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -5.55, "balance": 3004.61, "clearedOnDate": "2022-02-28T00:00:00", "description": "DD/STO", "id": "1202", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -500, "balance": -6773.01, "clearedOnDate": "2022-02-28T00:00:00", "description": "Credit", "id": "276", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -58.75, "balance": -6831.76, "clearedOnDate": "2022-02-28T00:00:00", "description": "", "id": "279", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1400, "balance": -8231.76, "clearedOnDate": "2022-02-28T00:00:00", "description": "TRANS", "id": "280", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -12600, "balance": -20831.76, "clearedOnDate": "2022-02-28T00:00:00", "description": "TRANS", "id": "282", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 6500, "balance": -14331.76, "clearedOnDate": "2022-02-28T00:00:00", "description": "TRANS", "id": "286", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1256.33, "balance": -15588.09, "clearedOnDate": "2022-02-28T00:00:00", "description": "PAYE", "id": "287", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -500, "balance": -16088.09, "clearedOnDate": "2022-02-28T00:00:00", "description": "Deposit", "id": "288", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -162, "balance": -16750.09, "clearedOnDate": "2022-02-28T00:00:00", "description": "DD/STO", "id": "314", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1200, "balance": -17950.09, "clearedOnDate": "2022-02-28T00:00:00", "description": "DD/STO", "id": "315", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -150, "balance": -18100.09, "clearedOnDate": "2022-02-28T00:00:00", "description": "Loan", "id": "325", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -5.55, "balance": -18105.64, "clearedOnDate": "2022-02-28T00:00:00", "description": "Loan", "id": "326", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 103.4, "balance": -18002.24, "clearedOnDate": "2022-02-28T00:00:00", "description": "Returned", "id": "328", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -5932.29, "balance": -23934.53, "clearedOnDate": "2022-02-28T00:00:00", "description": "Salary", "id": "331", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 6556.33, "balance": -17378.2, "clearedOnDate": "2022-02-28T00:00:00", "description": "", "id": "523", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 3350.33, "balance": -14027.87, "clearedOnDate": "2022-02-28T00:00:00", "description": "", "id": "525", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -435.14, "balance": -14463.01, "clearedOnDate": "2022-02-28T00:00:00", "description": "(BACS)", "id": "526", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -8561.48, "balance": -23024.49, "clearedOnDate": "2022-02-28T00:00:00", "description": "12324", "id": "529", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 352.5, "balance": -22671.99, "clearedOnDate": "2022-03-01T00:00:00", "description": "VOID", "id": "532", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 55, "balance": -22616.99, "clearedOnDate": "2022-03-01T00:00:00", "description": "SED", "id": "534", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1200, "balance": 1804.61, "clearedOnDate": "2022-03-02T00:00:00", "description": "DD/STO", "id": "1203", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 1908.89, "balance": -14370.08, "clearedOnDate": "2022-03-10T00:00:00", "description": "", "id": "821", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 9057.34, "balance": -16278.97, "clearedOnDate": "2022-03-20T00:00:00", "description": "776", "id": "820", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -150, "balance": -22370.09, "clearedOnDate": "2022-03-24T00:00:00", "description": "Deposit", "id": "606", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 100, "balance": -22270.09, "clearedOnDate": "2022-03-25T00:00:00", "description": "44555", "id": "607", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 1770.15, "balance": -12229.5, "clearedOnDate": "2022-03-25T00:00:00", "description": "", "id": "823", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -15, "balance": -22084.91, "clearedOnDate": "2022-03-27T00:00:00", "description": "456", "id": "578", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -100, "balance": -22370.09, "clearedOnDate": "2022-03-27T00:00:00", "description": "CREDIT", "id": "608", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 1025.86, "balance": -11203.64, "clearedOnDate": "2022-03-27T00:00:00", "description": "", "id": "824", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -150, "balance": 1654.61, "clearedOnDate": "2022-03-28T00:00:00", "description": "DD/STO", "id": "1204", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -5.55, "balance": 1649.06, "clearedOnDate": "2022-03-28T00:00:00", "description": "DD/STO", "id": "1205", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -162, "balance": -22778.99, "clearedOnDate": "2022-03-28T00:00:00", "description": "DD/STO", "id": "546", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1200, "balance": -23978.99, "clearedOnDate": "2022-03-28T00:00:00", "description": "DD/STO", "id": "547", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -150, "balance": -24128.99, "clearedOnDate": "2022-03-28T00:00:00", "description": "DD/STO", "id": "548", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -5.55, "balance": -24134.54, "clearedOnDate": "2022-03-28T00:00:00", "description": "DD/STO", "id": "549", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 50, "balance": -24084.54, "clearedOnDate": "2022-03-28T00:00:00", "description": "VOID", "id": "555", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 64.63, "balance": -24019.91, "clearedOnDate": "2022-03-28T00:00:00", "description": "REFUND", "id": "560", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 2000, "balance": -22019.91, "clearedOnDate": "2022-03-28T00:00:00", "description": "TRANS", "id": "562", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -50, "balance": -22069.91, "clearedOnDate": "2022-03-28T00:00:00", "description": "TRANS", "id": "563", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -70.31, "balance": -22155.22, "clearedOnDate": "2022-03-28T00:00:00", "description": "CREDIT", "id": "584", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 30, "balance": -22125.22, "clearedOnDate": "2022-03-28T00:00:00", "description": "VOID", "id": "589", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 35.01, "balance": -22090.21, "clearedOnDate": "2022-03-28T00:00:00", "description": "REFUND", "id": "596", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -2070.23, "balance": -24160.44, "clearedOnDate": "2022-03-28T00:00:00", "description": "PAYE", "id": "597", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1003.49, "balance": -25163.93, "clearedOnDate": "2022-03-28T00:00:00", "description": "NI", "id": "598", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 3000, "balance": -22163.93, "clearedOnDate": "2022-03-28T00:00:00", "description": "TRANS", "id": "604", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -56.16, "balance": -22220.09, "clearedOnDate": "2022-03-28T00:00:00", "description": "225", "id": "605", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": -1003.49, "balance": -29305.87, "clearedOnDate": "2022-03-29T00:00:00", "description": "NI", "id": "612", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}, {"accountId": "1200", "amount": 179.2, "balance": -29126.67, "clearedOnDate": "2022-03-29T00:00:00", "description": "Sales", "id": "614", "modifiedDate": "2023-03-30T14:42:44Z", "reconciled": false, "sourceModifiedDate": "2022-11-25T09:43:54", "transactionType": "Credit"}], "totalResults": 179} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts/154d05abe9f24c4babe0f6a741dec1b9/bankTransactions"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts/154d05abe9f24c4babe0f6a741dec1b9/bankTransactions"}}, "pageNumber": 1, "pageSize": 100, "results": [{"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": -5, "clearedOnDate": "2020-02-05T00:00:00", "description": "string Supplier Payment", "id": "26b727ca84734e3c8e245011bd04dbf1", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2020-02-07T11:35:39Z", "transactionType": "Credit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": -3.86, "clearedOnDate": "2020-02-05T00:00:00", "description": "string Supplier Payment", "id": "508f3fd4403e45cb903b362a4ae55344", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2020-02-10T10:51:43Z", "transactionType": "Credit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": -3.85, "clearedOnDate": "2020-02-05T00:00:00", "description": "string Supplier Payment", "id": "52e58431005e44328af44116e0433230", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2020-02-07T14:36:01Z", "transactionType": "Credit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": -3.86, "clearedOnDate": "2020-02-05T00:00:00", "description": "string Supplier Payment", "id": "f3255e4b79c5427ba5b963d0e26cecfc", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2020-02-07T14:19:24Z", "transactionType": "Credit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": 1000, "clearedOnDate": "2020-04-21T00:00:00", "description": "Cash Deposit Bank Transfer", "id": "a00e1ce357cc4064b9cce8abe1b15110", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2020-04-21T21:03:25Z", "transactionType": "Debit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": -40, "clearedOnDate": "2020-11-25T00:00:00", "description": "Bank Transfer", "id": "a7d26740129945c3a76209020fbb7fd1", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2020-11-25T19:35:03Z", "transactionType": "Credit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": 10, "clearedOnDate": "2021-07-02T00:00:00", "description": "Made from codat api Customer Receipt", "id": "829f45112347471cbf99b0d9afe08113", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2021-07-02T13:14:57Z", "transactionType": "Debit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": -2400, "clearedOnDate": "2021-07-20T00:00:00", "description": "Supplier payment AD Supplier Payment", "id": "786f769ae88a4fa898e25e2cbff43be3", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2021-07-22T14:12:38Z", "transactionType": "Credit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": 12, "clearedOnDate": "2021-07-21T00:00:00", "description": "Payment Customer Receipt", "id": "abb5995867c546c2b32097d515dcef2a", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2021-07-21T14:09:59Z", "transactionType": "Debit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": 50, "clearedOnDate": "2021-08-17T00:00:00", "description": "Ref5565 Other Receipt", "id": "943f3bd6eacc4071807d89895fe03ef4", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2021-08-17T11:58:37Z", "transactionType": "Debit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": 1080, "clearedOnDate": "2021-09-22T00:00:00", "description": "Note 1 Customer Receipt", "id": "039e6bb20b6e44d690601e4dd04a5b21", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2021-09-22T14:22:57Z", "transactionType": "Debit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": 1080, "clearedOnDate": "2021-09-27T00:00:00", "description": "Note 2 Customer Receipt", "id": "1a62f54358e74ba4a71dd733f2b08ba4", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2021-09-27T14:04:05Z", "transactionType": "Debit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": 33, "clearedOnDate": "2021-12-01T00:00:00", "description": "Payment Customer Receipt", "id": "a79ebcf0710d415baad6b588eb28307b", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2021-12-01T13:03:00Z", "transactionType": "Debit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": -10, "clearedOnDate": "2022-07-19T00:00:00", "description": "Bank Transfer", "id": "4b691b78b6cd43c9a64d75aeb29e4d11", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2022-07-19T08:51:52Z", "transactionType": "Credit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": -1415, "clearedOnDate": "2022-07-19T00:00:00", "description": "Bank Transfer", "id": "7b1f2f55f39042838d5f7226aa92386f", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2022-07-19T13:15:26Z", "transactionType": "Credit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": -10, "clearedOnDate": "2022-07-19T00:00:00", "description": "Bank Transfer", "id": "87eca750292b4cfea216e13bb22923c6", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2022-07-19T13:01:47Z", "transactionType": "Credit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": -10, "clearedOnDate": "2022-07-19T00:00:00", "description": "Bank Transfer", "id": "a48474f83d214637a700e76e24446086", "modifiedDate": "2022-10-24T15:31:14Z", "reconciled": false, "sourceModifiedDate": "2022-07-19T13:10:42Z", "transactionType": "Credit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": 69, "clearedOnDate": "2022-09-14T00:00:00", "description": "string Customer Receipt", "id": "cc1fc960e05c40c1968314efe1175b9f", "modifiedDate": "2022-10-24T15:31:15Z", "reconciled": false, "sourceModifiedDate": "2022-09-14T16:20:09Z", "transactionType": "Debit"}, {"accountId": "154d05abe9f24c4babe0f6a741dec1b9", "amount": 60, "clearedOnDate": "2022-09-14T00:00:00", "description": "Customer Receipt", "id": "e600eb7549b74d96bdca18b9cc60f39d", "modifiedDate": "2022-10-24T15:31:15Z", "reconciled": false, "sourceModifiedDate": "2022-09-14T16:12:03Z", "transactionType": "Debit"}], "totalResults": 19} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/bankAccounts/bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4/bankTransactions"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/bankAccounts/bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4/bankTransactions"}}, "pageNumber": 1, "pageSize": 100, "results": [{"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -7267.2, "balance": -3136.22, "clearedOnDate": "2021-12-20T00:00:00", "description": "DD", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 500, "balance": -5703.42, "clearedOnDate": "2022-02-17T00:00:00", "description": "DD", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 4200, "balance": -6203.42, "clearedOnDate": "2022-02-17T00:00:00", "description": "INV0010", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -7267.2, "balance": -10403.42, "clearedOnDate": "2022-02-17T00:00:00", "description": "DD", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -95.5, "balance": -5798.92, "clearedOnDate": "2022-02-19T00:00:00", "description": "DD", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 500, "balance": -5298.92, "clearedOnDate": "2022-03-19T00:00:00", "description": "DD", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -97, "balance": -5395.92, "clearedOnDate": "2022-03-21T00:00:00", "description": "DD", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 500, "balance": -4895.92, "clearedOnDate": "2022-04-19T00:00:00", "description": "INV-0003", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -92, "balance": -4987.92, "clearedOnDate": "2022-04-21T00:00:00", "description": "DD", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 1000, "balance": -3987.92, "clearedOnDate": "2022-05-21T00:00:00", "description": "INV-0004", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -89, "balance": -4076.92, "clearedOnDate": "2022-05-21T00:00:00", "description": "DD", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 500, "balance": -3576.92, "clearedOnDate": "2022-06-19T00:00:00", "description": "INV-005", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -91, "balance": -3667.92, "clearedOnDate": "2022-06-21T00:00:00", "description": "DD", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 500, "balance": -3167.92, "clearedOnDate": "2022-07-20T00:00:00", "description": "INV-006", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -96.25, "balance": -3264.17, "clearedOnDate": "2022-07-22T00:00:00", "description": "DD", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 1500, "balance": -1764.17, "clearedOnDate": "2022-08-19T00:00:00", "description": "INV-007", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -100.6, "balance": -1864.77, "clearedOnDate": "2022-08-21T00:00:00", "description": "DD", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 500, "balance": -1364.77, "clearedOnDate": "2022-09-19T00:00:00", "description": "INV-008", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -105.75, "balance": -1470.52, "clearedOnDate": "2022-09-21T00:00:00", "description": "DD", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 1200, "balance": -270.52, "clearedOnDate": "2022-10-19T00:00:00", "description": "INV-009", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -106.5, "balance": -377.02, "clearedOnDate": "2022-10-21T00:00:00", "description": "DD", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 500, "balance": 122.98, "clearedOnDate": "2022-11-20T00:00:00", "description": "INV-0010", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -119.08, "balance": 3.9, "clearedOnDate": "2022-11-21T00:00:00", "description": "DD", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -15, "balance": -11.1, "clearedOnDate": "2022-11-22T00:00:00", "description": "Monthly a/c fee", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -3126.17, "balance": -1591.58, "clearedOnDate": "2022-11-23T00:00:00", "description": "FP089876", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -56.35, "balance": -89.16, "clearedOnDate": "2022-11-23T00:00:00", "description": "Subs DD", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 541.25, "balance": 1534.59, "clearedOnDate": "2022-11-23T00:00:00", "description": "0015", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 541.25, "balance": 993.34, "clearedOnDate": "2022-11-23T00:00:00", "description": "INV-0014", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -21.71, "balance": -32.81, "clearedOnDate": "2022-11-23T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 541.25, "balance": 452.09, "clearedOnDate": "2022-11-23T00:00:00", "description": "INV-0013", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 541.25, "balance": -1050.33, "clearedOnDate": "2022-11-24T00:00:00", "description": "INV0012", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -65.2, "balance": -1115.53, "clearedOnDate": "2022-12-01T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -15.6, "balance": -1131.13, "clearedOnDate": "2022-12-02T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 1500, "balance": 368.87, "clearedOnDate": "2022-12-09T00:00:00", "description": "AR-0019", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -148.5, "balance": 220.37, "clearedOnDate": "2022-12-11T00:00:00", "description": "CHQ 6543-000409", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -16, "balance": 204.37, "clearedOnDate": "2022-12-16T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -50, "balance": 154.37, "clearedOnDate": "2022-12-19T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 2500, "balance": 2583.57, "clearedOnDate": "2022-12-20T00:00:00", "description": "AR-0011", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -70.8, "balance": 83.57, "clearedOnDate": "2022-12-20T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -1463.88, "balance": 1449.49, "clearedOnDate": "2022-12-23T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 329.8, "balance": 2913.37, "clearedOnDate": "2022-12-23T00:00:00", "description": "AR-0018", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -15, "balance": 1434.49, "clearedOnDate": "2022-12-23T00:00:00", "description": "Bank Fee", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -1181.25, "balance": 253.24, "clearedOnDate": "2022-12-23T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -1223.91, "balance": -970.67, "clearedOnDate": "2022-12-29T00:00:00", "description": "FP101897", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -98.32, "balance": -1177.59, "clearedOnDate": "2023-01-19T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -108.6, "balance": -1079.27, "clearedOnDate": "2023-01-19T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 6187.5, "balance": 5009.91, "clearedOnDate": "2023-01-19T00:00:00", "description": "AR-0020", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -1181.25, "balance": 3828.66, "clearedOnDate": "2023-01-20T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -59.54, "balance": 3769.12, "clearedOnDate": "2023-01-20T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -56.35, "balance": 3712.77, "clearedOnDate": "2023-01-21T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 1407.25, "balance": 5120.02, "clearedOnDate": "2023-01-22T00:00:00", "description": "INV0022", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 1000, "balance": 6120.02, "clearedOnDate": "2023-01-23T00:00:00", "description": "0024", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -148.5, "balance": 5971.52, "clearedOnDate": "2023-01-24T00:00:00", "description": "CHQ 6543-000410", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 579.37, "balance": 6550.89, "clearedOnDate": "2023-01-25T00:00:00", "description": "0027-Part", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 541.25, "balance": 7092.14, "clearedOnDate": "2023-01-26T00:00:00", "description": "Inv 0029", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 541.25, "balance": 8715.89, "clearedOnDate": "2023-01-26T00:00:00", "description": "INV0032", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 541.25, "balance": 7633.39, "clearedOnDate": "2023-01-26T00:00:00", "description": "0030", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 541.25, "balance": 8174.64, "clearedOnDate": "2023-01-26T00:00:00", "description": "INV-0031", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -34.1, "balance": 8681.79, "clearedOnDate": "2023-01-27T00:00:00", "description": "Eft", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 250, "balance": 8931.79, "clearedOnDate": "2023-01-28T00:00:00", "description": "033-Full", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -49.2, "balance": 8882.59, "clearedOnDate": "2023-01-30T00:00:00", "description": "Eft", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -22, "balance": 8860.59, "clearedOnDate": "2023-01-31T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -69.5, "balance": 8791.09, "clearedOnDate": "2023-02-01T00:00:00", "description": "CHQ 6543-000411", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -5953.75, "balance": 2837.34, "clearedOnDate": "2023-02-02T00:00:00", "description": "08-4123", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -1500, "balance": 1337.34, "clearedOnDate": "2023-02-03T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -29.5, "balance": 1307.84, "clearedOnDate": "2023-02-06T00:00:00", "description": "Exps", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": true, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -1181.25, "balance": 6314.09, "clearedOnDate": "2023-02-07T00:00:00", "description": "Rent", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 6187.5, "balance": 7495.34, "clearedOnDate": "2023-02-07T00:00:00", "description": "INV-0035", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 100, "balance": 1914.09, "clearedOnDate": "2023-02-08T00:00:00", "description": "0017-Part", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 2000, "balance": 3914.09, "clearedOnDate": "2023-02-08T00:00:00", "description": "DEPOSIT ADV", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -4500, "balance": 1814.09, "clearedOnDate": "2023-02-08T00:00:00", "description": "0195 0210", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -15.75, "balance": 3898.34, "clearedOnDate": "2023-02-09T00:00:00", "description": "Eft", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -15.5, "balance": 3882.84, "clearedOnDate": "2023-02-10T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -59.55, "balance": 3811.39, "clearedOnDate": "2023-02-11T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -11.9, "balance": 3870.94, "clearedOnDate": "2023-02-11T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -29.8, "balance": 4769.59, "clearedOnDate": "2023-02-12T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 1000, "balance": 4811.39, "clearedOnDate": "2023-02-12T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -12, "balance": 4799.39, "clearedOnDate": "2023-02-12T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -12, "balance": 4757.59, "clearedOnDate": "2023-02-13T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -49.9, "balance": 4588.09, "clearedOnDate": "2023-02-13T00:00:00", "description": "Sub 092201", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -85, "balance": 4672.59, "clearedOnDate": "2023-02-13T00:00:00", "description": "Reg 8018922", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -34.6, "balance": 4637.99, "clearedOnDate": "2023-02-13T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 450, "balance": 6526.09, "clearedOnDate": "2023-02-14T00:00:00", "description": "Sublet RM2031", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -12, "balance": 4576.09, "clearedOnDate": "2023-02-14T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 1500, "balance": 6076.09, "clearedOnDate": "2023-02-14T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -12, "balance": 6499.79, "clearedOnDate": "2023-02-15T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 35, "balance": 6534.79, "clearedOnDate": "2023-02-15T00:00:00", "description": "CR 092201", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -14.3, "balance": 6511.79, "clearedOnDate": "2023-02-15T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": 200, "balance": 6712.29, "clearedOnDate": "2023-02-16T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -10.5, "balance": 6512.29, "clearedOnDate": "2023-02-16T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -15, "balance": 6697.29, "clearedOnDate": "2023-02-16T00:00:00", "description": "Fee", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -15.5, "balance": 6681.79, "clearedOnDate": "2023-02-16T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}, {"accountId": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "amount": -12, "balance": 6522.79, "clearedOnDate": "2023-02-16T00:00:00", "description": "", "modifiedDate": "2023-03-15T20:37:10Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Unknown"}], "totalResults": 93} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts/104957000000060010/bankTransactions"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts/104957000000060010/bankTransactions"}}, "pageNumber": 1, "pageSize": 100, "results": [{"accountId": "104957000000060010", "amount": 9001, "clearedOnDate": "2020-02-06T00:00:00", "description": "", "id": "104957000000060010-104957000000070175", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Cash"}, {"accountId": "104957000000060010", "amount": 10000, "clearedOnDate": "2020-02-12T00:00:00", "description": "", "id": "104957000000060010-104957000000060014", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Dep"}, {"accountId": "104957000000060010", "amount": 9001, "clearedOnDate": "2020-02-14T00:00:00", "description": "", "id": "104957000000060010-104957000000067014", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Cash"}, {"accountId": "104957000000060010", "amount": 11980, "clearedOnDate": "2020-02-17T00:00:00", "description": "", "id": "104957000000060010-104957000000070035", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Debit"}, {"accountId": "104957000000060010", "amount": -20, "clearedOnDate": "2020-02-17T00:00:00", "description": "", "id": "104957000000060010-104957000000070055", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "104957000000060010", "amount": 10789.21, "clearedOnDate": "2020-02-17T00:00:00", "description": "", "id": "104957000000060010-104957000000070097", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Cash"}, {"accountId": "104957000000060010", "amount": 10000, "clearedOnDate": "2020-02-26T00:00:00", "description": "", "id": "104957000000060010-104957000000097011", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Cash"}, {"accountId": "104957000000060010", "amount": -72, "clearedOnDate": "2020-02-27T00:00:00", "description": "", "id": "104957000000060010-104957000000099013", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "104957000000060010", "amount": 10, "clearedOnDate": "2020-02-27T00:00:00", "description": "", "id": "104957000000060010-104957000000099053", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Debit"}, {"accountId": "104957000000060010", "amount": 9000, "clearedOnDate": "2020-05-19T00:00:00", "description": "", "id": "104957000000060010-104957000000137017", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Cash"}, {"accountId": "104957000000060010", "amount": -20, "clearedOnDate": "2020-12-01T00:00:00", "description": "", "id": "104957000000060010-104957000000336002", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Xfer"}, {"accountId": "104957000000060010", "amount": 1.79, "clearedOnDate": "2020-12-01T00:00:00", "description": "", "id": "104957000000060010-104957000000336020", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Xfer"}, {"accountId": "104957000000060010", "amount": 200, "clearedOnDate": "2021-04-12T00:00:00", "description": "", "id": "104957000000060010-104957000001706009", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Cash"}, {"accountId": "104957000000060010", "amount": -50, "clearedOnDate": "2022-05-12T00:00:00", "description": "", "id": "104957000000060010-104957000001469026", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Credit"}, {"accountId": "104957000000060010", "amount": 18.98, "clearedOnDate": "2022-05-13T00:00:00", "description": "", "id": "104957000000060010-104957000001480001", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Debit"}, {"accountId": "104957000000060010", "amount": -20, "clearedOnDate": "2022-05-13T00:00:00", "description": "", "id": "104957000000060010-104957000001480045", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Credit"}, {"accountId": "104957000000060010", "amount": 26, "clearedOnDate": "2022-07-27T00:00:00", "description": "", "id": "104957000000060010-104957000001633002", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Other"}, {"accountId": "104957000000060010", "amount": 11.75, "clearedOnDate": "2022-08-08T00:00:00", "description": "", "id": "104957000000060010-104957000001652007", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Other"}, {"accountId": "104957000000060010", "amount": -2.89, "clearedOnDate": "2022-08-24T00:00:00", "description": "", "id": "104957000000060010-104957000001689069", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Payment"}, {"accountId": "104957000000060010", "amount": 3.6, "clearedOnDate": "2022-08-25T00:00:00", "description": "", "id": "104957000000060010-104957000001689125", "modifiedDate": "2022-10-03T08:40:40Z", "reconciled": false, "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionType": "Debit"}], "totalResults": 20} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-accounting-bank-account: + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "200": + application/json: {"accountName": "55", "accountNumber": "", "accountType": "Unknown", "balance": -352.03, "currency": "GBP", "iBan": "", "id": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "nominalCode": "10500", "overdraftLimit": 0, "sortCode": "", "sourceModifiedDate": "2023-02-07T00:00:00", "status": "Active"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "200": + application/json: {"accountName": "\\w3fw", "accountNumber": "A06268209", "accountType": "Debit", "availableBalance": -10484.65, "balance": -10484.65, "currency": "GBP", "id": "738783", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sortCode": "236972", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "200": + application/json: {"accountName": "16th Account", "accountType": "Unknown", "availableBalance": 326, "balance": 326, "currency": "GBP", "id": "765768", "modifiedDate": "2022-09-30T10:29:16Z", "nominalCode": "70700", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "200": + application/json: {"accountName": "Checking", "accountType": "Unknown", "availableBalance": 46954.1, "balance": 46954.1, "currency": "GBP", "id": "20000-933270541", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:37Z", "nominalCode": "10100", "sourceModifiedDate": "2023-12-16T05:06:45", "status": "Active"} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "200": + application/json: {"accountName": "Bank Current Account", "accountNumber": "003234234", "accountType": "Unknown", "availableBalance": -20091.04, "balance": -20091.04, "currency": "GBP", "iBan": "", "id": "1200", "institution": "Lloyds Bank PLC", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "nominalCode": "1200", "overdraftLimit": 120000, "sortCode": "23-34-34", "sourceModifiedDate": "2022-11-25T09:25:48", "status": "Active"} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "200": + application/json: {"accountName": "Abdi Internet Bank", "accountNumber": "11111", "accountType": "Unknown", "availableBalance": 49.61, "balance": 49.61, "currency": "GBP", "id": "154d05abe9f24c4babe0f6a741dec1b9", "modifiedDate": "2022-10-24T14:52:53Z", "nominalCode": "1560", "sortCode": "010101", "sourceModifiedDate": "2020-01-27T10:53:26Z", "status": "Active"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "200": + application/json: {"accountName": "Business Bank Account", "accountNumber": "987654321", "accountType": "Debit", "balance": 6681.79, "currency": "GBP", "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "sortCode": "990404", "sourceModifiedDate": "2023-03-15T20:35:07", "status": "Active"} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "200": + application/json: {"accountName": "Abdi Test", "accountNumber": "xxxx5678", "accountType": "Unknown", "balance": 69858.44, "currency": "GBP", "id": "104957000000060010", "institution": "Test Bank", "modifiedDate": "2022-10-03T08:40:38Z", "sortCode": "112233", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "200": + application/json: {"accountName": "Codat Europe Bank", "accountType": "Debit", "balance": 558.22, "currency": "GBP", "id": "825", "metadata": {"isDeleted": false}, "modifiedDate": "2023-05-02T13:24:36Z", "nominalCode": "111111122222111", "sourceModifiedDate": "2022-07-15T11:34:02", "status": "Active"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "200": + application/json: {"accountName": "00", "accountType": "Debit", "availableBalance": 0, "balance": 0, "currency": "GBP", "id": "164", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:57Z", "nominalCode": "123567", "sourceModifiedDate": "2022-07-20T14:11:28Z", "status": "Active"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "200": + application/json: {"accountName": "\\aa", "accountType": "Debit", "availableBalance": 123, "balance": 123, "currency": "GBP", "id": "202", "modifiedDate": "2023-01-18T11:02:37Z", "sourceModifiedDate": "2022-11-11T14:15:13Z", "status": "Active"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "200": + application/json: {"accountName": "CoT Credit Card", "accountType": "Credit", "currency": "GBP", "id": "CREDITCARD:55", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:46Z", "nominalCode": "10021", "sourceModifiedDate": "2023-03-27T14:11:48", "status": "Active"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounting-bank-accounts: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "55", "accountNumber": "", "accountType": "Unknown", "balance": -352.03, "currency": "GBP", "iBan": "", "id": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "nominalCode": "10500", "overdraftLimit": 0, "sortCode": "", "sourceModifiedDate": "2023-02-07T00:00:00", "status": "Active"}, {"accountName": "555", "accountNumber": "", "accountType": "Unknown", "balance": 661.79, "currency": "PLN", "iBan": "", "id": "47020f80-60e6-ec11-82f8-0022481a77f0", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "nominalCode": "40300", "overdraftLimit": 0, "sortCode": "", "sourceModifiedDate": "2022-06-07T00:00:00", "status": "Active"}], "totalResults": 28} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "\\w3fw", "accountNumber": "A06268209", "accountType": "Debit", "availableBalance": -10484.65, "balance": -10484.65, "currency": "GBP", "id": "738783", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sortCode": "236972", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"accountName": "2e2bna45hy\\", "accountNumber": "D01825250", "accountType": "Debit", "availableBalance": -114.4, "balance": -114.4, "currency": "GBP", "id": "738778", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sortCode": "236972", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 82} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "16th Account", "accountType": "Unknown", "availableBalance": 326, "balance": 326, "currency": "GBP", "id": "765768", "modifiedDate": "2022-09-30T10:29:16Z", "nominalCode": "70700", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"accountName": "1a1a", "accountType": "Unknown", "availableBalance": 0, "balance": 0, "currency": "GBP", "id": "765766", "modifiedDate": "2022-09-30T10:29:16Z", "nominalCode": "70600", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 56} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Codat Europe Bank", "accountType": "Debit", "balance": 558.22, "currency": "GBP", "id": "825", "metadata": {"isDeleted": false}, "modifiedDate": "2023-05-02T13:24:36Z", "nominalCode": "111111122222111", "sourceModifiedDate": "2022-07-15T11:34:02", "status": "Active"}, {"accountName": "Codat Europe Bank USD", "accountType": "Debit", "currency": "USD", "id": "826", "metadata": {"isDeleted": false}, "modifiedDate": "2023-05-02T13:24:36Z", "nominalCode": "1133221133", "sourceModifiedDate": "2021-03-26T10:31:40", "status": "Active"}], "totalResults": 4} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Checking", "accountType": "Unknown", "availableBalance": 46954.1, "balance": 46954.1, "currency": "GBP", "id": "20000-933270541", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:37Z", "nominalCode": "10100", "sourceModifiedDate": "2023-12-16T05:06:45", "status": "Active"}, {"accountName": "Petty Cash", "accountType": "Unknown", "availableBalance": 500, "balance": 500, "currency": "GBP", "id": "550001-1071509830", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:37Z", "nominalCode": "10400", "sourceModifiedDate": "2023-12-16T05:06:45", "status": "Active"}], "totalResults": 3} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "00", "accountType": "Debit", "availableBalance": 0, "balance": 0, "currency": "GBP", "id": "164", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:57Z", "nominalCode": "123567", "sourceModifiedDate": "2022-07-20T14:11:28Z", "status": "Active"}, {"accountName": "11", "accountType": "Debit", "availableBalance": 0, "balance": 0, "currency": "GBP", "id": "163", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:57Z", "sourceModifiedDate": "2022-07-20T14:11:28Z", "status": "Active"}], "totalResults": 57} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "\\aa", "accountType": "Debit", "availableBalance": 123, "balance": 123, "currency": "GBP", "id": "202", "modifiedDate": "2023-01-18T11:02:37Z", "sourceModifiedDate": "2022-11-11T14:15:13Z", "status": "Active"}, {"accountName": "1 year ago", "accountType": "Debit", "availableBalance": 5300.02, "balance": 5300.02, "currency": "GBP", "id": "193", "modifiedDate": "2023-01-18T11:02:37Z", "sourceModifiedDate": "2023-01-18T06:05:12Z", "status": "Active"}], "totalResults": 140} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Bank Current Account", "accountNumber": "003234234", "accountType": "Unknown", "availableBalance": -20091.04, "balance": -20091.04, "currency": "GBP", "iBan": "", "id": "1200", "institution": "Lloyds Bank PLC", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "nominalCode": "1200", "overdraftLimit": 120000, "sortCode": "23-34-34", "sourceModifiedDate": "2022-11-25T09:25:48", "status": "Active"}, {"accountName": "Bank Deposit Account", "accountNumber": "9/00474345", "accountType": "Unknown", "availableBalance": 3510, "balance": 3510, "currency": "GBP", "iBan": "", "id": "1210", "institution": "Halifax Building Society", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "nominalCode": "1210", "overdraftLimit": 0, "sortCode": "45-45-45", "sourceModifiedDate": "2022-11-25T09:25:48", "status": "Active"}], "totalResults": 6} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Abdi Internet Bank", "accountNumber": "11111", "accountType": "Unknown", "availableBalance": 49.61, "balance": 49.61, "currency": "GBP", "id": "154d05abe9f24c4babe0f6a741dec1b9", "modifiedDate": "2022-10-24T14:52:53Z", "nominalCode": "1560", "sortCode": "010101", "sourceModifiedDate": "2020-01-27T10:53:26Z", "status": "Active"}, {"accountName": "Abdi Live Test", "accountNumber": "1234567", "accountType": "Unknown", "availableBalance": -225830.75, "balance": -225830.75, "currency": "GBP", "id": "565ce07212bc492c8c2d04f43f9f67e3", "modifiedDate": "2022-10-24T14:52:53Z", "nominalCode": "147852", "sortCode": "123456", "sourceModifiedDate": "2020-01-28T14:00:20Z", "status": "Active"}], "totalResults": 45} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "CoT Credit Card", "accountType": "Credit", "currency": "GBP", "id": "CREDITCARD:55", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:46Z", "nominalCode": "10021", "sourceModifiedDate": "2023-03-27T14:11:48", "status": "Active"}, {"accountName": "Cot Credit Card 2", "accountType": "Credit", "currency": "GBP", "id": "CREDITCARD:58", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:46Z", "nominalCode": "11112", "sourceModifiedDate": "2023-03-27T14:15:11", "status": "Active"}], "totalResults": 14} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/bankAccounts?page=1&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Business Bank Account", "accountNumber": "987654321", "accountType": "Debit", "balance": 6681.79, "currency": "GBP", "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "sortCode": "990404", "sourceModifiedDate": "2023-03-15T20:35:07", "status": "Active"}, {"accountName": "Business Savings Account", "accountNumber": "876543210", "accountType": "Debit", "balance": 0, "currency": "GBP", "id": "a8d6fb1a-8c5d-4683-90ce-bf9d28fc62ba", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "sortCode": "890303", "sourceModifiedDate": "2023-03-15T20:36:06", "status": "Active"}], "totalResults": 2} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Abdi Test", "accountNumber": "xxxx5678", "accountType": "Unknown", "balance": 69858.44, "currency": "GBP", "id": "104957000000060010", "institution": "Test Bank", "modifiedDate": "2022-10-03T08:40:38Z", "sortCode": "112233", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"accountName": "Abdi Test 2", "accountNumber": "", "accountType": "Unknown", "balance": 98.03, "currency": "AED", "id": "104957000000065002", "institution": "", "modifiedDate": "2022-10-03T08:40:38Z", "sortCode": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 4} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + list-banking-account-balances: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"accountId": "", "date": "2022-10-23T00:00:00Z", "modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "totalResults": 1} + "400": {} + Basiq: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/connections/b4703906-e631-46f1-9acc-7e237acdc64d/data/banking-accountBalances?page=1&pageSize=2"}, "next": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/connections/b4703906-e631-46f1-9acc-7e237acdc64d/data/banking-accountBalances?page=2&pageSize=2"}, "self": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/connections/b4703906-e631-46f1-9acc-7e237acdc64d/data/banking-accountBalances"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountId": "4811e776-6187-48d9-afee-635fb0d89d93", "balance": {"current": 11389.85}, "date": "2017-12-31T00:00:00Z", "modifiedDate": "2022-10-28T07:15:07Z", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"accountId": "4811e776-6187-48d9-afee-635fb0d89d93", "balance": {"current": 8002.09}, "date": "2018-01-01T00:00:00Z", "modifiedDate": "2022-10-28T07:15:07Z", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "totalResults": 3103} + Plaid: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/efc2d985-cdb3-4724-8be3-c7310f7ead6c/connections/6c44dc44-e1b1-4578-800f-0bdefb658db7/data/banking-accountBalances?page=1&pageSize=2"}, "next": {"href": "/companies/efc2d985-cdb3-4724-8be3-c7310f7ead6c/connections/6c44dc44-e1b1-4578-800f-0bdefb658db7/data/banking-accountBalances?page=2&pageSize=2"}, "self": {"href": "/companies/efc2d985-cdb3-4724-8be3-c7310f7ead6c/connections/6c44dc44-e1b1-4578-800f-0bdefb658db7/data/banking-accountBalances"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountId": "3opGv6XXNeHPEgNVbQpyCr8MAKQ3noC8Qz1zB", "balance": {"current": 205.78}, "date": "2022-10-13T00:00:00", "modifiedDate": "2022-10-27T10:50:16Z", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"accountId": "3opGv6XXNeHPEgNVbQpyCr8MAKQ3noC8Qz1zB", "balance": {"current": 205.78}, "date": "2022-10-14T00:00:00", "modifiedDate": "2022-10-27T10:50:16Z", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "totalResults": 14} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-banking-account: + Basiq: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "200": + application/json: {"balance": {"available": 2932.85, "current": 2932.85}, "currency": "AUD", "holder": "david smith", "id": "4811e776-6187-48d9-afee-635fb0d89d93", "identifiers": {"bankCode": "416-982", "number": "14293919644182", "type": "Account"}, "institution": {"id": "AU00000", "name": "Hooli Bank"}, "modifiedDate": "2022-10-28T07:14:48Z", "name": "Hooli Saver", "sourceModifiedDate": "2022-10-27T13:00:00Z", "type": "Debit"} + Plaid: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "200": + application/json: {"balance": {"available": 200, "current": 210}, "currency": "CAD", "id": "3opGv6XXNeHPEgNVbQpyCr8MAKQ3noC8Qz1zB", "identifiers": {"bankCode": "00021", "maskedAccountNumber": "1111", "number": "1111222233331111", "type": "Depository"}, "informalName": "Plaid Saving", "institution": {"id": "ins_100533", "name": "American Express (CA)"}, "modifiedDate": "2022-10-27T10:50:16Z", "name": "Plaid Silver Standard 0.1% Interest Saving", "sourceModifiedDate": "2022-10-23T00:00:00Z", "type": "Debit"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-banking-accounts: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"currency": "Lilangeni", "id": "", "identifiers": {"type": "Account"}, "modifiedDate": "2022-10-23T00:00:00Z", "name": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "type": "Debit"}], "totalResults": 1} + "400": {} + Basiq: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/connections/b4703906-e631-46f1-9acc-7e237acdc64d/data/banking-accounts?page=1&pageSize=2"}, "next": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/connections/b4703906-e631-46f1-9acc-7e237acdc64d/data/banking-accounts?page=2&pageSize=2"}, "self": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/connections/b4703906-e631-46f1-9acc-7e237acdc64d/data/banking-accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"balance": {"available": 2932.85, "current": 2932.85}, "currency": "AUD", "holder": "david smith", "id": "4811e776-6187-48d9-afee-635fb0d89d93", "identifiers": {"bankCode": "416-982", "number": "14293919644182", "type": "Account"}, "institution": {"id": "AU00000", "name": "Hooli Bank"}, "modifiedDate": "2022-10-28T07:14:48Z", "name": "Hooli Saver", "sourceModifiedDate": "2022-10-27T13:00:00Z", "type": "Debit"}, {"balance": {"available": 6940.31, "current": 6940.31}, "currency": "AUD", "holder": "david smith", "id": "736d90a5-f836-4ae0-a161-1e8056f39701", "identifiers": {"bankCode": "416-982", "number": "14293919644183", "type": "Loan"}, "institution": {"id": "AU00000", "name": "Hooli Bank"}, "modifiedDate": "2022-10-28T07:14:48Z", "name": "Standard Variable Rate Home Loan", "sourceModifiedDate": "2022-10-27T13:00:00Z", "type": "Credit"}], "totalResults": 4} + Plaid: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/efc2d985-cdb3-4724-8be3-c7310f7ead6c/connections/6c44dc44-e1b1-4578-800f-0bdefb658db7/data/banking-accounts?page=1&pageSize=2"}, "self": {"href": "/companies/efc2d985-cdb3-4724-8be3-c7310f7ead6c/connections/6c44dc44-e1b1-4578-800f-0bdefb658db7/data/banking-accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"balance": {"available": 200, "current": 210}, "currency": "CAD", "id": "3opGv6XXNeHPEgNVbQpyCr8MAKQ3noC8Qz1zB", "identifiers": {"bankCode": "00021", "maskedAccountNumber": "1111", "number": "1111222233331111", "type": "Depository"}, "informalName": "Plaid Saving", "institution": {"id": "ins_100533", "name": "American Express (CA)"}, "modifiedDate": "2022-10-27T10:50:16Z", "name": "Plaid Silver Standard 0.1% Interest Saving", "sourceModifiedDate": "2022-10-23T00:00:00Z", "type": "Debit"}], "totalResults": 1} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-banking-transaction-category: + Basiq: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transactionCategoryId: "" + responses: + "200": + application/json: {"hasChildren": false, "id": "bank-fee", "modifiedDate": "2022-10-28T07:14:46", "name": "Bank Fee", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"} + Plaid: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transactionCategoryId: "" + responses: + "200": + application/json: {"hasChildren": true, "id": "BANK_FEES", "modifiedDate": "2022-10-27T10:50:17", "name": "BANK_FEES", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transactionCategoryId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-banking-transaction-categories: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"hasChildren": true, "id": "auto-and-transport", "modifiedDate": "2022-05-23T16:32:50", "name": "Auto & Transport", "sourceModifiedDate": "2021-04-24T07:59:10", "status": "Active"}], "totalResults": 1} + "400": {} + Basiq: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/connections/b4703906-e631-46f1-9acc-7e237acdc64d/data/banking-transactionCategories?page=1&pageSize=2"}, "next": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/connections/b4703906-e631-46f1-9acc-7e237acdc64d/data/banking-transactionCategories?page=2&pageSize=2"}, "self": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/connections/b4703906-e631-46f1-9acc-7e237acdc64d/data/banking-transactionCategories"}}, "pageNumber": 1, "pageSize": 2, "results": [{"hasChildren": false, "id": "bank-fee", "modifiedDate": "2022-10-28T07:14:46", "name": "Bank Fee", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"hasChildren": false, "id": "cash-withdrawal", "modifiedDate": "2022-10-28T07:14:46", "name": "Cash Withdrawal", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 9} + Plaid: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/efc2d985-cdb3-4724-8be3-c7310f7ead6c/connections/6c44dc44-e1b1-4578-800f-0bdefb658db7/data/banking-transactionCategories?page=1&pageSize=2"}, "next": {"href": "/companies/efc2d985-cdb3-4724-8be3-c7310f7ead6c/connections/6c44dc44-e1b1-4578-800f-0bdefb658db7/data/banking-transactionCategories?page=2&pageSize=2"}, "self": {"href": "/companies/efc2d985-cdb3-4724-8be3-c7310f7ead6c/connections/6c44dc44-e1b1-4578-800f-0bdefb658db7/data/banking-transactionCategories"}}, "pageNumber": 1, "pageSize": 2, "results": [{"hasChildren": true, "id": "BANK_FEES", "modifiedDate": "2022-10-27T10:50:17", "name": "BANK_FEES", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"hasChildren": false, "id": "BANK_FEES.BANK_FEES_ATM_FEES", "modifiedDate": "2022-10-27T10:50:17", "name": "BANK_FEES_ATM_FEES", "parentId": "BANK_FEES", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 120} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-banking-transaction: + Basiq: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transactionId: "" + responses: + "200": + application/json: {"accountId": "feb76128-7650-4b02-a323-e1606146be0c", "amount": -14.26, "authorizedDate": "2022-10-23T00:00:00Z", "code": "Unknown", "currency": "AUD", "description": "RENTALCARTOLLPH131865 PARRAMATTA AU Card xx0399 Value Date: 25/07/2019", "id": "00017a94-c681-448d-ba8d-585a81b4128f", "merchantName": "", "modifiedDate": "2022-10-28T07:15:10Z", "postedDate": "2019-07-31T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionCategoryRef": {"id": "payment", "name": "Payment"}} + Plaid: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transactionId: "" + responses: + "200": + application/json: {"accountId": "3opGv6XXNeHPEgNVbQpyCr8MAKQ3noC8Qz1zB", "amount": -25, "authorizedDate": "2021-05-09T00:00:00", "code": "Unknown", "currency": "CAD", "description": "CREDIT CARD 3333 PAYMENT *//", "id": "1514wvMMajumgG7xWA1Bt8o15xP5k3fmeo9Bg_EC6E0DC820E1F9D1A2300BF4A5B80513", "modifiedDate": "2022-10-27T10:50:25Z", "postedDate": "2021-05-10T00:00:00", "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionCategoryRef": {"id": "TRANSFER_OUT.TRANSFER_OUT_ACCOUNT_TRANSFER", "name": "TRANSFER_OUT_ACCOUNT_TRANSFER"}} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transactionId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-banking-transactions: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"accountId": "1703194f-7805-4da8-bac0-2ba5da4a4216", "amount": 5062.39, "authorizedDate": "2021-07-06T00:00:00", "currency": "GBP", "description": "Payments for direct income ce149943-c157-43fc-aac7-42a716b655b6", "id": "0130b5bb-1419-40f6-8a27-7362d0381229", "merchantName": "New Look", "modifiedDate": "2022-05-23T16:32:50Z", "postedDate": "2021-07-06T00:00:00", "sourceModifiedDate": "2021-06-28T10:48:12", "transactionCategoryRef": {"id": "health-and-fitness-sports"}}], "totalResults": 1} + "400": {} + Basiq: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/connections/b4703906-e631-46f1-9acc-7e237acdc64d/data/banking-transactions?page=1&pageSize=2"}, "next": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/connections/b4703906-e631-46f1-9acc-7e237acdc64d/data/banking-transactions?page=2&pageSize=2"}, "self": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/connections/b4703906-e631-46f1-9acc-7e237acdc64d/data/banking-transactions"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountId": "feb76128-7650-4b02-a323-e1606146be0c", "amount": -14.26, "authorizedDate": "2022-10-23T00:00:00Z", "code": "Unknown", "currency": "AUD", "description": "RENTALCARTOLLPH131865 PARRAMATTA AU Card xx0399 Value Date: 25/07/2019", "id": "00017a94-c681-448d-ba8d-585a81b4128f", "merchantName": "", "modifiedDate": "2022-10-28T07:15:10Z", "postedDate": "2019-07-31T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionCategoryRef": {"id": "payment", "name": "Payment"}}, {"accountId": "4811e776-6187-48d9-afee-635fb0d89d93", "amount": 191, "authorizedDate": "2022-10-23T00:00:00Z", "code": "Unknown", "currency": "AUD", "description": "Transfer from xx9263 CommBank app Shop", "id": "0023c431-35c8-41f5-b75e-9239413cde7e", "merchantName": "", "modifiedDate": "2022-10-28T07:15:10Z", "postedDate": "2018-07-31T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionCategoryRef": {"id": "transfer", "name": "Transfer"}}], "totalResults": 3319} + Plaid: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/efc2d985-cdb3-4724-8be3-c7310f7ead6c/connections/6c44dc44-e1b1-4578-800f-0bdefb658db7/data/banking-transactions?page=1&pageSize=2"}, "next": {"href": "/companies/efc2d985-cdb3-4724-8be3-c7310f7ead6c/connections/6c44dc44-e1b1-4578-800f-0bdefb658db7/data/banking-transactions?page=2&pageSize=2"}, "self": {"href": "/companies/efc2d985-cdb3-4724-8be3-c7310f7ead6c/connections/6c44dc44-e1b1-4578-800f-0bdefb658db7/data/banking-transactions"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountId": "3opGv6XXNeHPEgNVbQpyCr8MAKQ3noC8Qz1zB", "amount": -25, "authorizedDate": "2021-05-09T00:00:00", "code": "Unknown", "currency": "CAD", "description": "CREDIT CARD 3333 PAYMENT *//", "id": "1514wvMMajumgG7xWA1Bt8o15xP5k3fmeo9Bg_EC6E0DC820E1F9D1A2300BF4A5B80513", "modifiedDate": "2022-10-27T10:50:25Z", "postedDate": "2021-05-10T00:00:00", "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionCategoryRef": {"id": "TRANSFER_OUT.TRANSFER_OUT_ACCOUNT_TRANSFER", "name": "TRANSFER_OUT_ACCOUNT_TRANSFER"}}, {"accountId": "3opGv6XXNeHPEgNVbQpyCr8MAKQ3noC8Qz1zB", "amount": -25, "authorizedDate": "2022-10-01T00:00:00", "code": "Unknown", "currency": "CAD", "description": "CREDIT CARD 3333 PAYMENT *//", "id": "1514wvMMajumgG7xWA1Bt8oDLxlpm3i3zraD7_6DB63D1DACF6F5824C80F8BE2E066DB5", "modifiedDate": "2022-10-27T10:50:25Z", "postedDate": "2022-10-02T00:00:00", "sourceModifiedDate": "2022-10-23T00:00:00Z", "transactionCategoryRef": {"id": "TRANSFER_OUT.TRANSFER_OUT_ACCOUNT_TRANSFER", "name": "TRANSFER_OUT_ACCOUNT_TRANSFER"}}], "totalResults": 49} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-categorized-bank-statement: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + responses: + "200": + application/json: {"dataSources": [{"accounts": [{"accountName": "Business Savings Account", "accountProvider": "Lloyds Bank", "accountType": "Debit", "currency": "GBP", "currentBalance": 0, "platformName": "Banking Sandbox", "sourceRef": {"sourceType": "Banking"}}, {"accountName": "Banking - Business Credit Card", "accountProvider": "Lloyds Bank", "accountType": "Credit", "currency": "GBP", "currentBalance": 0, "platformName": "Banking Sandbox", "sourceRef": {"sourceType": "Banking"}}, {"accountName": "Business Undeposited Funds", "accountProvider": "Lloyds Bank", "accountType": "Debit", "currency": "GBP", "currentBalance": 0, "platformName": "Banking Sandbox", "sourceRef": {"sourceType": "Banking"}}, {"accountName": "Business Current Account", "accountProvider": "Lloyds Bank", "accountType": "Debit", "currency": "GBP", "currentBalance": 0, "platformName": "Banking Sandbox", "sourceRef": {"sourceType": "Banking"}}]}], "reportInfo": {"companyName": "test", "generatedDate": "2023-03-24T16:44:17.5302732Z", "pageNumber": 1, "pageSize": 10, "reportName": "Cash flow transactions report", "totalResults": 2194}, "reportItems": [{"transactions": [{"accountRef": {"id": "4f78a6b0-e9bb-40f2-82fd-f3a2daa1fd0a", "name": "Business Current Account"}, "amount": -6905.44, "counterpartyNames": ["Shopify"], "currency": "GBP", "date": "2022-11-08T00:00:00", "description": "Payment m86SDGpQr3", "id": "ab5e07a0-5578-4d91-8421-2dc72713b74f", "modifiedDate": "2022-11-08T12:00:00", "platformName": "Shopify", "sourceRef": {"sourceType": "Banking"}, "transactionCategory": {"confidence": 52.53, "confidences": [56, 52.53], "levels": ["Expense", "Operating"]}}, {"accountRef": {"id": "4f78a6b0-e9bb-40f2-82fd-f3a2daa1fd0a", "name": "Business Current Account"}, "amount": 4332.84, "counterpartyNames": ["Amazon", "Amazon Marketplace"], "currency": "GBP", "date": "2022-11-08T00:00:00", "description": "Payment from customer a5c68c7b-6825-46de-bf63-6ad23ef506a4", "id": "9846bbed-46d3-472c-a848-1ce8ebea7213", "modifiedDate": "2022-11-08T12:00:00", "platformName": "Amazon", "sourceRef": {"sourceType": "Banking"}, "transactionCategory": {"confidence": 88, "confidences": [88], "levels": ["Expense"]}}, {"accountRef": {"id": "809b9470-c9fa-4257-bc9f-06a1dc7b0cbc", "name": "Business Undeposited Funds"}, "amount": 4034.3, "counterpartyNames": [], "currency": "GBP", "date": "2022-11-08T00:00:00", "description": "Payment from customer a5c68c7b-6825-46de-bf63-6ad23ef506a4", "id": "94b213fb-d742-435e-90f1-bfe723a076d5", "modifiedDate": "2022-11-08T12:00:00", "platformName": "Shopify", "sourceRef": {"sourceType": "Banking"}, "transactionCategory": {"confidence": 61.08, "confidences": [65, 61.08], "levels": ["Income", "Revenue"]}}, {"accountRef": {"id": "4f78a6b0-e9bb-40f2-82fd-f3a2daa1fd0a", "name": "Business Current Account"}, "amount": -313.76, "counterpartyNames": [], "currency": "GBP", "date": "2022-11-08T00:00:00", "description": "Payment to supplier 78792d13-90a0-4ea2-8e07-81c3c893997e", "id": "cfceb7ff-eaa2-45b6-aca7-fa0e0b439161", "modifiedDate": "2022-11-08T12:00:00", "platformName": "Amazon", "sourceRef": {"sourceType": "Banking"}, "transactionCategory": {"confidence": 40.98, "confidences": [40.98, 99.9], "levels": ["Expense", "CostOfSales"]}}, {"accountRef": {"id": "809b9470-c9fa-4257-bc9f-06a1dc7b0cbc", "name": "Business Undeposited Funds"}, "amount": -614.4, "counterpartyNames": [], "currency": "GBP", "date": "2022-11-08T00:00:00", "description": "Payment to supplier 46d2e1fb-b4e9-469c-814a-21ff8105a26e", "id": "ba814f14-0fe3-41d0-9308-57f40642ac75", "modifiedDate": "2022-11-08T12:00:00", "platformName": "Zettle", "sourceRef": {"sourceType": "Banking"}, "transactionCategory": {"confidence": 55.84, "confidences": [55.84, 75.5], "levels": ["Income", "Revenue"]}}, {"accountRef": {"id": "4f78a6b0-e9bb-40f2-82fd-f3a2daa1fd0a", "name": "Business Current Account"}, "amount": 5199.62, "counterpartyNames": [], "currency": "GBP", "date": "2022-11-08T00:00:00", "description": "Payment from customer a5c68c7b-6825-46de-bf63-6ad23ef506a4", "id": "e67cc30e-fd5c-4eea-8365-ec40dfdd3ef6", "modifiedDate": "2022-11-08T12:00:00", "platformName": "Amazon", "sourceRef": {"sourceType": "Banking"}, "transactionCategory": {"confidence": 57.85, "confidences": [57.85], "levels": ["Expense"]}}, {"accountRef": {"id": "4f78a6b0-e9bb-40f2-82fd-f3a2daa1fd0a", "name": "Business Current Account"}, "amount": -21420.94, "counterpartyNames": [], "currency": "GBP", "date": "2022-11-08T00:00:00", "description": "Payment to supplier 18ac18dc-945b-4083-9013-e8a100b999fa", "id": "e0f08a0b-3575-4dde-98c4-3c854028d2d2", "modifiedDate": "2022-11-08T12:00:00", "platformName": "Amazon", "sourceRef": {"sourceType": "Banking"}, "transactionCategory": {"confidence": 70.58, "confidences": [70.58, 100], "levels": ["Expense", "Operating"]}}, {"accountRef": {"id": "809b9470-c9fa-4257-bc9f-06a1dc7b0cbc", "name": "Business Undeposited Funds"}, "amount": -30924.22, "counterpartyNames": [], "currency": "GBP", "date": "2022-11-08T00:00:00", "description": "Payment to supplier 630a3f16-5f01-4986-ae6b-82333ec49449", "id": "4b70d379-8284-4f44-bb37-c7935df950cc", "modifiedDate": "2022-11-08T12:00:00", "platformName": "DoorDash", "sourceRef": {"sourceType": "Banking"}, "transactionCategory": {"confidence": 48.26, "confidences": [48.26], "levels": ["Income"]}}, {"accountRef": {"id": "809b9470-c9fa-4257-bc9f-06a1dc7b0cbc", "name": "Business Undeposited Funds"}, "amount": -568.78, "counterpartyNames": ["Uber"], "currency": "GBP", "date": "2022-11-08T00:00:00", "description": "Payment to supplier bQATU4eSb9", "id": "76b73373-9345-472e-8edf-5be849d797fe", "modifiedDate": "2022-11-08T12:00:00", "platformName": "Uber", "sourceRef": {"sourceType": "Banking"}, "transactionCategory": {"confidence": 65.21, "confidences": [65.21, 100], "levels": ["Income", "Revenue"]}}, {"accountRef": {"id": "809b9470-c9fa-4257-bc9f-06a1dc7b0cbc", "name": "Business Undeposited Funds"}, "amount": -13050.79, "counterpartyNames": ["DoorDash"], "currency": "GBP", "date": "2022-11-08T00:00:00", "description": "Payment to supplier 9c37eb21-579a-4886-8296-3a853076b7bd", "id": "ee92fd6f-e0f7-4391-85fd-4b50921b973f", "modifiedDate": "2022-11-08T12:00:00", "platformName": "DoorDash", "sourceRef": {"sourceType": "Banking"}, "transactionCategory": {"confidence": 92.33, "confidences": [92.33, 92.33], "levels": ["Income", "Revenue"]}}]}]} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + download-accounting-bill-attachment: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-bill: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2022-05-06T00:00:00", "id": "81539597-e681-40c9-a4dd-ec2fffcde572", "issueDate": "2022-04-29T00:00:00", "lineItems": [{"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "22aee6bd-4767-48c4-8a13-fdf85b91fc80", "name": "600 Litre Grease Trap"}, "quantity": 5, "subTotal": 13909.7, "taxAmount": 1390.97, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 15300.67, "trackingCategoryRefs": [], "unitAmount": 2781.94}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 5, "subTotal": 6856.95, "taxAmount": 685.7, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 7542.65, "trackingCategoryRefs": [], "unitAmount": 1371.39}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 6, "subTotal": 8228.34, "taxAmount": 822.83, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 9051.17, "trackingCategoryRefs": [], "unitAmount": 1371.39}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "22aee6bd-4767-48c4-8a13-fdf85b91fc80", "name": "600 Litre Grease Trap"}, "quantity": 3, "subTotal": 8345.82, "taxAmount": 834.58, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 9180.4, "trackingCategoryRefs": [], "unitAmount": 2781.94}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Trapped Road Gully 450mm x 450mm", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "3abf0883-03f7-44c6-bc15-1372522d25e1", "name": "Heavy Duty Hinged Gully Grating"}, "quantity": 8, "subTotal": 3223.12, "taxAmount": 322.31, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 3545.43, "trackingCategoryRefs": [], "unitAmount": 402.89}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Bottle Gullies 90 degree Rectangular", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "6", "name": "Back Inlet Roddable Gully 90� Outlet Rectangular Grid"}, "quantity": 7, "subTotal": 665.56, "taxAmount": 66.56, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 732.12, "trackingCategoryRefs": [], "unitAmount": 95.08}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Bottle Gullies 90 degree Rectangular", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "6", "name": "Back Inlet Roddable Gully 90� Outlet Rectangular Grid"}, "quantity": 1, "subTotal": 95.08, "taxAmount": 9.51, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 104.59, "trackingCategoryRefs": [], "unitAmount": 95.08}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 2, "subTotal": 2742.78, "taxAmount": 274.28, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 3017.06, "trackingCategoryRefs": [], "unitAmount": 1371.39}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "22aee6bd-4767-48c4-8a13-fdf85b91fc80", "name": "600 Litre Grease Trap"}, "quantity": 1, "subTotal": 2781.94, "taxAmount": 278.19, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 3060.13, "trackingCategoryRefs": [], "unitAmount": 2781.94}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Bottle Gullies 90 degree Rectangular", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "6", "name": "Back Inlet Roddable Gully 90� Outlet Rectangular Grid"}, "quantity": 7, "subTotal": 665.56, "taxAmount": 66.56, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 732.12, "trackingCategoryRefs": [], "unitAmount": 95.08}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "51077072-d5c3-463b-9cb4-7da2e11886f9", "name": "150 Litre Grease Trap"}, "quantity": 4, "subTotal": 5007.56, "taxAmount": 500.76, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 5508.32, "trackingCategoryRefs": [], "unitAmount": 1251.89}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 9, "subTotal": 12342.51, "taxAmount": 1234.25, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 13576.76, "trackingCategoryRefs": [], "unitAmount": 1371.39}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:16Z", "note": "Bill with 12 line items, totaling 71351.42", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-05-06T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -71351.42}, "payment": {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "dcb18480-8b69-44d8-aa26-268b6a80d170", "note": "Bill Payment against bill 81539597-e681-40c9-a4dd-ec2fffcde572", "paidOnDate": "2022-05-06T00:00:00", "totalAmount": 71351.42}}], "purchaseOrderRefs": [], "reference": "b465a2c9-3212-4620-889b-6328ba148215", "sourceModifiedDate": "2023-02-14T17:09:02", "status": "Paid", "subTotal": 64864.92, "supplierRef": {"id": "8GeHBdBZiZ", "supplierName": "DuBuque, Goyette and Franecki"}, "taxAmount": 6486.5, "totalAmount": 71351.42, "withholdingTax": []} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 2188.51, "currency": "GBP", "dueDate": "2019-01-01T00:00:00", "id": "4019ee2b-d05a-ed11-8c34-000d3a0d28a2-108276", "issueDate": "2019-01-01T00:00:00", "lineItems": [{"accountRef": {"id": "6a1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Inventory"}, "description": "ATHENS Desk", "discountAmount": 202.64, "discountPercentage": 10, "isDirectCost": false, "itemRef": {"id": "ITEM-c81217b3-89d1-ea11-bbaa-000d3a2b9185-DOMESTIC-DOMESTIC", "name": "ATHENS Desk / General Business Posting Group: 'DOMESTIC' / VAT Business Posting Group: 'DOMESTIC'"}, "quantity": 4, "subTotal": 1823.76, "taxAmount": 364.75, "taxRateRef": {"effectiveTaxRate": 10, "id": "63bc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for DOMESTIC / STANDARD"}, "totalAmount": 2188.51, "trackingCategoryRefs": [], "unitAmount": 506.6}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "129148", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "108276", "sourceModifiedDate": "2022-11-02T17:02:48Z", "status": "Open", "subTotal": 1823.76, "supplierRef": {"id": "c01217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "First Up Consultants"}, "taxAmount": 364.75, "totalAmount": 2188.51, "withholdingTax": []} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 0, "currency": "EUR", "currencyRate": 1, "dueDate": "2019-11-09T00:00:00Z", "id": "1c55118b-793e-4437-9c13-4f554b9ca989", "issueDate": "2019-12-16T00:00:00Z", "lineItems": [{"accountRef": {"id": "5f139759-b554-4314-862e-b9d88e5b2e1b", "name": "Af te dragen loonheffing"}, "description": "Cheesecake", "discountAmount": 0, "isDirectCost": false, "quantity": 1, "subTotal": 10, "taxAmount": 2.1, "taxRateRef": {"effectiveTaxRate": 21, "id": "84277189-ad16-456c-b501-ca31f0a483cc", "name": "BTW prive gebruik"}, "totalAmount": 12.1, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-26T13:32:18Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR", "currencyRate": 1, "totalAmount": -12.1}, "payment": {"accountRef": {"id": "d79d65bd-1d7d-4f55-95d3-76b3a7b7b823", "name": "Bank 1"}, "currency": "EUR", "currencyRate": 1, "id": "d9a2980b-2a43-46f2-9c7f-413d925b3cdd", "paidOnDate": "2021-03-22T00:00:00", "reference": "20200032", "totalAmount": 12.1}}], "purchaseOrderRefs": [], "reference": "19600006", "sourceModifiedDate": "2020-01-03T15:06:02Z", "status": "Paid", "subTotal": 10, "supplierRef": {"id": "5e6f49b9-6489-4b82-83e7-291d308919bb", "supplierName": "Mickey Mouse"}, "taxAmount": 2.1, "totalAmount": 12.1, "withholdingTax": []} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2017-10-26T00:00:00Z", "id": "e7a45898-2db3-424c-acb9-a51647740f26", "issueDate": "2017-09-26T00:00:00Z", "lineItems": [{"accountRef": {"id": "e5e9e994-0f14-4614-b162-7b5593b21276", "name": "Finished Goods Stock"}, "description": "Stationery", "discountAmount": 0, "isDirectCost": false, "itemRef": {"id": "001"}, "quantity": 2, "subTotal": 800, "taxAmount": 160, "taxRateRef": {"effectiveTaxRate": 20, "id": "63cd143a-66ab-4320-8a6d-ab6be85ed048", "name": "UK purchases standard rate � Excluding"}, "totalAmount": 960, "trackingCategoryRefs": [], "unitAmount": 400}], "modifiedDate": "2022-10-26T13:33:20Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -123}, "payment": {"accountRef": {"id": "4a4e34b5-7f62-4b64-a44a-073398b14b41", "name": "Bank"}, "currency": "GBP", "currencyRate": 1, "id": "7a5f621b-739f-4ed8-b738-2aae3ef886ac", "paidOnDate": "2017-10-11T00:00:00", "reference": "17200006", "totalAmount": 123}}], "purchaseOrderRefs": [], "reference": "17600002", "sourceModifiedDate": "2019-01-11T14:18:17Z", "status": "Paid", "subTotal": 800, "supplierRef": {"id": "a7cad20d-44db-442b-ac1f-90475802d6fb", "supplierName": "Pencils Pencils Pencils"}, "taxAmount": 160, "totalAmount": 960, "withholdingTax": []} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 150, "currency": "GBP", "dueDate": "2018-09-20T00:00:00", "id": "16609552", "issueDate": "2014-08-21T00:00:00", "lineItems": [{"accountRef": {"id": "285", "name": "Accommodation and Meals"}, "isDirectCost": false, "quantity": 1, "taxAmount": 25, "totalAmount": 150, "trackingCategoryRefs": [], "unitAmount": 125}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:10Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "MATT - U", "sourceModifiedDate": "2020-11-11T12:48:55Z", "status": "Open", "subTotal": 125, "supplierRef": {"id": "7169654", "supplierName": "The Eagle"}, "taxAmount": 25, "totalAmount": 150, "withholdingTax": []} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 50, "currency": "USD", "dueDate": "2021-05-26T00:00:00", "id": "27", "issueDate": "2021-04-26T00:00:00", "lineItems": [{"accountRef": {"id": "3384197", "name": "Advertising"}, "description": "Grocery", "isDirectCost": false, "quantity": 1, "subTotal": 50, "taxAmount": 0, "totalAmount": 50, "trackingCategoryRefs": [], "unitAmount": 50}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "paymentAllocations": [], "purchaseOrderRefs": [], "sourceModifiedDate": "2021-04-26T19:34:22", "status": "Open", "subTotal": 50, "supplierRef": {"id": "87"}, "taxAmount": 0, "totalAmount": 50, "withholdingTax": []} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2000-01-01T00:00:00", "id": "97615244", "issueDate": "2000-01-01T00:00:00", "lineItems": [{"accountRef": {"id": "21481884", "name": "Computer equipment cost"}, "description": "", "isDirectCost": false, "itemRef": {"id": "122990246"}, "quantity": 1, "subTotal": 8.33, "taxAmount": 1.67, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 8.33}], "modifiedDate": "2022-09-30T10:29:15Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "25", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 8.33, "supplierRef": {"id": "9272052", "supplierName": "Supplier man"}, "taxAmount": 1.67, "totalAmount": 10, "withholdingTax": []} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 24, "currency": "GBP", "currencyRate": 1, "dueDate": "2021-03-26T00:00:00", "id": "7", "issueDate": "2021-03-26T00:00:00", "lineItems": [{"accountRef": {"id": "716", "name": "Inventory In Transit"}, "isDirectCost": false, "quantity": 1, "subTotal": 120, "totalAmount": 120, "tracking": {"categoryRefs": [{"id": "location-4", "name": "Europe"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "location-4", "name": "Europe"}], "unitAmount": 120, "unitOfMeasurement": "litre"}], "modifiedDate": "2023-01-30T14:47:34Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -120}, "payment": {"accountRef": {"id": "825", "name": "Codat Europe Bank"}, "currency": "GBP", "currencyRate": 1, "id": "112", "paidOnDate": "2021-03-26T00:00:00", "reference": "Bill Payment #1", "totalAmount": 120}}], "purchaseOrderRefs": [], "sourceModifiedDate": "2022-07-05T13:38:10", "status": "PartiallyPaid", "subTotal": 120, "supplierRef": {"id": "724", "supplierName": "Vendor A.A.A"}, "taxAmount": 24, "totalAmount": 144, "withholdingTax": []} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2024-01-01T00:00:00", "id": "3691-1071520776", "issueDate": "2022-12-02T00:00:00", "lineItems": [{"accountRef": {"id": "C0000-933270541", "name": "Accounts Payable"}, "description": "Cabinets:Light Pine - Light pine kitchen cabinet wall unit \n#CLD- 1235-p", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "110000-933272656", "name": "Cabinets:Light Pine"}, "quantity": 5, "subTotal": 7500, "taxAmount": 0, "totalAmount": 7500, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 1500}, {"accountRef": {"id": "C0000-933270541", "name": "Accounts Payable"}, "description": "Hardware:Doorknobs Std - Doorknobs Part # DK 3704", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "130000-933272656", "name": "Hardware:Doorknobs Std"}, "quantity": 100, "subTotal": 2700, "taxAmount": 0, "totalAmount": 2700, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 27}, {"accountRef": {"id": "C0000-933270541", "name": "Accounts Payable"}, "description": "Hardware:Lk Doorknobs - Locking interior doorknobs Part # DK415", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "140000-933272656", "name": "Hardware:Lk Doorknobs"}, "quantity": 100, "subTotal": 3495, "taxAmount": 0, "totalAmount": 3495, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 34.95}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:06:42Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5000}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "36AD-1071520917", "note": "RC 93", "paidOnDate": "2024-12-05T00:00:00", "reference": "484", "totalAmount": 5325}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -8695}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "9E4C-1182131999", "paidOnDate": "2023-01-31T00:00:00", "reference": "115", "totalAmount": 13759}}], "purchaseOrderRefs": [{"id": "3684-1071520443", "purchaseOrderNumber": "6225"}], "reference": "3847498", "sourceModifiedDate": "2023-12-16T05:06:30", "status": "Paid", "subTotal": 13695, "supplierRef": {"id": "B0000-933272656", "supplierName": "Patton Hardware Supplies"}, "taxAmount": 0, "totalAmount": 13695, "withholdingTax": []} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2019-05-13T00:00:00", "id": "18", "issueDate": "2019-05-13T00:00:00", "lineItems": [{"accountRef": {"id": "16", "name": "Advertising"}, "discountAmount": 0, "isDirectCost": false, "quantity": 1, "subTotal": 5, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 5, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 5}], "modifiedDate": "2023-01-18T11:02:41Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "20", "paidOnDate": "2019-05-13T00:00:00", "totalAmount": 0}}], "purchaseOrderRefs": [], "reference": "12", "sourceModifiedDate": "2022-05-26T10:34:10Z", "status": "Paid", "subTotal": 5, "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "taxAmount": 0, "totalAmount": 5, "withholdingTax": []} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 0, "currency": "HKD", "currencyRate": 0.081142, "dueDate": "2016-01-16T00:00:00", "id": "157", "issueDate": "2016-01-06T00:00:00", "lineItems": [{"description": "Water bottles -- generic", "discountAmount": 0, "isDirectCost": false, "itemRef": {"id": "19", "name": "Water Bottles"}, "quantity": 100, "subTotal": 6617.17, "taxAmount": 1323.43, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Bills", "name": "20.0% S Bills"}, "totalAmount": 7940.6, "tracking": {"categoryRefs": [], "customerRef": {"companyName": "Oxon Insurance - Holiday Party", "id": "55"}, "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 66.1717023}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:58Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "HKD", "currencyRate": 1, "totalAmount": -7940.6}, "payment": {"accountRef": {"id": "81", "name": "Current"}, "currency": "HKD", "currencyRate": 0.078807, "id": "158", "paidOnDate": "2016-01-23T00:00:00", "reference": "1067", "totalAmount": 7940.6}}], "purchaseOrderRefs": [], "sourceModifiedDate": "2023-01-26T11:20:45Z", "status": "Paid", "subTotal": 6617.17, "supplierRef": {"id": "57", "supplierName": "Hall's Promo Items"}, "taxAmount": 1323.43, "totalAmount": 7940.6, "withholdingTax": []} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 120, "currency": "GBP", "currencyRate": 1, "dueDate": "2020-02-15T00:00:00Z", "id": "45121", "issueDate": "2020-07-22T00:00:00Z", "lineItems": [{"description": "Tax Summary - Tax Rate 1", "discountAmount": 0.5, "isDirectCost": false, "quantity": 0, "subTotal": 0, "taxAmount": 20, "taxRateRef": {"effectiveTaxRate": 20, "id": "1729", "name": "Standard rate"}, "totalAmount": 20, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 2.5, "isDirectCost": false, "quantity": 0, "subTotal": 100, "taxAmount": 0, "totalAmount": 100, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:36:01Z", "note": "No1", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "Order no 1", "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Open", "subTotal": 100, "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "taxAmount": 20, "totalAmount": 120, "withholdingTax": []} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2022-01-31T00:00:00", "id": "92", "issueDate": "2021-01-01T00:00:00", "lineItems": [{"accountRef": {"id": "5000", "name": "Materials Purchased"}, "description": "Goods", "isDirectCost": false, "quantity": 1, "subTotal": 5000, "taxAmount": 875, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 5875, "tracking": {"categoryRefs": [{"id": "department_7", "name": "Workshop"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department_7", "name": "Workshop"}], "unitAmount": 5875}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:44Z", "note": "Goods", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5875}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "260", "note": "Purchase payment 260 linked to, purchase invoice 11, purchase invoice 18, purchase invoice 92, purchase invoice 93.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 7141.98}}], "purchaseOrderRefs": [], "reference": "2569", "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Paid", "subTotal": 5000, "supplierRef": {"id": "THO001", "supplierName": "Thompsons Electricals"}, "taxAmount": 875, "totalAmount": 5875, "withholdingTax": []} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 405.6, "currency": "GBP", "currencyRate": 1, "dueDate": "2018-07-19T00:00:00", "id": "15a7a15773b011e8aaa5027d54329956", "issueDate": "2018-06-19T00:00:00", "lineItems": [{"accountRef": {"id": "9a995955267a11e797950a57719b2edb", "name": "Cost of sales - goods"}, "description": "Consulting services", "isDirectCost": false, "itemRef": {"id": "a87b922b33de11e797950a57719b2edb", "name": "Consulting services"}, "quantity": 33, "subTotal": 363, "taxAmount": 72.6, "taxRateRef": {"effectiveTaxRate": 20, "id": "GB_STANDARD", "name": "Standard 20.00%"}, "totalAmount": 435.6, "trackingCategoryRefs": [], "unitAmount": 11}], "modifiedDate": "2022-10-24T14:56:08Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "332e402b9d4b4614af82594d186f5f29", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "3c3ed62353cf4d148352a14027738dbe", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "cbff2fed2f1641b7bee59f5dd68d29a1", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "d9b643b9d6e149f4b443cbc6f22fe1dd", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "e3e35dcda09642ca8880fc603b0a98e9", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "f11134e299cb4456be096265136a7770", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}], "purchaseOrderRefs": [], "reference": "19/06/2018 - 435.60", "sourceModifiedDate": "2020-02-05T15:19:28Z", "status": "PartiallyPaid", "subTotal": 363, "supplierRef": {"id": "ca430e0d156011e8b45c025132dab352", "supplierName": "Test Supplier"}, "taxAmount": 72.6, "totalAmount": 435.6, "withholdingTax": []} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "dueDate": "2021-10-29T00:00:00", "id": "4470", "issueDate": "2021-10-19T00:00:00", "lineItems": [{"accountRef": {"id": "3", "name": "Accounts Payable"}, "isDirectCost": false, "quantity": 1, "subTotal": 25, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "82", "name": "UK Purchase Goods Zero Rate"}, "totalAmount": 25, "tracking": {"categoryRefs": [{"id": "DEPARTMENT-3", "name": "Admin"}, {"id": "LOCATION-11", "name": "Codat Test Entity"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "DEPARTMENT-3", "name": "Admin"}, {"id": "LOCATION-11", "name": "Codat Test Entity"}], "unitAmount": 25}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:37Z", "note": "", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "id": "4472", "note": "", "paidOnDate": "2022-01-06T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -20}, "payment": {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "id": "4471", "note": "", "paidOnDate": "2022-01-06T00:00:00", "totalAmount": 20}}], "purchaseOrderRefs": [], "reference": "test", "sourceModifiedDate": "2022-02-23T12:06:58", "status": "Paid", "subTotal": 25, "supplierRef": {"id": "3", "supplierName": "ADP"}, "taxAmount": 0, "totalAmount": 25, "withholdingTax": []} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2021-12-20T00:00:00", "id": "3945273c-cc04-479f-a4b5-1e3dc7a55ed1", "issueDate": "2021-11-19T00:00:00", "lineItems": [{"accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10", "name": "Consulting"}, "description": "Half day training - Microsoft Office", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "489558f5-27b7-4f37-ad9f-d84611c2e2ab", "name": "Half day training - Microsoft Office"}, "quantity": 1, "subTotal": 1800, "taxAmount": 360, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 2160, "trackingCategoryRefs": [], "unitAmount": 1800}, {"accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce", "name": "General Expenses"}, "description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "f8fb7e00-5e5d-466c-aef0-15861f73d04f", "name": "Desktop/network support via email & phone"}, "quantity": 1, "subTotal": 4000, "taxAmount": 800, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 4800, "trackingCategoryRefs": [], "unitAmount": 4000}, {"accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a", "name": "Printing & Stationery"}, "description": "Stationery charges", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "quantity": 8, "subTotal": 256, "taxAmount": 51.2, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 307.2, "trackingCategoryRefs": [], "unitAmount": 32}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -7267.2}, "payment": {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "74004690-82a1-4810-aaca-6ce575af94b4", "paidOnDate": "2021-12-20T00:00:00", "totalAmount": 7267.2}}], "purchaseOrderRefs": [], "reference": "", "sourceModifiedDate": "2021-01-02T21:07:23", "status": "Paid", "subTotal": 6056, "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "taxAmount": 1211.2, "totalAmount": 7267.2, "withholdingTax": []} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2020-06-23T00:00:00", "id": "104957000000152027", "issueDate": "2020-06-23T00:00:00", "lineItems": [], "modifiedDate": "2022-10-03T08:40:37Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "1", "sourceModifiedDate": "2020-06-23T13:47:17", "status": "Paid", "subTotal": 0, "supplierRef": {"id": "104957000000152001", "supplierName": "Mr. P N"}, "taxAmount": 0, "totalAmount": 10, "withholdingTax": []} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-bill-attachment: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounting-bills: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2022-05-06T00:00:00", "id": "81539597-e681-40c9-a4dd-ec2fffcde572", "issueDate": "2022-04-29T00:00:00", "lineItems": [{"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "22aee6bd-4767-48c4-8a13-fdf85b91fc80", "name": "600 Litre Grease Trap"}, "quantity": 5, "subTotal": 13909.7, "taxAmount": 1390.97, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 15300.67, "trackingCategoryRefs": [], "unitAmount": 2781.94}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 5, "subTotal": 6856.95, "taxAmount": 685.7, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 7542.65, "trackingCategoryRefs": [], "unitAmount": 1371.39}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 6, "subTotal": 8228.34, "taxAmount": 822.83, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 9051.17, "trackingCategoryRefs": [], "unitAmount": 1371.39}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "22aee6bd-4767-48c4-8a13-fdf85b91fc80", "name": "600 Litre Grease Trap"}, "quantity": 3, "subTotal": 8345.82, "taxAmount": 834.58, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 9180.4, "trackingCategoryRefs": [], "unitAmount": 2781.94}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Trapped Road Gully 450mm x 450mm", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "3abf0883-03f7-44c6-bc15-1372522d25e1", "name": "Heavy Duty Hinged Gully Grating"}, "quantity": 8, "subTotal": 3223.12, "taxAmount": 322.31, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 3545.43, "trackingCategoryRefs": [], "unitAmount": 402.89}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Bottle Gullies 90 degree Rectangular", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "6", "name": "Back Inlet Roddable Gully 90� Outlet Rectangular Grid"}, "quantity": 7, "subTotal": 665.56, "taxAmount": 66.56, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 732.12, "trackingCategoryRefs": [], "unitAmount": 95.08}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Bottle Gullies 90 degree Rectangular", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "6", "name": "Back Inlet Roddable Gully 90� Outlet Rectangular Grid"}, "quantity": 1, "subTotal": 95.08, "taxAmount": 9.51, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 104.59, "trackingCategoryRefs": [], "unitAmount": 95.08}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 2, "subTotal": 2742.78, "taxAmount": 274.28, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 3017.06, "trackingCategoryRefs": [], "unitAmount": 1371.39}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "22aee6bd-4767-48c4-8a13-fdf85b91fc80", "name": "600 Litre Grease Trap"}, "quantity": 1, "subTotal": 2781.94, "taxAmount": 278.19, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 3060.13, "trackingCategoryRefs": [], "unitAmount": 2781.94}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Bottle Gullies 90 degree Rectangular", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "6", "name": "Back Inlet Roddable Gully 90� Outlet Rectangular Grid"}, "quantity": 7, "subTotal": 665.56, "taxAmount": 66.56, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 732.12, "trackingCategoryRefs": [], "unitAmount": 95.08}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "51077072-d5c3-463b-9cb4-7da2e11886f9", "name": "150 Litre Grease Trap"}, "quantity": 4, "subTotal": 5007.56, "taxAmount": 500.76, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 5508.32, "trackingCategoryRefs": [], "unitAmount": 1251.89}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 9, "subTotal": 12342.51, "taxAmount": 1234.25, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 13576.76, "trackingCategoryRefs": [], "unitAmount": 1371.39}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:16Z", "note": "Bill with 12 line items, totaling 71351.42", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-05-06T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -71351.42}, "payment": {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "dcb18480-8b69-44d8-aa26-268b6a80d170", "note": "Bill Payment against bill 81539597-e681-40c9-a4dd-ec2fffcde572", "paidOnDate": "2022-05-06T00:00:00", "totalAmount": 71351.42}}], "purchaseOrderRefs": [], "reference": "b465a2c9-3212-4620-889b-6328ba148215", "sourceModifiedDate": "2023-02-14T17:09:02", "status": "Paid", "subTotal": 64864.92, "supplierRef": {"id": "8GeHBdBZiZ", "supplierName": "DuBuque, Goyette and Franecki"}, "taxAmount": 6486.5, "totalAmount": 71351.42, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2022-05-15T00:00:00", "id": "acc1dc9d-a21a-41b8-953e-73da4afab6e6", "issueDate": "2022-04-30T00:00:00", "lineItems": [{"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Bottle Gullies 90 degree Rectangular", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "6", "name": "Back Inlet Roddable Gully 90� Outlet Rectangular Grid"}, "quantity": 4, "subTotal": 380.32, "taxAmount": 38.03, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 418.35, "trackingCategoryRefs": [], "unitAmount": 95.08}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:16Z", "note": "Bill for purchase order ee9b8e00-49a2-4d83-bc33-e2eee59a1c36", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-05-15T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -418.35}, "payment": {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "a4fa017a-3911-4eb0-aaf9-b002c446c8c3", "note": "Bill Payment against bill acc1dc9d-a21a-41b8-953e-73da4afab6e6", "paidOnDate": "2022-05-15T00:00:00", "totalAmount": 418.35}}], "purchaseOrderRefs": [{"id": "7f07b584-bebe-450f-aa9e-1d7aed630b66", "purchaseOrderNumber": "ee9b8e00-49a2-4d83-bc33-e2eee59a1c36"}], "reference": "d88e83b8-a5cc-4578-815d-afa263df4beb", "sourceModifiedDate": "2023-04-14T01:56:02", "status": "Paid", "subTotal": 380.32, "supplierRef": {"id": "7GObELDcsE", "supplierName": "Lakin, Schmeler and Kihn"}, "taxAmount": 38.03, "totalAmount": 418.35, "withholdingTax": []}], "totalResults": 183} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 2188.51, "currency": "GBP", "dueDate": "2019-01-01T00:00:00", "id": "4019ee2b-d05a-ed11-8c34-000d3a0d28a2-108276", "issueDate": "2019-01-01T00:00:00", "lineItems": [{"accountRef": {"id": "6a1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Inventory"}, "description": "ATHENS Desk", "discountAmount": 202.64, "discountPercentage": 10, "isDirectCost": false, "itemRef": {"id": "ITEM-c81217b3-89d1-ea11-bbaa-000d3a2b9185-DOMESTIC-DOMESTIC", "name": "ATHENS Desk / General Business Posting Group: 'DOMESTIC' / VAT Business Posting Group: 'DOMESTIC'"}, "quantity": 4, "subTotal": 1823.76, "taxAmount": 364.75, "taxRateRef": {"effectiveTaxRate": 10, "id": "63bc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for DOMESTIC / STANDARD"}, "totalAmount": 2188.51, "trackingCategoryRefs": [], "unitAmount": 506.6}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "129148", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "108276", "sourceModifiedDate": "2022-11-02T17:02:48Z", "status": "Open", "subTotal": 1823.76, "supplierRef": {"id": "c01217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "First Up Consultants"}, "taxAmount": 364.75, "totalAmount": 2188.51, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "dueDate": "2019-01-01T00:00:00", "id": "b9cb06bf-89d1-ea11-bbaa-000d3a2b9185-108001", "issueDate": "2019-01-01T00:00:00", "lineItems": [{"accountRef": {"id": "6a1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Inventory"}, "description": "ATHENS Desk", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "ITEM-c81217b3-89d1-ea11-bbaa-000d3a2b9185-DOMESTIC-DOMESTIC", "name": "ATHENS Desk / General Business Posting Group: 'DOMESTIC' / VAT Business Posting Group: 'DOMESTIC'"}, "quantity": 4, "subTotal": 2026.4, "taxAmount": 405.28, "taxRateRef": {"effectiveTaxRate": 10, "id": "63bc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for DOMESTIC / STANDARD"}, "totalAmount": 2431.68, "trackingCategoryRefs": [], "unitAmount": 506.6}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "107001", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2019-01-01T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -2431.68}, "payment": {"accountRef": {"id": "621217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Petty Cash"}, "currency": "GBP", "currencyRate": 1, "id": "57377f05-8ad1-ea11-bbaa-000d3a2b9185", "note": "Invoice 107001", "paidOnDate": "2019-01-01T00:00:00", "reference": "108001", "totalAmount": 2431.68}}], "purchaseOrderRefs": [], "reference": "108001", "sourceModifiedDate": "2022-05-17T16:29:02Z", "status": "Paid", "subTotal": 2026.4, "supplierRef": {"id": "c01217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "First Up Consultants"}, "taxAmount": 405.28, "totalAmount": 2431.68, "withholdingTax": []}], "totalResults": 294} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "EUR", "currencyRate": 1, "dueDate": "2019-11-09T00:00:00Z", "id": "1c55118b-793e-4437-9c13-4f554b9ca989", "issueDate": "2019-12-16T00:00:00Z", "lineItems": [{"accountRef": {"id": "5f139759-b554-4314-862e-b9d88e5b2e1b", "name": "Af te dragen loonheffing"}, "description": "Cheesecake", "discountAmount": 0, "isDirectCost": false, "quantity": 1, "subTotal": 10, "taxAmount": 2.1, "taxRateRef": {"effectiveTaxRate": 21, "id": "84277189-ad16-456c-b501-ca31f0a483cc", "name": "BTW prive gebruik"}, "totalAmount": 12.1, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-26T13:32:18Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR", "currencyRate": 1, "totalAmount": -12.1}, "payment": {"accountRef": {"id": "d79d65bd-1d7d-4f55-95d3-76b3a7b7b823", "name": "Bank 1"}, "currency": "EUR", "currencyRate": 1, "id": "d9a2980b-2a43-46f2-9c7f-413d925b3cdd", "paidOnDate": "2021-03-22T00:00:00", "reference": "20200032", "totalAmount": 12.1}}], "purchaseOrderRefs": [], "reference": "19600006", "sourceModifiedDate": "2020-01-03T15:06:02Z", "status": "Paid", "subTotal": 10, "supplierRef": {"id": "5e6f49b9-6489-4b82-83e7-291d308919bb", "supplierName": "Mickey Mouse"}, "taxAmount": 2.1, "totalAmount": 12.1, "withholdingTax": []}, {"amountDue": 12.1, "currency": "EUR", "currencyRate": 1, "dueDate": "2019-11-09T00:00:00Z", "id": "ec0c61a1-deb6-4496-b9ee-feb29b16019c", "issueDate": "2019-12-16T00:00:00Z", "lineItems": [{"accountRef": {"id": "5f139759-b554-4314-862e-b9d88e5b2e1b", "name": "Af te dragen loonheffing"}, "description": "Cheesecake", "discountAmount": 0, "isDirectCost": false, "quantity": 1, "subTotal": 10, "taxAmount": 2.1, "taxRateRef": {"effectiveTaxRate": 21, "id": "84277189-ad16-456c-b501-ca31f0a483cc", "name": "BTW prive gebruik"}, "totalAmount": 12.1, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-26T13:32:18Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR", "currencyRate": 1, "totalAmount": -0.21}, "payment": {"accountRef": {"id": "a2d51b6f-677d-4bbf-ad0c-b45fd6231546", "name": "Activa herwaarderingen"}, "currency": "EUR", "currencyRate": 1, "id": "ef5d140b-16da-4fd2-a0c8-d5bfb89a13ee", "paidOnDate": "2019-11-07T00:00:00", "reference": "19900056", "totalAmount": 0.21}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR", "currencyRate": 1, "totalAmount": -0.2}, "payment": {"accountRef": {"id": "a2d51b6f-677d-4bbf-ad0c-b45fd6231546", "name": "Activa herwaarderingen"}, "currency": "EUR", "currencyRate": 1, "id": "b69e7ad4-2b90-4a5f-a8a0-67418ac95531", "paidOnDate": "2019-11-07T00:00:00", "reference": "19900053", "totalAmount": 0.2}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR", "currencyRate": 1, "totalAmount": -12.1}, "payment": {"accountRef": {"id": "d79d65bd-1d7d-4f55-95d3-76b3a7b7b823", "name": "Bank 1"}, "currency": "EUR", "currencyRate": 1, "id": "6ccd1256-6073-4bfc-8d88-700417685e72", "paidOnDate": "2021-10-05T00:00:00", "reference": "21200028", "totalAmount": 12.1}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR", "currencyRate": 1, "totalAmount": -0.21}, "payment": {"accountRef": {"id": "a2d51b6f-677d-4bbf-ad0c-b45fd6231546", "name": "Activa herwaarderingen"}, "currency": "EUR", "currencyRate": 1, "id": "69a8533b-3e59-4d2d-9bca-bc37bc0f7984", "paidOnDate": "2019-11-07T00:00:00", "reference": "19900055", "totalAmount": 0.21}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR", "currencyRate": 1, "totalAmount": -0.21}, "payment": {"accountRef": {"id": "a2d51b6f-677d-4bbf-ad0c-b45fd6231546", "name": "Activa herwaarderingen"}, "currency": "EUR", "currencyRate": 1, "id": "2dae3548-ff11-4ad8-886c-eb5cb7965024", "paidOnDate": "2019-11-07T00:00:00", "reference": "19900054", "totalAmount": 0.21}}], "purchaseOrderRefs": [], "reference": "19600008", "sourceModifiedDate": "2020-01-03T15:06:39Z", "status": "Open", "subTotal": 10, "supplierRef": {"id": "fc189bfa-f083-438c-bf09-379a0631d4a1", "supplierName": "Mickey Mouse"}, "taxAmount": 2.1, "totalAmount": 12.1, "withholdingTax": []}], "totalResults": 80} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2017-10-26T00:00:00Z", "id": "e7a45898-2db3-424c-acb9-a51647740f26", "issueDate": "2017-09-26T00:00:00Z", "lineItems": [{"accountRef": {"id": "e5e9e994-0f14-4614-b162-7b5593b21276", "name": "Finished Goods Stock"}, "description": "Stationery", "discountAmount": 0, "isDirectCost": false, "itemRef": {"id": "001"}, "quantity": 2, "subTotal": 800, "taxAmount": 160, "taxRateRef": {"effectiveTaxRate": 20, "id": "63cd143a-66ab-4320-8a6d-ab6be85ed048", "name": "UK purchases standard rate � Excluding"}, "totalAmount": 960, "trackingCategoryRefs": [], "unitAmount": 400}], "modifiedDate": "2022-10-26T13:33:20Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -123}, "payment": {"accountRef": {"id": "4a4e34b5-7f62-4b64-a44a-073398b14b41", "name": "Bank"}, "currency": "GBP", "currencyRate": 1, "id": "7a5f621b-739f-4ed8-b738-2aae3ef886ac", "paidOnDate": "2017-10-11T00:00:00", "reference": "17200006", "totalAmount": 123}}], "purchaseOrderRefs": [], "reference": "17600002", "sourceModifiedDate": "2019-01-11T14:18:17Z", "status": "Paid", "subTotal": 800, "supplierRef": {"id": "a7cad20d-44db-442b-ac1f-90475802d6fb", "supplierName": "Pencils Pencils Pencils"}, "taxAmount": 160, "totalAmount": 960, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2019-02-10T00:00:00Z", "id": "064fbab9-9b4d-4e83-b2df-0f4ce12bc2bf", "issueDate": "2019-01-11T00:00:00Z", "lineItems": [{"accountRef": {"id": "885ff551-664d-451b-995b-cb114c9877d0", "name": "Unallocated Cash"}, "description": "Basket balls", "discountAmount": 0, "isDirectCost": false, "itemRef": {"id": "23"}, "quantity": 1, "subTotal": 20, "taxAmount": 0, "totalAmount": 20, "trackingCategoryRefs": [], "unitAmount": 20}], "modifiedDate": "2022-10-26T13:33:20Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -20}, "payment": {"accountRef": {"id": "4a4e34b5-7f62-4b64-a44a-073398b14b41", "name": "Bank"}, "currency": "GBP", "currencyRate": 1, "id": "d871f677-c2df-4069-bda0-c6804a46b71b", "paidOnDate": "2019-02-10T00:00:00", "reference": "19200001", "totalAmount": 20}}], "purchaseOrderRefs": [], "reference": "19600001", "sourceModifiedDate": "2019-01-11T12:03:31Z", "status": "Paid", "subTotal": 20, "supplierRef": {"id": "a4d5d739-c979-4819-b0ce-666db1ec3a7d", "supplierName": "Exact Software (UK) Ltd � Exact Online"}, "taxAmount": 0, "totalAmount": 20, "withholdingTax": []}], "totalResults": 83} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 150, "currency": "GBP", "dueDate": "2018-09-20T00:00:00", "id": "16609552", "issueDate": "2014-08-21T00:00:00", "lineItems": [{"accountRef": {"id": "285", "name": "Accommodation and Meals"}, "isDirectCost": false, "quantity": 1, "taxAmount": 25, "totalAmount": 150, "trackingCategoryRefs": [], "unitAmount": 125}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:10Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "MATT - U", "sourceModifiedDate": "2020-11-11T12:48:55Z", "status": "Open", "subTotal": 125, "supplierRef": {"id": "7169654", "supplierName": "The Eagle"}, "taxAmount": 25, "totalAmount": 150, "withholdingTax": []}, {"amountDue": 150, "currency": "GBP", "dueDate": "2018-09-20T00:00:00", "id": "16609589", "issueDate": "2014-08-21T00:00:00", "lineItems": [{"accountRef": {"id": "285", "name": "Accommodation and Meals"}, "isDirectCost": false, "quantity": 1, "taxAmount": 25, "totalAmount": 150, "trackingCategoryRefs": [], "unitAmount": 125}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:10Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "MATT - U", "sourceModifiedDate": "2020-11-11T12:50:41Z", "status": "Open", "subTotal": 125, "supplierRef": {"id": "7169654", "supplierName": "The Eagle"}, "taxAmount": 25, "totalAmount": 150, "withholdingTax": []}], "totalResults": 137} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 50, "currency": "USD", "dueDate": "2021-05-26T00:00:00", "id": "27", "issueDate": "2021-04-26T00:00:00", "lineItems": [{"accountRef": {"id": "3384197", "name": "Advertising"}, "description": "Grocery", "isDirectCost": false, "quantity": 1, "subTotal": 50, "taxAmount": 0, "totalAmount": 50, "trackingCategoryRefs": [], "unitAmount": 50}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "paymentAllocations": [], "purchaseOrderRefs": [], "sourceModifiedDate": "2021-04-26T19:34:22", "status": "Open", "subTotal": 50, "supplierRef": {"id": "87"}, "taxAmount": 0, "totalAmount": 50, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "dueDate": "2021-05-28T00:00:00", "id": "29", "issueDate": "2021-04-28T00:00:00", "lineItems": [{"accountRef": {"id": "3384197", "name": "Advertising"}, "description": "Advertising refund", "isDirectCost": false, "quantity": 1, "subTotal": 10, "taxAmount": 0, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 10}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "paymentAllocations": [], "purchaseOrderRefs": [], "sourceModifiedDate": "2021-08-18T13:52:33", "status": "Paid", "subTotal": 10, "supplierRef": {"id": "89"}, "taxAmount": 0, "totalAmount": 10, "withholdingTax": []}], "totalResults": 16} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2000-01-01T00:00:00", "id": "97615244", "issueDate": "2000-01-01T00:00:00", "lineItems": [{"accountRef": {"id": "21481884", "name": "Computer equipment cost"}, "description": "", "isDirectCost": false, "itemRef": {"id": "122990246"}, "quantity": 1, "subTotal": 8.33, "taxAmount": 1.67, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 8.33}], "modifiedDate": "2022-09-30T10:29:15Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "25", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 8.33, "supplierRef": {"id": "9272052", "supplierName": "Supplier man"}, "taxAmount": 1.67, "totalAmount": 10, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2019-02-27T00:00:00", "id": "76144089", "issueDate": "2019-01-28T00:00:00", "lineItems": [{"accountRef": {"id": "21481820", "name": "Materials purchased"}, "description": "", "isDirectCost": false, "itemRef": {"id": "95293985"}, "quantity": 5, "subTotal": 600, "taxAmount": 0, "totalAmount": 600, "trackingCategoryRefs": [], "unitAmount": 120}], "modifiedDate": "2022-09-30T10:29:15Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 600, "supplierRef": {"id": "6202387", "supplierName": "Dell"}, "taxAmount": 0, "totalAmount": 600, "withholdingTax": []}], "totalResults": 19} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 24, "currency": "GBP", "currencyRate": 1, "dueDate": "2021-03-26T00:00:00", "id": "7", "issueDate": "2021-03-26T00:00:00", "lineItems": [{"accountRef": {"id": "716", "name": "Inventory In Transit"}, "isDirectCost": false, "quantity": 1, "subTotal": 120, "totalAmount": 120, "tracking": {"categoryRefs": [{"id": "location-4", "name": "Europe"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "location-4", "name": "Europe"}], "unitAmount": 120, "unitOfMeasurement": "litre"}], "modifiedDate": "2023-01-30T14:47:34Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -120}, "payment": {"accountRef": {"id": "825", "name": "Codat Europe Bank"}, "currency": "GBP", "currencyRate": 1, "id": "112", "paidOnDate": "2021-03-26T00:00:00", "reference": "Bill Payment #1", "totalAmount": 120}}], "purchaseOrderRefs": [], "sourceModifiedDate": "2022-07-05T13:38:10", "status": "PartiallyPaid", "subTotal": 120, "supplierRef": {"id": "724", "supplierName": "Vendor A.A.A"}, "taxAmount": 24, "totalAmount": 144, "withholdingTax": []}, {"amountDue": 500, "currency": "GBP", "currencyRate": 1, "dueDate": "2022-07-15T00:00:00", "id": "165372", "issueDate": "2022-07-15T00:00:00", "lineItems": [{"accountRef": {"id": "844", "name": "Asset account test 2"}, "isDirectCost": false, "quantity": 1, "subTotal": 555.78, "totalAmount": 555.78, "tracking": {"categoryRefs": [{"id": "location-4", "name": "Europe"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "location-4", "name": "Europe"}], "unitAmount": 555.78}], "modifiedDate": "2023-01-30T14:47:34Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -55.78}, "payment": {"accountRef": {"id": "825", "name": "Codat Europe Bank"}, "currency": "GBP", "currencyRate": 1, "id": "165373", "paidOnDate": "2022-07-15T00:00:00", "reference": "Bill Payment #2", "totalAmount": 555.78}}], "purchaseOrderRefs": [], "sourceModifiedDate": "2022-07-15T11:35:47", "status": "PartiallyPaid", "subTotal": 555.78, "supplierRef": {"id": "724", "supplierName": "Vendor A.A.A"}, "taxAmount": 0, "totalAmount": 555.78, "withholdingTax": []}], "totalResults": 3} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2024-01-01T00:00:00", "id": "3691-1071520776", "issueDate": "2022-12-02T00:00:00", "lineItems": [{"accountRef": {"id": "C0000-933270541", "name": "Accounts Payable"}, "description": "Cabinets:Light Pine - Light pine kitchen cabinet wall unit \n#CLD- 1235-p", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "110000-933272656", "name": "Cabinets:Light Pine"}, "quantity": 5, "subTotal": 7500, "taxAmount": 0, "totalAmount": 7500, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 1500}, {"accountRef": {"id": "C0000-933270541", "name": "Accounts Payable"}, "description": "Hardware:Doorknobs Std - Doorknobs Part # DK 3704", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "130000-933272656", "name": "Hardware:Doorknobs Std"}, "quantity": 100, "subTotal": 2700, "taxAmount": 0, "totalAmount": 2700, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 27}, {"accountRef": {"id": "C0000-933270541", "name": "Accounts Payable"}, "description": "Hardware:Lk Doorknobs - Locking interior doorknobs Part # DK415", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "140000-933272656", "name": "Hardware:Lk Doorknobs"}, "quantity": 100, "subTotal": 3495, "taxAmount": 0, "totalAmount": 3495, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 34.95}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:06:42Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -8695}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "9E4C-1182131999", "paidOnDate": "2023-01-31T00:00:00", "reference": "115", "totalAmount": 13759}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5000}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "36AD-1071520917", "note": "RC 93", "paidOnDate": "2024-12-05T00:00:00", "reference": "484", "totalAmount": 5325}}], "purchaseOrderRefs": [{"id": "3684-1071520443", "purchaseOrderNumber": "6225"}], "reference": "3847498", "sourceModifiedDate": "2023-12-16T05:06:30", "status": "Paid", "subTotal": 13695, "supplierRef": {"id": "B0000-933272656", "supplierName": "Patton Hardware Supplies"}, "taxAmount": 0, "totalAmount": 13695, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2024-01-14T00:00:00", "id": "5CAB-1197713763", "issueDate": "2022-12-15T00:00:00", "lineItems": [{"accountRef": {"id": "490000-933270542", "name": "Gas and Electric"}, "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "quantity": 1, "subTotal": 532, "taxAmount": 0, "totalAmount": 532, "tracking": {"categoryRefs": [{"id": "80000007-1197713802", "name": "Overhead"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "80000007-1197713802", "name": "Overhead"}], "unitAmount": 532}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:06:42Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -532}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "9E42-1182131999", "paidOnDate": "2023-01-31T00:00:00", "reference": "113", "totalAmount": 532}}], "purchaseOrderRefs": [], "reference": "8374892", "sourceModifiedDate": "2023-12-16T05:06:30", "status": "Paid", "subTotal": 532, "supplierRef": {"id": "30000-933272656", "supplierName": "C. U. Electric"}, "taxAmount": 0, "totalAmount": 532, "withholdingTax": []}], "totalResults": 239} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2019-05-13T00:00:00", "id": "18", "issueDate": "2019-05-13T00:00:00", "lineItems": [{"accountRef": {"id": "16", "name": "Advertising"}, "discountAmount": 0, "isDirectCost": false, "quantity": 1, "subTotal": 5, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 5, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 5}], "modifiedDate": "2023-01-18T11:02:41Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "20", "paidOnDate": "2019-05-13T00:00:00", "totalAmount": 0}}], "purchaseOrderRefs": [], "reference": "12", "sourceModifiedDate": "2022-05-26T10:34:10Z", "status": "Paid", "subTotal": 5, "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "taxAmount": 0, "totalAmount": 5, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2019-05-13T00:00:00", "id": "22", "issueDate": "2019-05-13T00:00:00", "lineItems": [{"accountRef": {"id": "16", "name": "Advertising"}, "discountAmount": 0, "isDirectCost": false, "quantity": 1, "subTotal": 5, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 5, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 5}], "modifiedDate": "2023-01-18T11:02:41Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "678", "note": "payment note test", "paidOnDate": "2020-03-23T00:00:00", "totalAmount": 0}}], "purchaseOrderRefs": [], "reference": "12", "sourceModifiedDate": "2020-03-23T10:44:06Z", "status": "Paid", "subTotal": 5, "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "taxAmount": 0, "totalAmount": 5, "withholdingTax": []}], "totalResults": 147} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "HKD", "currencyRate": 0.081142, "dueDate": "2016-01-16T00:00:00", "id": "157", "issueDate": "2016-01-06T00:00:00", "lineItems": [{"description": "Water bottles -- generic", "discountAmount": 0, "isDirectCost": false, "itemRef": {"id": "19", "name": "Water Bottles"}, "quantity": 100, "subTotal": 6617.17, "taxAmount": 1323.43, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Bills", "name": "20.0% S Bills"}, "totalAmount": 7940.6, "tracking": {"categoryRefs": [], "customerRef": {"companyName": "Oxon Insurance - Holiday Party", "id": "55"}, "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 66.1717023}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:58Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "HKD", "currencyRate": 1, "totalAmount": -7940.6}, "payment": {"accountRef": {"id": "81", "name": "Current"}, "currency": "HKD", "currencyRate": 0.078807, "id": "158", "paidOnDate": "2016-01-23T00:00:00", "reference": "1067", "totalAmount": 7940.6}}], "purchaseOrderRefs": [], "sourceModifiedDate": "2023-01-26T11:20:45Z", "status": "Paid", "subTotal": 6617.17, "supplierRef": {"id": "57", "supplierName": "Hall's Promo Items"}, "taxAmount": 1323.43, "totalAmount": 7940.6, "withholdingTax": []}, {"amountDue": 0, "currency": "HKD", "currencyRate": 0.081142, "dueDate": "2016-01-06T00:00:00", "id": "28", "issueDate": "2016-01-06T00:00:00", "lineItems": [{"description": "promotional items -- misc engraved items", "discountAmount": 0, "isDirectCost": false, "itemRef": {"id": "12", "name": "Misc"}, "quantity": 75, "subTotal": 618.75, "taxAmount": 123.75, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Bills", "name": "20.0% S Bills"}, "totalAmount": 742.5, "tracking": {"categoryRefs": [], "customerRef": {"companyName": "Ecker Holiday event", "id": "59"}, "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 8.25}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:58Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "HKD", "currencyRate": 1, "totalAmount": -742.5}, "payment": {"accountRef": {"id": "81", "name": "Current"}, "currency": "HKD", "currencyRate": 0.078807, "id": "159", "paidOnDate": "2016-01-23T00:00:00", "reference": "1068", "totalAmount": 742.5}}], "purchaseOrderRefs": [], "sourceModifiedDate": "2016-09-13T21:19:49Z", "status": "Paid", "subTotal": 618.75, "supplierRef": {"id": "57", "supplierName": "Hall's Promo Items"}, "taxAmount": 123.75, "totalAmount": 742.5, "withholdingTax": []}], "totalResults": 711} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 120, "currency": "GBP", "currencyRate": 1, "dueDate": "2020-02-15T00:00:00Z", "id": "45121", "issueDate": "2020-07-22T00:00:00Z", "lineItems": [{"description": "Tax Summary - Tax Rate 1", "discountAmount": 0.5, "isDirectCost": false, "quantity": 0, "subTotal": 0, "taxAmount": 20, "taxRateRef": {"effectiveTaxRate": 20, "id": "1729", "name": "Standard rate"}, "totalAmount": 20, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 2.5, "isDirectCost": false, "quantity": 0, "subTotal": 100, "taxAmount": 0, "totalAmount": 100, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:36:01Z", "note": "No1", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "Order no 1", "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Open", "subTotal": 100, "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "taxAmount": 20, "totalAmount": 120, "withholdingTax": []}, {"amountDue": 179.1, "currency": "GBP", "currencyRate": 1, "dueDate": "2020-03-01T00:00:00Z", "id": "45131", "issueDate": "2020-07-22T00:00:00Z", "lineItems": [{"description": "Tax Summary - Tax Rate 1", "discountAmount": 0, "isDirectCost": false, "quantity": 0, "subTotal": 0, "taxAmount": 31.6, "taxRateRef": {"effectiveTaxRate": 20, "id": "1729", "name": "Standard rate"}, "totalAmount": 31.6, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 0, "isDirectCost": false, "quantity": 0, "subTotal": 158, "taxAmount": 0, "totalAmount": 158, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:36:01Z", "note": "No2", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 10.5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "45391", "note": "ret1", "paidOnDate": "2020-01-20T00:00:00", "reference": "Return 1", "totalAmount": 0}}], "purchaseOrderRefs": [], "reference": "Order 2", "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "PartiallyPaid", "subTotal": 158, "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "taxAmount": 31.6, "totalAmount": 189.6, "withholdingTax": []}], "totalResults": 162} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2022-01-31T00:00:00", "id": "92", "issueDate": "2021-01-01T00:00:00", "lineItems": [{"accountRef": {"id": "5000", "name": "Materials Purchased"}, "description": "Goods", "isDirectCost": false, "quantity": 1, "subTotal": 5000, "taxAmount": 875, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 5875, "tracking": {"categoryRefs": [{"id": "department_7", "name": "Workshop"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department_7", "name": "Workshop"}], "unitAmount": 5875}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:44Z", "note": "Goods", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5875}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "260", "note": "Purchase payment 260 linked to, purchase invoice 11, purchase invoice 18, purchase invoice 92, purchase invoice 93.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 7141.98}}], "purchaseOrderRefs": [], "reference": "2569", "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Paid", "subTotal": 5000, "supplierRef": {"id": "THO001", "supplierName": "Thompsons Electricals"}, "taxAmount": 875, "totalAmount": 5875, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2022-02-14T00:00:00", "id": "93", "issueDate": "2021-01-15T00:00:00", "lineItems": [{"accountRef": {"id": "5000", "name": "Materials Purchased"}, "description": "Goods", "isDirectCost": false, "quantity": 1, "subTotal": 1000, "taxAmount": 175, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 1175, "tracking": {"categoryRefs": [{"id": "department_7", "name": "Workshop"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department_7", "name": "Workshop"}], "unitAmount": 1175}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:44Z", "note": "Goods", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -1175}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "260", "note": "Purchase payment 260 linked to, purchase invoice 11, purchase invoice 18, purchase invoice 92, purchase invoice 93.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 7141.98}}], "purchaseOrderRefs": [], "reference": "2570", "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Paid", "subTotal": 1000, "supplierRef": {"id": "THO001", "supplierName": "Thompsons Electricals"}, "taxAmount": 175, "totalAmount": 1175, "withholdingTax": []}], "totalResults": 95} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 405.6, "currency": "GBP", "currencyRate": 1, "dueDate": "2018-07-19T00:00:00", "id": "15a7a15773b011e8aaa5027d54329956", "issueDate": "2018-06-19T00:00:00", "lineItems": [{"accountRef": {"id": "9a995955267a11e797950a57719b2edb", "name": "Cost of sales - goods"}, "description": "Consulting services", "isDirectCost": false, "itemRef": {"id": "a87b922b33de11e797950a57719b2edb", "name": "Consulting services"}, "quantity": 33, "subTotal": 363, "taxAmount": 72.6, "taxRateRef": {"effectiveTaxRate": 20, "id": "GB_STANDARD", "name": "Standard 20.00%"}, "totalAmount": 435.6, "trackingCategoryRefs": [], "unitAmount": 11}], "modifiedDate": "2022-10-24T14:56:08Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "f11134e299cb4456be096265136a7770", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "e3e35dcda09642ca8880fc603b0a98e9", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "d9b643b9d6e149f4b443cbc6f22fe1dd", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "cbff2fed2f1641b7bee59f5dd68d29a1", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "3c3ed62353cf4d148352a14027738dbe", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "332e402b9d4b4614af82594d186f5f29", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}], "purchaseOrderRefs": [], "reference": "19/06/2018 - 435.60", "sourceModifiedDate": "2020-02-05T15:19:28Z", "status": "PartiallyPaid", "subTotal": 363, "supplierRef": {"id": "ca430e0d156011e8b45c025132dab352", "supplierName": "Test Supplier"}, "taxAmount": 72.6, "totalAmount": 435.6, "withholdingTax": []}, {"amountDue": 0, "currency": "USD", "currencyRate": 0.752601305, "dueDate": "2018-07-25T00:00:00", "id": "09034445789211e8aaa5027d54329956", "issueDate": "2018-06-25T00:00:00", "lineItems": [{"accountRef": {"id": "9a995955267a11e797950a57719b2edb", "name": "Cost of sales - goods"}, "description": "Bagels", "isDirectCost": false, "quantity": 1, "subTotal": 1000, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "GB_ZERO", "name": "Zero Rated 0.00%"}, "totalAmount": 1000, "trackingCategoryRefs": [], "unitAmount": 1000}], "modifiedDate": "2022-10-24T14:56:08Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "USD", "currencyRate": 1, "totalAmount": -1000}, "payment": {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "USD", "currencyRate": 0.734679838, "id": "66d010243e3441ba89a793446eb9c74b", "note": "Supplier payment using credit/debit card - Test note", "paidOnDate": "2022-02-16T00:00:00", "totalAmount": 1000}}], "purchaseOrderRefs": [], "reference": "25/06/2018 - 1,000.00", "sourceModifiedDate": "2022-02-22T13:48:56Z", "status": "Paid", "subTotal": 1000, "supplierRef": {"id": "ec716559789111e8aaa5027d54329956", "supplierName": "Bagels Limited"}, "taxAmount": 0, "totalAmount": 1000, "withholdingTax": []}], "totalResults": 4658} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "dueDate": "2021-10-29T00:00:00", "id": "4470", "issueDate": "2021-10-19T00:00:00", "lineItems": [{"accountRef": {"id": "3", "name": "Accounts Payable"}, "isDirectCost": false, "quantity": 1, "subTotal": 25, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "82", "name": "UK Purchase Goods Zero Rate"}, "totalAmount": 25, "tracking": {"categoryRefs": [{"id": "DEPARTMENT-3", "name": "Admin"}, {"id": "LOCATION-11", "name": "Codat Test Entity"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "DEPARTMENT-3", "name": "Admin"}, {"id": "LOCATION-11", "name": "Codat Test Entity"}], "unitAmount": 25}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:37Z", "note": "", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -20}, "payment": {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "id": "4471", "note": "", "paidOnDate": "2022-01-06T00:00:00", "totalAmount": 20}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "id": "4472", "note": "", "paidOnDate": "2022-01-06T00:00:00", "totalAmount": 5}}], "purchaseOrderRefs": [], "reference": "test", "sourceModifiedDate": "2022-02-23T12:06:58", "status": "Paid", "subTotal": 25, "supplierRef": {"id": "3", "supplierName": "ADP"}, "taxAmount": 0, "totalAmount": 25, "withholdingTax": []}, {"amountDue": 10, "currency": "USD", "currencyRate": 14, "dueDate": "2022-02-19T00:00:00", "id": "4705", "issueDate": "2022-02-04T00:00:00", "lineItems": [{"accountRef": {"id": "3", "name": "Accounts Payable"}, "description": "Some text for a description", "isDirectCost": false, "quantity": 1, "subTotal": 10, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "49", "name": "EC Purchase Goods Zero Rate"}, "totalAmount": 10, "tracking": {"categoryRefs": [{"id": "DEPARTMENT-3", "name": "Admin"}, {"id": "LOCATION-11", "name": "Codat Test Entity"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "DEPARTMENT-3", "name": "Admin"}, {"id": "LOCATION-11", "name": "Codat Test Entity"}], "unitAmount": 10}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:37Z", "note": "Some note on my bill", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "JohnAndRob", "sourceModifiedDate": "2022-04-22T12:24:59", "status": "Open", "subTotal": 10, "supplierRef": {"id": "8", "supplierName": "Worldwide Commercial"}, "taxAmount": 0, "totalAmount": 10, "withholdingTax": []}], "totalResults": 17} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2021-12-20T00:00:00", "id": "3945273c-cc04-479f-a4b5-1e3dc7a55ed1", "issueDate": "2021-11-19T00:00:00", "lineItems": [{"accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10", "name": "Consulting"}, "description": "Half day training - Microsoft Office", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "489558f5-27b7-4f37-ad9f-d84611c2e2ab", "name": "Half day training - Microsoft Office"}, "quantity": 1, "subTotal": 1800, "taxAmount": 360, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 2160, "trackingCategoryRefs": [], "unitAmount": 1800}, {"accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce", "name": "General Expenses"}, "description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "f8fb7e00-5e5d-466c-aef0-15861f73d04f", "name": "Desktop/network support via email & phone"}, "quantity": 1, "subTotal": 4000, "taxAmount": 800, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 4800, "trackingCategoryRefs": [], "unitAmount": 4000}, {"accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a", "name": "Printing & Stationery"}, "description": "Stationery charges", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "quantity": 8, "subTotal": 256, "taxAmount": 51.2, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 307.2, "trackingCategoryRefs": [], "unitAmount": 32}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -7267.2}, "payment": {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "74004690-82a1-4810-aaca-6ce575af94b4", "paidOnDate": "2021-12-20T00:00:00", "totalAmount": 7267.2}}], "purchaseOrderRefs": [], "reference": "", "sourceModifiedDate": "2021-01-02T21:07:23", "status": "Paid", "subTotal": 6056, "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "taxAmount": 1211.2, "totalAmount": 7267.2, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2022-02-17T00:00:00", "id": "09aa506f-cb81-4cd3-a1ea-6a0b91804d5a", "issueDate": "2022-01-17T00:00:00", "lineItems": [{"accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10", "name": "Consulting"}, "description": "Half day training - Microsoft Office", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "489558f5-27b7-4f37-ad9f-d84611c2e2ab", "name": "Half day training - Microsoft Office"}, "quantity": 1, "subTotal": 1800, "taxAmount": 360, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 2160, "trackingCategoryRefs": [], "unitAmount": 1800}, {"accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce", "name": "General Expenses"}, "description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "f8fb7e00-5e5d-466c-aef0-15861f73d04f", "name": "Desktop/network support via email & phone"}, "quantity": 1, "subTotal": 4000, "taxAmount": 800, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 4800, "trackingCategoryRefs": [], "unitAmount": 4000}, {"accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a", "name": "Printing & Stationery"}, "description": "Stationery charges", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "quantity": 8, "subTotal": 256, "taxAmount": 51.2, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 307.2, "trackingCategoryRefs": [], "unitAmount": 32}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -7267.2}, "payment": {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "f2062172-b444-4c8b-b797-9f4c7a4244c7", "paidOnDate": "2022-02-17T00:00:00", "totalAmount": 7267.2}}], "purchaseOrderRefs": [], "reference": "", "sourceModifiedDate": "2021-01-02T21:06:22", "status": "Paid", "subTotal": 6056, "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "taxAmount": 1211.2, "totalAmount": 7267.2, "withholdingTax": []}], "totalResults": 44} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2020-06-23T00:00:00", "id": "104957000000152027", "issueDate": "2020-06-23T00:00:00", "lineItems": [], "modifiedDate": "2022-10-03T08:40:37Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "1", "sourceModifiedDate": "2020-06-23T13:47:17", "status": "Paid", "subTotal": 0, "supplierRef": {"id": "104957000000152001", "supplierName": "Mr. P N"}, "taxAmount": 0, "totalAmount": 10, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2020-06-23T00:00:00", "id": "104957000000152067", "issueDate": "2020-06-23T00:00:00", "lineItems": [], "modifiedDate": "2022-10-03T08:40:37Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "2", "sourceModifiedDate": "2020-11-04T13:07:23", "status": "Paid", "subTotal": 0, "supplierRef": {"id": "104957000000152001", "supplierName": "Mr. P N"}, "taxAmount": 0, "totalAmount": 12, "withholdingTax": []}], "totalResults": 36} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + list-accounting-bill-attachments: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + download-accounting-supplier-attachment: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + supplierId: "" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-supplier: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Cesarmouth", "country": "United Kingdom", "line1": "Suite 431", "line2": "289 Giles Lake", "postalCode": "BG40 9GP", "region": "Northern Ireland", "type": "Delivery"}], "contactName": "Faye Hansen", "defaultCurrency": "GBP", "emailAddress": "hello@Abshire-Kshlerin.info", "id": "owQ2Gqgj9f", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "phone": "01338 858162", "registrationNumber": "VYL1XZXR", "sourceModifiedDate": "1660-11-28T23:18:00", "status": "Active", "supplierName": "Abshire - Kshlerin", "taxNumber": "1396267523.0914588"} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "", "country": "GB", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "78623f13-931e-eb11-bbf8-0022481b3585", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:12Z", "phone": "", "sourceModifiedDate": "2020-11-04T11:44:22Z", "status": "Active", "supplierName": "", "taxNumber": ""} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Bakersfield", "country": "US", "line1": "Unit 51", "postalCode": "933081", "region": "California", "type": "Billing"}], "contactName": "Kelly's Contact Name", "defaultCurrency": "EUR", "emailAddress": "sales@kellysupplies.com", "id": "3150917c-1d92-4d77-9018-31b5c4758ca9", "modifiedDate": "2022-10-26T13:32:05Z", "phone": "07999 999999", "registrationNumber": "8409314368", "sourceModifiedDate": "2022-07-15T12:01:15Z", "status": "Active", "supplierName": "Abe"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"country": "GB", "type": "Billing"}], "defaultCurrency": "GBP", "id": "0185fea2-0298-445b-909a-0db685118a9e", "modifiedDate": "2022-10-26T13:33:13Z", "phone": "01224 658 999", "sourceModifiedDate": "2017-08-02T10:58:54Z", "status": "Active", "supplierName": "a"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Test 1", "id": "11526230", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:08Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2023-04-17T06:02:46", "status": "Active", "supplierName": "-"} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [], "id": "api vendor", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:25Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "supplierName": "api vendor"} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [], "contactName": "", "emailAddress": "", "id": "6202387", "modifiedDate": "2022-09-30T10:29:15Z", "phone": "", "sourceModifiedDate": "2017-05-09T00:00:00", "status": "Unknown", "supplierName": "Dell", "taxNumber": ""} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [], "contactName": "Test Vendor", "defaultCurrency": "GBP", "emailAddress": "", "id": "779", "modifiedDate": "2023-01-30T14:47:02Z", "phone": "", "sourceModifiedDate": "2022-02-04T14:24:43", "status": "Active", "supplierName": "Test Vendor"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Berkeley", "line1": "A Cheung Limited, Angela Cheung", "line2": "3818 Bear Rd. West", "postalCode": "94688", "region": "CA", "type": "Billing"}], "contactName": "Angela Cheung", "defaultCurrency": "GBP", "emailAddress": "AC@CheungLimited.com", "id": "A60000-1197760912", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:09:03Z", "phone": "510 555 5723", "sourceModifiedDate": "2023-12-16T05:06:44", "status": "Active", "supplierName": "A Cheung Limited"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"country": "Djibouti", "line1": "test", "region": "string", "type": "Billing"}], "contactName": "AI Support", "defaultCurrency": "GBP", "id": "41", "modifiedDate": "2023-01-18T11:02:36Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2022-12-07T10:48:18Z", "status": "Active", "supplierName": "AI Support"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "London", "country": "England", "line1": "100 London Road", "line2": "Angel", "postalCode": "EC1M", "region": "Greater London", "type": "Billing"}], "contactName": "Miss Smith", "defaultCurrency": "GBP", "id": "129", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:55Z", "phone": "0728 38474", "sourceModifiedDate": "2023-04-13T01:51:08Z", "status": "Active", "supplierName": "Ally Johnson"} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "", "country": "Great Britain", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Unknown"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "776", "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-14T09:35:58Z", "phone": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Archived", "supplierName": "Aaren", "taxNumber": ""} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Newcastle Upon Tyne", "country": "GB", "line1": "66 New Street", "line2": "Ridgeway", "postalCode": "NE1 4GF", "region": "", "type": "Delivery"}, {"city": "Newcastle upon Tyne", "country": "GB", "line1": "66 New Street", "line2": "Ridgeway", "postalCode": "NE1 4GF", "region": "", "type": "Unknown"}], "contactName": "Mark Ramsay", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "CON001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:38Z", "phone": "0191 643 4343", "sourceModifiedDate": "2022-11-25T09:43:54Z", "status": "Active", "supplierName": "Concept Stationery Supplies", "taxNumber": "GB988 3453 23"} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"country": "United Kingdom (GB)", "type": "Billing"}], "contactName": "Main Contact", "defaultCurrency": "GBP", "id": "65179671e9ef424caff8b9006cd111c8", "modifiedDate": "2022-10-24T14:52:54Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2020-02-25T17:23:33Z", "status": "Active", "supplierName": "5555 Abdul's Test Name"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Dallas", "country": "United States", "line1": "208 S Akard St", "line2": "", "postalCode": "75265", "region": "TX", "type": "Unknown"}], "contactName": "Jones, William", "defaultCurrency": "USD", "id": "3", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:20Z", "phone": "214-760-9491", "registrationNumber": "", "sourceModifiedDate": "2023-02-16T09:48:27", "status": "Active", "supplierName": "ADP", "taxNumber": "85-3678274"} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1ZlbmRvcjo2NjA0Nzk0", "modifiedDate": "2022-11-16T18:15:24Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2020-04-07T13:28:02Z", "status": "Active", "supplierName": "Computer Shop"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [], "emailAddress": "", "id": "e4c9d0e2-c285-4e85-b579-6d28b180c730", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "phone": "01224 658 999", "sourceModifiedDate": "2023-02-17T18:03:42", "status": "Active", "supplierName": "24 Locks"} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [], "defaultCurrency": "GBP", "emailAddress": "", "id": "104957000001494001", "modifiedDate": "2022-10-03T08:40:37Z", "phone": "01224 658 999", "sourceModifiedDate": "2022-09-16T13:09:56", "status": "Active", "supplierName": "Acme Corporation"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-supplier-attachment: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + supplierId: "" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounting-suppliers: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"addresses": [{"city": "Bakersfield", "country": "USA", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "region": "California", "type": "Billing"}], "contactName": "Kelly's Industrial Supplies", "defaultCurrency": "string", "emailAddress": "sales@kellysupplies.com", "id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-23T00:00:00Z", "phone": "07999 999999", "registrationNumber": "string", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown", "supplementalData": {"content": {"property1": {"property1": "", "property2": ""}, "property2": {"property1": "", "property2": ""}}}, "supplierName": "Kelly's Industrial Supplies", "taxNumber": "string"}], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Cesarmouth", "country": "United Kingdom", "line1": "Suite 431", "line2": "289 Giles Lake", "postalCode": "BG40 9GP", "region": "Northern Ireland", "type": "Delivery"}], "contactName": "Faye Hansen", "defaultCurrency": "GBP", "emailAddress": "hello@Abshire-Kshlerin.info", "id": "owQ2Gqgj9f", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "phone": "01338 858162", "registrationNumber": "VYL1XZXR", "sourceModifiedDate": "1660-11-28T23:18:00", "status": "Active", "supplierName": "Abshire - Kshlerin", "taxNumber": "1396267523.0914588"}, {"addresses": [{"city": "Fernandohaven", "country": "United Kingdom", "line1": "Suite 214", "line2": "8439 Lueilwitz Passage", "postalCode": "JG04 7PV", "region": "Northern Ireland", "type": "Delivery"}, {"city": "Juliochester", "country": "United Kingdom", "line1": "Suite 096", "line2": "864 Halie Course", "postalCode": "DZ8 4BF", "region": "England", "type": "Delivery"}, {"city": "Naderborough", "country": "United Kingdom", "line1": "Suite 001", "line2": "416 Stokes Fords", "postalCode": "XG25 0XX", "region": "Wales", "type": "Delivery"}], "contactName": "Werner Langworth", "defaultCurrency": "GBP", "emailAddress": "Arjun34@hotmail.com", "id": "FyUkHbZxhn", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "phone": "0116 796 3163", "registrationNumber": "NI7JEJVM", "sourceModifiedDate": "0177-04-27T11:56:00", "status": "Active", "supplierName": "Arjun Kuvalis", "taxNumber": "7505220209.583549"}], "totalResults": 100} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "", "country": "GB", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "78623f13-931e-eb11-bbf8-0022481b3585", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:12Z", "phone": "", "sourceModifiedDate": "2020-11-04T11:44:22Z", "status": "Active", "supplierName": "", "taxNumber": ""}, {"addresses": [{"city": "", "country": "GB", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "be49ec62-6754-ed11-946f-0022481b67d1", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:12Z", "phone": "", "sourceModifiedDate": "2022-10-25T13:17:36Z", "status": "Active", "supplierName": "", "taxNumber": ""}], "totalResults": 31} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Bakersfield", "country": "US", "line1": "Unit 51", "postalCode": "933081", "region": "California", "type": "Billing"}], "contactName": "Kelly's Contact Name", "defaultCurrency": "EUR", "emailAddress": "sales@kellysupplies.com", "id": "3150917c-1d92-4d77-9018-31b5c4758ca9", "modifiedDate": "2022-10-26T13:32:05Z", "phone": "07999 999999", "registrationNumber": "8409314368", "sourceModifiedDate": "2022-07-15T12:01:15Z", "status": "Active", "supplierName": "Abe"}, {"addresses": [{"city": "city", "country": "RU", "line1": "line1", "line2": "line2", "postalCode": "postal", "region": "region", "type": "Billing"}], "contactName": "Ann's contact name", "defaultCurrency": "USD", "emailAddress": "anna@anna888888.com", "id": "00014c12-2616-481a-a2e8-31bdf2497775", "modifiedDate": "2022-10-26T13:32:05Z", "phone": "55555555", "registrationNumber": "55566677788899944455", "sourceModifiedDate": "2021-06-09T12:04:08Z", "status": "Active", "supplierName": "Ann's test supplier 2", "taxNumber": "RU4444444"}], "totalResults": 73} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"country": "GB", "type": "Billing"}], "defaultCurrency": "GBP", "id": "0185fea2-0298-445b-909a-0db685118a9e", "modifiedDate": "2022-10-26T13:33:13Z", "phone": "01224 658 999", "sourceModifiedDate": "2017-08-02T10:58:54Z", "status": "Active", "supplierName": "a"}, {"addresses": [{"country": "GB", "type": "Billing"}], "defaultCurrency": "GBP", "id": "64ae712f-4155-48bb-9fce-98232c51d979", "modifiedDate": "2022-10-26T13:33:13Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2020-05-01T14:05:46Z", "status": "Active", "supplierName": "aa"}], "totalResults": 118} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Test 1", "id": "11526230", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:08Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2023-04-17T06:02:46", "status": "Active", "supplierName": "-"}, {"addresses": [{"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Test 1", "id": "9677150", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:08Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2023-04-24T06:19:23", "status": "Active", "supplierName": "-"}], "totalResults": 159} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "id": "api vendor", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:25Z", "phone": "01224 658 999", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "supplierName": "api vendor"}, {"addresses": [], "id": "DUndsRykrmy8kFsc+FvYk29YkJze4zSjGecoF4YcUEhVU7auJ5JkQA0VjXptZ7XQ+D4n6WoxFIkaGY2V/t4flA==", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:25Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "supplierName": "Chekko Test merchant 100 - Test Very long name: ORIG CO NAME:AMERICAN EXPRESS ORIG ID:9493560001 DESC DATE:220307 CO ENTRY DESCR:ACH PMT SEC:CCD TRACE#:021000023255482 EED:220307 IND ID:A4670 IND NAME:Rick Sanchez"}], "totalResults": 7} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "", "emailAddress": "", "id": "6202387", "modifiedDate": "2022-09-30T10:29:15Z", "phone": "", "sourceModifiedDate": "2017-05-09T00:00:00", "status": "Unknown", "supplierName": "Dell", "taxNumber": ""}, {"addresses": [], "contactName": "", "emailAddress": "", "id": "9338173", "modifiedDate": "2022-09-30T10:29:15Z", "phone": "", "sourceModifiedDate": "1990-01-01T00:00:00", "status": "Unknown", "supplierName": "Home", "taxNumber": ""}], "totalResults": 7} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "Test Vendor", "defaultCurrency": "GBP", "emailAddress": "", "id": "779", "modifiedDate": "2023-01-30T14:47:02Z", "phone": "", "sourceModifiedDate": "2022-02-04T14:24:43", "status": "Active", "supplierName": "Test Vendor"}, {"addresses": [], "contactName": "Vendor -.A", "defaultCurrency": "GBP", "emailAddress": "", "id": "726", "modifiedDate": "2023-01-30T14:47:02Z", "phone": "", "sourceModifiedDate": "2021-03-26T09:53:15", "status": "Active", "supplierName": "Vendor -.A"}], "totalResults": 6} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Berkeley", "line1": "A Cheung Limited, Angela Cheung", "line2": "3818 Bear Rd. West", "postalCode": "94688", "region": "CA", "type": "Billing"}], "contactName": "Angela Cheung", "defaultCurrency": "GBP", "emailAddress": "AC@CheungLimited.com", "id": "A60000-1197760912", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:09:03Z", "phone": "510 555 5723", "sourceModifiedDate": "2023-12-16T05:06:44", "status": "Active", "supplierName": "A Cheung Limited"}, {"addresses": [{"city": "Middlefield", "line1": "Bank of Anycity, Lisa Holzhauser", "line2": "1935 Main Street", "postalCode": "94482", "region": "CA", "type": "Billing"}], "contactName": "Lisa D. Holzhauser", "defaultCurrency": "GBP", "emailAddress": "lisah@samplename.com", "id": "A40000-1197774038", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:09:03Z", "phone": "415-555-9135", "sourceModifiedDate": "2023-12-16T05:06:44", "status": "Active", "supplierName": "Bank of Anycity"}], "totalResults": 54} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"country": "Djibouti", "line1": "test", "region": "string", "type": "Billing"}], "contactName": "AI Support", "defaultCurrency": "GBP", "id": "41", "modifiedDate": "2023-01-18T11:02:36Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2022-12-07T10:48:18Z", "status": "Active", "supplierName": "AI Support"}, {"addresses": [{"country": "DJ", "line1": "test", "region": "string", "type": "Billing"}], "contactName": "AI Support 2", "defaultCurrency": "GBP", "id": "42", "modifiedDate": "2023-01-18T11:02:36Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2021-08-31T08:45:02Z", "status": "Active", "supplierName": "AI Support 2"}], "totalResults": 23} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "London", "country": "England", "line1": "100 London Road", "line2": "Angel", "postalCode": "EC1M", "region": "Greater London", "type": "Billing"}], "contactName": "Miss Smith", "defaultCurrency": "GBP", "id": "129", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:55Z", "phone": "0728 38474", "sourceModifiedDate": "2023-04-13T01:51:08Z", "status": "Active", "supplierName": "Ally Johnson"}, {"addresses": [], "defaultCurrency": "GBP", "id": "88", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:55Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2022-07-06T15:55:28Z", "status": "Active", "supplierName": "Andrew Haberbosch"}], "totalResults": 64} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "", "country": "Great Britain", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Unknown"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "776", "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-14T09:35:58Z", "phone": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Archived", "supplierName": "Aaren", "taxNumber": ""}, {"addresses": [{"city": "", "country": "Great Britain", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Unknown"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "914", "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-14T09:35:58Z", "phone": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Archived", "supplierName": "Aaren", "taxNumber": ""}], "totalResults": 943} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Newcastle Upon Tyne", "country": "GB", "line1": "66 New Street", "line2": "Ridgeway", "postalCode": "NE1 4GF", "region": "", "type": "Delivery"}, {"city": "Newcastle upon Tyne", "country": "GB", "line1": "66 New Street", "line2": "Ridgeway", "postalCode": "NE1 4GF", "region": "", "type": "Unknown"}], "contactName": "Mark Ramsay", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "CON001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:38Z", "phone": "0191 643 4343", "sourceModifiedDate": "2022-11-25T09:43:54Z", "status": "Active", "supplierName": "Concept Stationery Supplies", "taxNumber": "GB988 3453 23"}, {"addresses": [{"city": "Chester le Street", "country": "GB", "line1": "Station Lane Ind Est", "line2": "Birtley", "postalCode": "DH1 3RG", "region": "County Durham", "type": "Delivery"}, {"city": "Chester le Street", "country": "GB", "line1": "Station Lane Ind Est", "line2": "Birtley", "postalCode": "DH1 3RG", "region": "County Durham", "type": "Unknown"}], "contactName": "Stuart Lynn", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "MCN001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:38Z", "phone": "0191 415 3434", "sourceModifiedDate": "2022-12-05T13:37:26Z", "status": "Active", "supplierName": "McNally Computer Supplies", "taxNumber": "GB455 2385 34"}], "totalResults": 15} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"country": "United Kingdom (GB)", "type": "Billing"}], "contactName": "Main Contact", "defaultCurrency": "GBP", "id": "65179671e9ef424caff8b9006cd111c8", "modifiedDate": "2022-10-24T14:52:54Z", "phone": "01224 658 999", "sourceModifiedDate": "2020-02-25T17:23:33Z", "status": "Active", "supplierName": "5555 Abdul's Test Name"}, {"addresses": [{"city": "London", "country": "United Kingdom (GB)", "line1": "1 Place House", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Abdi", "defaultCurrency": "GBP", "emailAddress": "abdisupplier@company.com", "id": "cf7f44d693904944a6a7cf3de0887964", "modifiedDate": "2022-10-24T14:52:54Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2020-02-13T10:38:19Z", "status": "Active", "supplierName": "Abdi Supplier"}], "totalResults": 64} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Dallas", "country": "United States", "line1": "208 S Akard St", "line2": "", "postalCode": "75265", "region": "TX", "type": "Unknown"}], "contactName": "Jones, William", "defaultCurrency": "USD", "id": "3", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:20Z", "phone": "214-760-9491", "registrationNumber": "", "sourceModifiedDate": "2023-02-16T09:48:27", "status": "Active", "supplierName": "ADP", "taxNumber": "85-3678274"}, {"addresses": [{"city": "Drayton Valley", "country": "Canada", "line1": "5 Carey Hill", "line2": "", "postalCode": "G8V", "region": "Alberta", "type": "Unknown"}], "contactName": "Roach, Nathan", "defaultCurrency": "CAD", "id": "29", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:20Z", "phone": "130-202-4796", "registrationNumber": "", "sourceModifiedDate": "2022-06-15T11:38:29", "status": "Active", "supplierName": "Advisor Printing", "taxNumber": ""}], "totalResults": 77} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1ZlbmRvcjo2NjA0Nzk0", "modifiedDate": "2022-11-16T18:15:24Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2020-04-07T13:28:02Z", "status": "Active", "supplierName": "Computer Shop"}, {"addresses": [], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1ZlbmRvcjo2NjA0NzQx", "modifiedDate": "2022-11-16T18:15:24Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2020-04-07T13:12:40Z", "status": "Active", "supplierName": "Flour Mill"}], "totalResults": 9} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "emailAddress": "", "id": "e4c9d0e2-c285-4e85-b579-6d28b180c730", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "phone": "01224 658 999", "sourceModifiedDate": "2023-02-17T18:03:42", "status": "Active", "supplierName": "24 Locks"}, {"addresses": [], "emailAddress": "", "id": "bab779bc-c5fb-42cb-a888-953e8309711c", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "phone": "01224 658 999", "sourceModifiedDate": "2023-02-17T18:03:42", "status": "Active", "supplierName": "7-Eleven"}], "totalResults": 48} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "defaultCurrency": "GBP", "emailAddress": "", "id": "104957000001494001", "modifiedDate": "2022-10-03T08:40:37Z", "phone": "01224 658 999", "sourceModifiedDate": "2022-09-16T13:09:56", "status": "Active", "supplierName": "Acme Corporation"}, {"addresses": [], "contactName": "Dre", "defaultCurrency": "CAD", "emailAddress": "", "id": "104957000000648001", "modifiedDate": "2022-10-03T08:40:37Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2022-06-10T09:07:16", "status": "Active", "supplierName": "Cool company"}], "totalResults": 6} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + list-accounting-supplier-attachments: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + supplierId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-bill-credit-note: + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "109001", "createdFromRefs": [], "currency": "GBP", "discountPercentage": 0, "id": "0deaed0a-9f51-eb11-89f9-00224800af18", "issueDate": "2020-12-21T00:00:00", "lineItems": [{"accountRef": {"id": "6a1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Inventory"}, "description": "Abdi Item No VAT", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "ITEM-dbc37b18-4209-eb11-bbf6-0022481ad2e8-EXPORT-EXPORT", "name": "Abdi Item No VAT / General Business Posting Group: 'EXPORT' / VAT Business Posting Group: 'EXPORT'"}, "quantity": 1, "subTotal": 8, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "6bbc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for EXPORT / ZERO"}, "totalAmount": 8, "trackingCategoryRefs": [], "unitAmount": 8}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:26Z", "note": "BCN001", "paymentAllocations": [], "remainingCredit": 8, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Submitted", "subTotal": 8, "supplierRef": {"id": "be1217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "Fabrikam, Inc."}, "totalAmount": 8, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "19600007", "createdFromRefs": [], "currency": "EUR", "currencyRate": 1, "discountPercentage": 0, "id": "443bd109-e1ed-4de2-b1ab-3b13e980d288", "issueDate": "2019-12-16T00:00:00Z", "lineItems": [{"accountRef": {"id": "5f139759-b554-4314-862e-b9d88e5b2e1b", "name": "Af te dragen loonheffing"}, "description": "Cheesecake", "discountAmount": 0, "quantity": 1, "subTotal": 10, "taxAmount": 2.1, "taxRateRef": {"effectiveTaxRate": 21, "id": "84277189-ad16-456c-b501-ca31f0a483cc", "name": "BTW prive gebruik"}, "totalAmount": 12.1, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-26T13:32:18Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 12.1, "sourceModifiedDate": "2020-01-03T15:06:19Z", "status": "Submitted", "subTotal": 10, "supplierRef": {"id": "5e6f49b9-6489-4b82-83e7-291d308919bb", "supplierName": "Mickey Mouse"}, "totalAmount": 12.1, "totalDiscount": 0, "totalTaxAmount": 2.1, "withholdingTax": []} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "19600008", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "f9083d38-40c7-4b5f-a693-f4670e3d85bc", "issueDate": "2019-10-30T00:00:00Z", "lineItems": [{"accountRef": {"id": "885ff551-664d-451b-995b-cb114c9877d0", "name": "Unallocated Cash"}, "description": "Oil Change", "discountAmount": 0, "itemRef": {"id": "3001"}, "quantity": 1000.5, "subTotal": -150075, "totalAmount": -150075, "trackingCategoryRefs": [], "unitAmount": -150}, {"accountRef": {"id": "885ff551-664d-451b-995b-cb114c9877d0", "name": "Unallocated Cash"}, "description": "description", "discountAmount": 0, "quantity": 1, "subTotal": 250074, "totalAmount": 250074, "trackingCategoryRefs": [], "unitAmount": 250074}], "modifiedDate": "2022-10-26T13:33:23Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 99999, "sourceModifiedDate": "2019-10-30T13:12:56Z", "status": "Submitted", "subTotal": 99999, "supplierRef": {"id": "1c703cce-967c-4476-a86a-32e35341a8f5", "supplierName": "Customer Bill Supplier"}, "totalAmount": 99999, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "Bill Credit", "createdFromRefs": [], "currency": "GBP", "discountPercentage": 0, "id": "10665024", "issueDate": "2018-08-22T00:00:00", "lineItems": [{"accountRef": {"id": "285", "name": "Accommodation and Meals"}, "description": "A & J Fabtech Ltd - Bill Credit Note Bill Credit", "quantity": 1, "taxAmount": 250, "totalAmount": 1500, "trackingCategoryRefs": [], "unitAmount": 1250}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:10Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 1500, "sourceModifiedDate": "2018-08-22T13:22:08Z", "status": "Submitted", "subTotal": 1250, "supplierRef": {"id": "6161941", "supplierName": "A & J Fabtech Ltd"}, "totalAmount": 1500, "totalDiscount": 0, "totalTaxAmount": 250, "withholdingTax": []} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "5", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "91339087", "issueDate": "2020-02-25T00:00:00", "lineItems": [{"accountRef": {"id": "21481832", "name": "Oil"}, "description": "Oil refund", "itemRef": {"id": "114817740"}, "quantity": 1, "subTotal": 10, "taxAmount": 0, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-09-30T10:29:16Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 0, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 0, "supplierRef": {"id": "6202387", "supplierName": "Dell"}, "totalAmount": 10, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "VENDCRED1", "createdFromRefs": [{"dataType": "bills", "id": "1432"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "1781", "issueDate": "2021-11-02T00:00:00", "lineItems": [{"accountRef": {"id": "713", "name": "Inventory Asset"}, "createdFromLineRef": {"dataType": "bills", "id": "1432", "lineNumber": "1"}, "description": "billcredit_test", "quantity": 1, "subTotal": 145.5, "totalAmount": 145.5, "tracking": {"categoryRefs": [{"id": "department-1"}, {"id": "location-1"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department-1"}, {"id": "location-1"}], "unitAmount": 145.5, "unitOfMeasurement": "pack"}], "modifiedDate": "2022-09-20T08:16:22Z", "note": "Codat1", "paymentAllocations": [], "remainingCredit": 174.6, "sourceModifiedDate": "2021-11-02T19:58:58", "status": "Submitted", "subTotal": 145.5, "supplierRef": {"id": "749", "supplierName": "Jo's Cheese"}, "totalAmount": 174.6, "totalDiscount": 0, "totalTaxAmount": 29.1, "withholdingTax": []} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "Return", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "6D2C-1197698059", "issueDate": "2024-10-30T00:00:00", "lineItems": [{"description": "Lumber:Rough - Rough lumber", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "1C0000-933272656", "name": "Lumber:Rough"}, "quantity": 0, "subTotal": 475, "taxAmount": 0, "totalAmount": 475, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 475}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:30Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 475}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "6D2C-1197698059", "paidOnDate": "2024-10-30T00:00:00", "reference": "Return", "totalAmount": 0}}], "remainingCredit": 475, "sourceModifiedDate": "2023-12-16T05:06:19", "status": "Submitted", "subTotal": 475, "supplierRef": {"id": "E0000-933272656", "supplierName": "Timberloft Lumber"}, "totalAmount": 475, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "19", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "19", "issueDate": "2019-05-13T00:00:00", "lineItems": [{"accountRef": {"id": "16", "name": "Advertising"}, "description": "", "quantity": 1, "subTotal": 5, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 5, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 5}], "modifiedDate": "2023-01-18T11:02:37Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "20", "paidOnDate": "2019-05-13T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2019-05-13T13:14:06Z", "status": "Paid", "subTotal": 5, "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "totalAmount": 5, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "424", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "424", "issueDate": "2019-06-20T00:00:00", "lineItems": [{"accountRef": {"id": "30", "name": "Janitorial Expense"}, "description": "Refund of iZettle Fees", "quantity": 1, "subTotal": 69, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "20_Bills", "name": "5.0% RC CIS Bills"}, "totalAmount": 69, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 69}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:58Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 69, "sourceModifiedDate": "2019-06-20T15:48:50Z", "status": "Submitted", "subTotal": 69, "supplierRef": {"id": "24", "supplierName": "Brijesh Jain"}, "totalAmount": 69, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2020-01-20T00:00:00Z", "billCreditNoteNumber": "Return 1", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 2.5, "id": "45391", "issueDate": "2020-07-22T00:00:00Z", "lineItems": [{"description": "Tax Summary - Tax Rate 1", "discountAmount": 0.5, "quantity": 0, "subTotal": 0, "taxAmount": 20, "taxRateRef": {"effectiveTaxRate": 20, "id": "1729", "name": "Standard rate"}, "totalAmount": 20, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 2.5, "quantity": 0, "subTotal": 100, "taxAmount": 0, "totalAmount": 100, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:35:52Z", "note": "ret1", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10.5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "45391", "note": "ret1", "paidOnDate": "2020-01-20T00:00:00", "reference": "Return 1", "totalAmount": 0}}], "remainingCredit": 109.5, "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Submitted", "subTotal": 100, "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "totalAmount": 120, "totalDiscount": 2.5, "totalTaxAmount": 20, "withholdingTax": []} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "O/BAL", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "20", "issueDate": "2021-12-31T00:00:00", "lineItems": [{"accountRef": {"id": "9998", "name": "Suspense Account"}, "description": "Opening Balance", "quantity": 1, "subTotal": 0.01, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "9", "name": "Non-Vatable Tax Code"}, "totalAmount": 0.01, "tracking": {"categoryRefs": [{"id": "department_0", "name": "Default"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department_0", "name": "Default"}], "unitAmount": 0.01}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "note": "Opening Balance", "paymentAllocations": [], "remainingCredit": 0.01, "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Submitted", "subTotal": 0.01, "supplierRef": {"id": "NEW001", "supplierName": "Newtown Builders Ltd"}, "totalAmount": 0.01, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "Supplier credit note", "createdFromRefs": [], "currency": "USD", "currencyRate": 0.776970973, "discountPercentage": 0, "id": "b6c6fce9866849b0b44cac99ab7dc579", "issueDate": "2018-11-23T00:00:00", "lineItems": [{"accountRef": {"id": "9a995955267a11e797950a57719b2edb", "name": "Cost of sales - goods"}, "description": "Consulting services", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "a87b922b33de11e797950a57719b2edb", "name": "Consulting services"}, "quantity": 1, "subTotal": 10, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "GB_ZERO", "name": "Zero Rated 0.00%"}, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-24T14:53:32Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "USD", "currencyRate": 1, "totalAmount": 10}, "payment": {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "USD", "currencyRate": 0.771449236, "id": "bf6496aaf0294883b27c423ce8266113", "note": "Supplier refund using credit/debit card", "paidOnDate": "2019-11-19T00:00:00", "totalAmount": -10}}], "remainingCredit": 0, "sourceModifiedDate": "2019-11-19T14:17:32Z", "status": "Paid", "subTotal": 10, "supplierRef": {"id": "ec716559789111e8aaa5027d54329956", "supplierName": "Bagels Limited"}, "totalAmount": 10, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "APADJ0001", "createdFromRefs": [], "currency": "USD", "currencyRate": 0.7283, "discountPercentage": 0, "id": "3359", "issueDate": "2021-09-20T00:00:00", "lineItems": [{"accountRef": {"id": "197", "name": "Software and Licenses"}, "description": "No Description Provided", "quantity": 1, "subTotal": 5, "taxAmount": 1, "taxRateRef": {"effectiveTaxRate": 20, "id": "47", "name": "EC Purchase Goods Standard Rate Input"}, "totalAmount": 6, "tracking": {"categoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "unitAmount": 5}, {"accountRef": {"id": "197", "name": "Software and Licenses"}, "description": "No Description Provided", "quantity": 1, "subTotal": 5, "taxAmount": 1, "taxRateRef": {"effectiveTaxRate": 20, "id": "47", "name": "EC Purchase Goods Standard Rate Input"}, "totalAmount": 6, "tracking": {"categoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "unitAmount": 5}], "modifiedDate": "2022-10-28T11:10:22Z", "note": "", "paymentAllocations": [], "remainingCredit": 12, "sourceModifiedDate": "2021-09-20T13:50:16", "status": "Submitted", "subTotal": 10, "supplierRef": {"id": "3", "supplierName": "ADP"}, "totalAmount": 12, "totalDiscount": 0, "totalTaxAmount": 2, "withholdingTax": []} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "RPT429-1", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "ee8bec08-2be8-40ba-acd0-d53d5df11235", "issueDate": "2022-12-12T00:00:00", "lineItems": [{"accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce", "name": "General Expenses"}, "description": "Refund as agreed due to window break when guard absent", "discountAmount": 0, "discountPercentage": 0, "quantity": 1, "subTotal": 21.2, "taxAmount": 4.24, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 25.44, "trackingCategoryRefs": [], "unitAmount": 21.2}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-12-12T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 25.44}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "ee8bec08-2be8-40ba-acd0-d53d5df11235", "paidOnDate": "2022-12-12T00:00:00", "reference": "", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2011-04-07T07:26:30", "status": "Paid", "subTotal": 25.44, "supplierRef": {"id": "3a0d40a2-2698-4cf5-b7b2-30133c632ab6", "supplierName": "Swanston Security"}, "totalAmount": 25.44, "totalDiscount": 0, "totalTaxAmount": 4.24, "withholdingTax": []} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounting-bill-credit-notes: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "14763237", "createdFromRefs": [], "currency": "USD", "discountPercentage": 0, "id": "6a0e9dfb-87b0-47d3-aaaf-9753ae9e757d", "issueDate": "2019-02-18T16:03:07.268Z", "lineItems": [{"accountRef": {"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"}, "description": "AcmeMagnet", "discountAmount": 0, "itemRef": {"id": "3"}, "quantity": 4, "subTotal": 100, "taxAmount": 10, "taxRateRef": {"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"}, "totalAmount": 110, "trackingCategoryRefs": [{"id": "department_1", "name": "ACMERockets"}, {"id": "costcode_2", "name": "ACM2-ACMESigns"}], "unitAmount": 25}, {"accountRef": {"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"}, "description": "ACMEDisintegratingPistol", "discountAmount": 0, "itemRef": {"id": "3abf0883-03f7-44c6-bc15-1372522d25e1"}, "quantity": 3, "subTotal": 75, "taxAmount": 7.5, "taxRateRef": {"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"}, "totalAmount": 82.5, "unitAmount": 25}, {"accountRef": {"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"}, "description": "ACMEWhippedCreamDispenser", "discountAmount": 0, "itemRef": {"id": "3691f3d9-0ff7-4358-8a93-bed31c1b4b03"}, "quantity": 6, "subTotal": 312, "taxAmount": 31.2, "taxRateRef": {"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"}, "totalAmount": 343.2, "unitAmount": 52}, {"accountRef": {"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"}, "description": "ACMEJetPropelledPogoStick", "discountAmount": 0, "itemRef": {"id": "075410d4-7edc-4936-ba52-9e1e43cbe300"}, "quantity": 1, "subTotal": 130, "taxAmount": 27.3, "taxRateRef": {"id": "d606732b-db18-44d7-823b-7f15f42c32ea"}, "totalAmount": 157.3, "unitAmount": 130}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Track separately", "paymentAllocations": [], "remainingCredit": 693, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Submitted", "subTotal": 805.78, "supplierRef": {"id": "67C6A7A1-5E84-4AC4-B950-24A114E379D0", "supplierName": "Chin's Gas and Oil"}, "totalAmount": 693, "totalDiscount": 0, "totalTaxAmount": 0}], "totalResults": 1} + "400": {} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "109001", "createdFromRefs": [], "currency": "GBP", "discountPercentage": 0, "id": "0deaed0a-9f51-eb11-89f9-00224800af18", "issueDate": "2020-12-21T00:00:00", "lineItems": [{"accountRef": {"id": "6a1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Inventory"}, "description": "Abdi Item No VAT", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "ITEM-dbc37b18-4209-eb11-bbf6-0022481ad2e8-EXPORT-EXPORT", "name": "Abdi Item No VAT / General Business Posting Group: 'EXPORT' / VAT Business Posting Group: 'EXPORT'"}, "quantity": 1, "subTotal": 8, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "6bbc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for EXPORT / ZERO"}, "totalAmount": 8, "trackingCategoryRefs": [], "unitAmount": 8}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:26Z", "note": "BCN001", "paymentAllocations": [], "remainingCredit": 8, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Submitted", "subTotal": 8, "supplierRef": {"id": "be1217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "Fabrikam, Inc."}, "totalAmount": 8, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "109002", "createdFromRefs": [], "currency": "GBP", "discountPercentage": 0, "id": "157c025f-a19e-eb11-8ce6-0022481a7bed", "issueDate": "2021-01-26T00:00:00", "lineItems": [{"accountRef": {"id": "6a1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Inventory"}, "description": "Abdi Item No VAT", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "ITEM-dbc37b18-4209-eb11-bbf6-0022481ad2e8-EXPORT-EXPORT", "name": "Abdi Item No VAT / General Business Posting Group: 'EXPORT' / VAT Business Posting Group: 'EXPORT'"}, "quantity": 1, "subTotal": 20, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "6bbc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for EXPORT / ZERO"}, "totalAmount": 20, "trackingCategoryRefs": [], "unitAmount": 20}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:26Z", "note": "16042021", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2021-04-16T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 10}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "257c025f-a19e-eb11-8ce6-0022481a7bed", "note": "Credit Memo 1002", "paidOnDate": "2021-01-26T00:00:00", "reference": "109002", "totalAmount": 0}}], "remainingCredit": 10, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "PartiallyPaid", "subTotal": 20, "supplierRef": {"id": "be1217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "Fabrikam, Inc."}, "totalAmount": 20, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 224} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "19600007", "createdFromRefs": [], "currency": "EUR", "currencyRate": 1, "discountPercentage": 0, "id": "443bd109-e1ed-4de2-b1ab-3b13e980d288", "issueDate": "2019-12-16T00:00:00Z", "lineItems": [{"accountRef": {"id": "5f139759-b554-4314-862e-b9d88e5b2e1b", "name": "Af te dragen loonheffing"}, "description": "Cheesecake", "discountAmount": 0, "quantity": 1, "subTotal": 10, "taxAmount": 2.1, "taxRateRef": {"effectiveTaxRate": 21, "id": "84277189-ad16-456c-b501-ca31f0a483cc", "name": "BTW prive gebruik"}, "totalAmount": 12.1, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-26T13:32:18Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 12.1, "sourceModifiedDate": "2020-01-03T15:06:19Z", "status": "Submitted", "subTotal": 10, "supplierRef": {"id": "5e6f49b9-6489-4b82-83e7-291d308919bb", "supplierName": "Mickey Mouse"}, "totalAmount": 12.1, "totalDiscount": 0, "totalTaxAmount": 2.1, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "20600003", "createdFromRefs": [], "currency": "EUR", "currencyRate": 1, "discountPercentage": 0, "id": "6643f559-d7e9-4cfe-802f-60beddbc4ed9", "issueDate": "2020-01-20T00:00:00Z", "lineItems": [{"accountRef": {"id": "f6c251f5-21d0-4164-9b8f-17789fd2fee9", "name": "Kosten werkgeverslasten vakantiegeld"}, "description": "1 transactions of type CARD_PAYMENT_FEE_REFUND", "discountAmount": 0, "quantity": 1, "subTotal": 13.57, "totalAmount": 13.57, "trackingCategoryRefs": [], "unitAmount": 13.57}], "modifiedDate": "2022-10-26T13:32:18Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 13.57, "sourceModifiedDate": "2020-01-20T19:38:37Z", "status": "Submitted", "subTotal": 13.57, "supplierRef": {"id": "f87070e2-bbd7-4383-a7c9-824748c1d70e", "supplierName": "Exact Software Nederland B.V."}, "totalAmount": 13.57, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 42} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "19600008", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "f9083d38-40c7-4b5f-a693-f4670e3d85bc", "issueDate": "2019-10-30T00:00:00Z", "lineItems": [{"accountRef": {"id": "885ff551-664d-451b-995b-cb114c9877d0", "name": "Unallocated Cash"}, "description": "Oil Change", "discountAmount": 0, "itemRef": {"id": "3001"}, "quantity": 1000.5, "subTotal": -150075, "totalAmount": -150075, "trackingCategoryRefs": [], "unitAmount": -150}, {"accountRef": {"id": "885ff551-664d-451b-995b-cb114c9877d0", "name": "Unallocated Cash"}, "description": "description", "discountAmount": 0, "quantity": 1, "subTotal": 250074, "totalAmount": 250074, "trackingCategoryRefs": [], "unitAmount": 250074}], "modifiedDate": "2022-10-26T13:33:23Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 99999, "sourceModifiedDate": "2019-10-30T13:12:56Z", "status": "Submitted", "subTotal": 99999, "supplierRef": {"id": "1c703cce-967c-4476-a86a-32e35341a8f5", "supplierName": "Customer Bill Supplier"}, "totalAmount": 99999, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "19600009", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "05023688-5bd5-4034-ae4c-5e3e5099bbfb", "issueDate": "2019-11-01T00:00:00Z", "lineItems": [{"accountRef": {"id": "62be6536-f4ea-49b8-9797-1adc23982334", "name": "Depreciation"}, "description": "Credit note line item #5", "discountAmount": 0, "quantity": 1, "subTotal": 10, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-26T13:33:23Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 10, "sourceModifiedDate": "2019-11-01T15:07:18Z", "status": "Submitted", "subTotal": 10, "supplierRef": {"id": "1c703cce-967c-4476-a86a-32e35341a8f5", "supplierName": "Customer Bill Supplier"}, "totalAmount": 10, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 40} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "Bill Credit", "createdFromRefs": [], "currency": "GBP", "discountPercentage": 0, "id": "10665024", "issueDate": "2018-08-22T00:00:00", "lineItems": [{"accountRef": {"id": "285", "name": "Accommodation and Meals"}, "description": "A & J Fabtech Ltd - Bill Credit Note Bill Credit", "quantity": 1, "taxAmount": 250, "totalAmount": 1500, "trackingCategoryRefs": [], "unitAmount": 1250}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:10Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 1500, "sourceModifiedDate": "2018-08-22T13:22:08Z", "status": "Submitted", "subTotal": 1250, "supplierRef": {"id": "6161941", "supplierName": "A & J Fabtech Ltd"}, "totalAmount": 1500, "totalDiscount": 0, "totalTaxAmount": 250, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "Draft test", "createdFromRefs": [], "currency": "GBP", "discountPercentage": 0, "id": "11007024", "issueDate": "2018-10-17T00:00:00", "lineItems": [{"accountRef": {"id": "285", "name": "Accommodation and Meals"}, "description": "ABB Ltd - Bill Credit Note Draft test", "quantity": 1, "taxAmount": 1.67, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 8.33}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:10Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 10, "sourceModifiedDate": "2018-10-17T12:56:54Z", "status": "Submitted", "subTotal": 8.33, "supplierRef": {"id": "6161963", "supplierName": "ABB Ltd"}, "totalAmount": 10, "totalDiscount": 0, "totalTaxAmount": 1.67, "withholdingTax": []}], "totalResults": 45} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "5", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "91339087", "issueDate": "2020-02-25T00:00:00", "lineItems": [{"accountRef": {"id": "21481832", "name": "Oil"}, "description": "Oil refund", "itemRef": {"id": "114817740"}, "quantity": 1, "subTotal": 10, "taxAmount": 0, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-09-30T10:29:16Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 0, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 0, "supplierRef": {"id": "6202387", "supplierName": "Dell"}, "totalAmount": 10, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "6", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "91341939", "issueDate": "2020-02-25T00:00:00", "lineItems": [{"accountRef": {"id": "21481820", "name": "Materials purchased"}, "description": "", "itemRef": {"id": "114821376"}, "quantity": -1, "subTotal": 200, "taxAmount": -40, "totalAmount": 240, "trackingCategoryRefs": [], "unitAmount": -200}], "modifiedDate": "2022-09-30T10:29:16Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 0, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 0, "supplierRef": {"id": "6202387", "supplierName": "Dell"}, "totalAmount": 240, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 8} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "VENDCRED1", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "1781", "issueDate": "2021-11-02T00:00:00", "lineItems": [{"accountRef": {"id": "713", "name": "Inventory Asset"}, "description": "billcredit_test", "quantity": 1, "subTotal": 145.5, "totalAmount": 145.5, "tracking": {"categoryRefs": [{"id": "department-1"}, {"id": "location-1"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department-1"}, {"id": "location-1"}], "unitAmount": 145.5, "unitOfMeasurement": "pack"}], "modifiedDate": "2022-09-20T08:16:22Z", "note": "Codat1", "paymentAllocations": [], "remainingCredit": 174.6, "sourceModifiedDate": "2021-11-02T19:58:58", "status": "Submitted", "subTotal": 145.5, "supplierRef": {"id": "749", "supplierName": "Jo's Cheese"}, "totalAmount": 174.6, "totalDiscount": 0, "totalTaxAmount": 29.1, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "VENDCRED2", "createdFromRefs": [{"dataType": "bills", "id": "7462"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "1782", "issueDate": "2021-11-02T00:00:00", "lineItems": [{"accountRef": {"id": "714", "name": "Cost of Goods Sold"}, "createdFromLineRef": {"dataType": "bills", "id": "7462", "lineNumber": "1"}, "description": "Cheese", "quantity": 1, "subTotal": 400, "totalAmount": 400, "tracking": {"categoryRefs": [{"id": "location-1"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "location-1"}], "unitAmount": 400, "unitOfMeasurement": "pack"}, {"accountRef": {"id": "714", "name": "Cost of Goods Sold"}, "description": "double cream", "quantity": 1, "subTotal": 100, "totalAmount": 100, "tracking": {"categoryRefs": [{"id": "location-1"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "location-1"}], "unitAmount": 100}, {"accountRef": {"id": "54", "name": "Sales"}, "description": "", "itemRef": {"id": "128", "name": "Test Item"}, "quantity": 1, "subTotal": 35.25, "totalAmount": 35.25, "tracking": {"categoryRefs": [{"id": "location-1"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "location-1"}], "unitAmount": 35.25}], "modifiedDate": "2022-09-20T08:16:22Z", "note": "Codat1", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 300}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "1782", "note": "Codat1", "paidOnDate": "2021-11-02T00:00:00", "reference": "Bill Credit 02/11/2021", "totalAmount": 0}}], "remainingCredit": 342.3, "sourceModifiedDate": "2021-11-03T18:27:14", "status": "PartiallyPaid", "subTotal": 535.25, "supplierRef": {"id": "749", "supplierName": "Jo's Cheese"}, "totalAmount": 642.3, "totalDiscount": 0, "totalTaxAmount": 107.05, "withholdingTax": []}], "totalResults": 16} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "Return", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "6D2C-1197698059", "issueDate": "2024-10-30T00:00:00", "lineItems": [{"description": "Lumber:Rough - Rough lumber", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "1C0000-933272656", "name": "Lumber:Rough"}, "quantity": 0, "subTotal": 475, "taxAmount": 0, "totalAmount": 475, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 475}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:30Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 475}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "6D2C-1197698059", "paidOnDate": "2024-10-30T00:00:00", "reference": "Return", "totalAmount": 0}}], "remainingCredit": 475, "sourceModifiedDate": "2023-12-16T05:06:19", "status": "Submitted", "subTotal": 475, "supplierRef": {"id": "E0000-933272656", "supplierName": "Timberloft Lumber"}, "totalAmount": 475, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "CR-1098", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "F3A-933787869", "issueDate": "2024-12-12T00:00:00", "lineItems": [{"description": "Subs:Roofing - Roofing", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "D0000-933272656", "name": "Subs:Roofing"}, "quantity": 0, "subTotal": 850, "taxAmount": 0, "totalAmount": 850, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 850}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:30Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 850}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "F3A-933787869", "paidOnDate": "2024-12-12T00:00:00", "reference": "CR-1098", "totalAmount": 0}}], "remainingCredit": 850, "sourceModifiedDate": "2023-12-16T05:05:03", "status": "Submitted", "subTotal": 850, "supplierRef": {"id": "80000-933272656", "supplierName": "Sloan Roofing"}, "totalAmount": 850, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 3} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "19", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "19", "issueDate": "2019-05-13T00:00:00", "lineItems": [{"accountRef": {"id": "16", "name": "Advertising"}, "description": "", "quantity": 1, "subTotal": 5, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 5, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 5}], "modifiedDate": "2023-01-18T11:02:37Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "20", "paidOnDate": "2019-05-13T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2019-05-13T13:14:06Z", "status": "Paid", "subTotal": 5, "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "totalAmount": 5, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "677", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "677", "issueDate": "2020-03-20T00:00:00", "lineItems": [{"accountRef": {"id": "16", "name": "Advertising"}, "description": "", "quantity": 1, "subTotal": 5, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 5, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 5}], "modifiedDate": "2023-01-18T11:02:37Z", "note": "Codat Note field", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "678", "note": "payment note test", "paidOnDate": "2020-03-23T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2020-03-23T10:44:06Z", "status": "Paid", "subTotal": 5, "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "totalAmount": 5, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 11} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "424", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "424", "issueDate": "2019-06-20T00:00:00", "lineItems": [{"accountRef": {"id": "30", "name": "Janitorial Expense"}, "description": "Refund of iZettle Fees", "quantity": 1, "subTotal": 69, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "20_Bills", "name": "5.0% RC CIS Bills"}, "totalAmount": 69, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 69}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:58Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 69, "sourceModifiedDate": "2019-06-20T15:48:50Z", "status": "Submitted", "subTotal": 69, "supplierRef": {"id": "24", "supplierName": "Brijesh Jain"}, "totalAmount": 69, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "455", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "455", "issueDate": "2019-06-26T00:00:00", "lineItems": [{"accountRef": {"id": "11", "name": "Ask My Accountant"}, "description": "a", "quantity": 1, "subTotal": 10, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "20_Bills", "name": "5.0% RC CIS Bills"}, "totalAmount": 10, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 10}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:58Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 10}, "payment": {"accountRef": {"id": "100", "name": "Savings2"}, "currency": "GBP", "currencyRate": 1, "id": "530", "paidOnDate": "2019-07-16T00:00:00", "reference": "4", "totalAmount": 170}}], "remainingCredit": 0, "sourceModifiedDate": "2019-07-16T09:49:14Z", "status": "Paid", "subTotal": 10, "supplierRef": {"id": "53", "supplierName": "Bank of AnyCity"}, "totalAmount": 10, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 26} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2020-01-20T00:00:00Z", "billCreditNoteNumber": "Return 1", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 2.5, "id": "45391", "issueDate": "2020-07-22T00:00:00Z", "lineItems": [{"description": "Tax Summary - Tax Rate 1", "discountAmount": 0.5, "quantity": 0, "subTotal": 0, "taxAmount": 20, "taxRateRef": {"effectiveTaxRate": 20, "id": "1729", "name": "Standard rate"}, "totalAmount": 20, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 2.5, "quantity": 0, "subTotal": 100, "taxAmount": 0, "totalAmount": 100, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:35:52Z", "note": "ret1", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10.5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "45391", "note": "ret1", "paidOnDate": "2020-01-20T00:00:00", "reference": "Return 1", "totalAmount": 0}}], "remainingCredit": 109.5, "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Submitted", "subTotal": 100, "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "totalAmount": 120, "totalDiscount": 2.5, "totalTaxAmount": 20, "withholdingTax": []}, {"allocatedOnDate": "2020-02-03T00:00:00Z", "billCreditNoteNumber": "Return 2", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 2.5, "id": "45421", "issueDate": "2020-07-22T00:00:00Z", "lineItems": [{"description": "Tax Summary - Tax Rate 1", "discountAmount": 0.25, "quantity": 0, "subTotal": 0, "taxAmount": 10, "taxRateRef": {"effectiveTaxRate": 20, "id": "1729", "name": "Standard rate"}, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 1.25, "quantity": 0, "subTotal": 50, "taxAmount": 0, "totalAmount": 50, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:35:52Z", "note": "ret2", "paymentAllocations": [], "remainingCredit": 60, "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Submitted", "subTotal": 50, "supplierRef": {"id": "QUA001", "supplierName": "Quality Motors"}, "totalAmount": 60, "totalDiscount": 1.25, "totalTaxAmount": 10, "withholdingTax": []}], "totalResults": 21} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "O/BAL", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "20", "issueDate": "2021-12-31T00:00:00", "lineItems": [{"accountRef": {"id": "9998", "name": "Suspense Account"}, "description": "Opening Balance", "quantity": 1, "subTotal": 0.01, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "9", "name": "Non-Vatable Tax Code"}, "totalAmount": 0.01, "tracking": {"categoryRefs": [{"id": "department_0", "name": "Default"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department_0", "name": "Default"}], "unitAmount": 0.01}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "note": "Opening Balance", "paymentAllocations": [], "remainingCredit": 0.01, "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Submitted", "subTotal": 0.01, "supplierRef": {"id": "NEW001", "supplierName": "Newtown Builders Ltd"}, "totalAmount": 0.01, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "Return", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "323", "issueDate": "2022-02-28T00:00:00", "lineItems": [{"accountRef": {"id": "5000", "name": "Materials Purchased"}, "description": "Returned Goods, damaged", "quantity": 1, "subTotal": 88, "taxAmount": 15.4, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 103.4, "tracking": {"categoryRefs": [{"id": "department_0", "name": "Default"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department_0", "name": "Default"}], "unitAmount": 103.4}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "note": "Returned Goods, damaged", "paymentAllocations": [], "remainingCredit": 103.4, "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Submitted", "subTotal": 88, "supplierRef": {"id": "UNI001", "supplierName": "Unique Systems"}, "totalAmount": 103.4, "totalDiscount": 0, "totalTaxAmount": 15.4, "withholdingTax": []}], "totalResults": 12} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "Supplier credit note", "createdFromRefs": [], "currency": "USD", "currencyRate": 0.776970973, "discountPercentage": 0, "id": "b6c6fce9866849b0b44cac99ab7dc579", "issueDate": "2018-11-23T00:00:00", "lineItems": [{"accountRef": {"id": "9a995955267a11e797950a57719b2edb", "name": "Cost of sales - goods"}, "description": "Consulting services", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "a87b922b33de11e797950a57719b2edb", "name": "Consulting services"}, "quantity": 1, "subTotal": 10, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "GB_ZERO", "name": "Zero Rated 0.00%"}, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-24T14:53:32Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "USD", "currencyRate": 1, "totalAmount": 10}, "payment": {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "USD", "currencyRate": 0.771449236, "id": "bf6496aaf0294883b27c423ce8266113", "note": "Supplier refund using credit/debit card", "paidOnDate": "2019-11-19T00:00:00", "totalAmount": -10}}], "remainingCredit": 0, "sourceModifiedDate": "2019-11-19T14:17:32Z", "status": "Paid", "subTotal": 10, "supplierRef": {"id": "ec716559789111e8aaa5027d54329956", "supplierName": "Bagels Limited"}, "totalAmount": 10, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "91fe2a83-e161-4c21-929d-c5c10c4b07e5", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "23d866f6367d4f11956a36a71e47bc37", "issueDate": "2019-01-29T00:00:00", "lineItems": [{"accountRef": {"id": "9a995955267a11e797950a57719b2edb", "name": "Cost of sales - goods"}, "description": "Consulting services", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "a87b922b33de11e797950a57719b2edb", "name": "Consulting services"}, "quantity": 5, "subTotal": 50, "taxAmount": 10, "taxRateRef": {"effectiveTaxRate": 20, "id": "GB_STANDARD", "name": "Standard 20.00%"}, "totalAmount": 60, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-24T14:53:32Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 60, "sourceModifiedDate": "2020-07-16T15:00:36Z", "status": "Submitted", "subTotal": 50, "supplierRef": {"id": "ca430e0d156011e8b45c025132dab352", "supplierName": "Test Supplier"}, "totalAmount": 60, "totalDiscount": 0, "totalTaxAmount": 10, "withholdingTax": []}], "totalResults": 747} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/71ca2b28-8e86-41e7-8c55-f681042b11a0/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/71ca2b28-8e86-41e7-8c55-f681042b11a0/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/71ca2b28-8e86-41e7-8c55-f681042b11a0/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "APADJ0001", "createdFromRefs": [], "currency": "USD", "currencyRate": 0.7283, "discountPercentage": 0, "id": "3359", "issueDate": "2021-09-20T00:00:00", "lineItems": [{"accountRef": {"id": "197", "name": "Software and Licenses"}, "description": "No Description Provided", "quantity": 1, "subTotal": 5, "taxAmount": 1, "taxRateRef": {"effectiveTaxRate": 20, "id": "47", "name": "EC Purchase Goods Standard Rate Input"}, "totalAmount": 6, "tracking": {"categoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "unitAmount": 5}, {"accountRef": {"id": "197", "name": "Software and Licenses"}, "description": "No Description Provided", "quantity": 1, "subTotal": 5, "taxAmount": 1, "taxRateRef": {"effectiveTaxRate": 20, "id": "47", "name": "EC Purchase Goods Standard Rate Input"}, "totalAmount": 6, "tracking": {"categoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "unitAmount": 5}], "modifiedDate": "2022-10-28T11:10:22Z", "note": "", "paymentAllocations": [], "remainingCredit": 12, "sourceModifiedDate": "2021-09-20T13:50:16", "status": "Submitted", "subTotal": 10, "supplierRef": {"id": "3", "supplierName": "ADP"}, "totalAmount": 12, "totalDiscount": 0, "totalTaxAmount": 2, "withholdingTax": []}, {"allocatedOnDate": "2021-09-29T00:00:00", "billCreditNoteNumber": "APADJ0002", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "3399", "issueDate": "2021-09-24T00:00:00", "lineItems": [{"accountRef": {"id": "197", "name": "Software and Licenses"}, "description": "No Description Provided", "quantity": 1, "subTotal": 300, "taxAmount": 60, "taxRateRef": {"effectiveTaxRate": 20, "id": "81", "name": "UK Purchase Goods Standard Rate"}, "totalAmount": 360, "tracking": {"categoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "unitAmount": 300}], "modifiedDate": "2022-10-28T11:10:22Z", "note": "", "paymentAllocations": [], "remainingCredit": 0, "sourceModifiedDate": "2021-09-29T13:34:47", "status": "Paid", "subTotal": 300, "supplierRef": {"id": "3", "supplierName": "ADP"}, "totalAmount": 360, "totalDiscount": 0, "totalTaxAmount": 60, "withholdingTax": []}], "totalResults": 82} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/billCreditNotes?page=1&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "RPT429-1", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "ee8bec08-2be8-40ba-acd0-d53d5df11235", "issueDate": "2022-12-12T00:00:00", "lineItems": [{"accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce", "name": "General Expenses"}, "description": "Refund as agreed due to window break when guard absent", "discountAmount": 0, "discountPercentage": 0, "quantity": 1, "subTotal": 21.2, "taxAmount": 4.24, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 25.44, "trackingCategoryRefs": [], "unitAmount": 21.2}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-12-12T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 25.44}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "ee8bec08-2be8-40ba-acd0-d53d5df11235", "paidOnDate": "2022-12-12T00:00:00", "reference": "", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2011-04-07T07:26:30", "status": "Paid", "subTotal": 25.44, "supplierRef": {"id": "3a0d40a2-2698-4cf5-b7b2-30133c632ab6", "supplierName": "Swanston Security"}, "totalAmount": 25.44, "totalDiscount": 0, "totalTaxAmount": 4.24, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "720-2", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "7d1f4e11-e909-43b0-901c-2c824dff1e82", "issueDate": "2022-12-16T00:00:00", "lineItems": [{"accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce", "name": "General Expenses"}, "description": "Unable to supply DVD writer for laptop", "discountAmount": 0, "discountPercentage": 0, "quantity": 1, "subTotal": 225.3, "taxAmount": 45.06, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 270.36, "trackingCategoryRefs": [], "unitAmount": 225.3}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-12-16T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 270.36}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "7d1f4e11-e909-43b0-901c-2c824dff1e82", "paidOnDate": "2022-12-16T00:00:00", "reference": "", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2011-04-06T21:00:33", "status": "Paid", "subTotal": 270.36, "supplierRef": {"id": "cf8fa320-a527-496c-823e-22dd069d29e6", "supplierName": "PC Complete"}, "totalAmount": 270.36, "totalDiscount": 0, "totalTaxAmount": 45.06, "withholdingTax": []}], "totalResults": 2} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-accounting-bill-payment: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "date": "2022-05-06T00:00:00", "id": "dcb18480-8b69-44d8-aa26-268b6a80d170", "lines": [{"allocatedOnDate": "2022-05-06T00:00:00", "amount": 71351.42, "links": [{"amount": -71351.42, "currencyRate": 1, "id": "81539597-e681-40c9-a4dd-ec2fffcde572", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "note": "Bill Payment against bill 81539597-e681-40c9-a4dd-ec2fffcde572", "paymentMethodRef": {"id": "cb4a5647-aa86-40ab-bb4f-158acaa99c12", "name": "Check payments-u4p"}, "sourceModifiedDate": "2022-05-06T00:00:00", "supplierRef": {"id": "8GeHBdBZiZ", "supplierName": "DuBuque, Goyette and Franecki"}, "totalAmount": 71351.42} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "621217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Petty Cash"}, "currency": "GBP", "currencyRate": 1, "date": "2019-01-01T00:00:00", "id": "19387f05-8ad1-ea11-bbaa-000d3a2b9185", "lines": [{"allocatedOnDate": "2019-01-01T00:00:00", "amount": 234, "links": [{"amount": -234, "currencyRate": 1, "id": "c8cb06bf-89d1-ea11-bbaa-000d3a2b9185-108006", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "Invoice 107006", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "108006", "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "c41217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "Wide World Importers"}, "totalAmount": 234} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "d79d65bd-1d7d-4f55-95d3-76b3a7b7b823", "name": "Bank 1"}, "currency": "EUR", "currencyRate": 1, "date": "2019-11-05T00:00:00Z", "id": "da7e456f-76f7-42ac-8dad-d90a040f3afb", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": -5, "links": [{"amount": 5, "currencyRate": 1, "id": "63fadca8-4905-475a-b32a-b4341293bcf4", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-26T13:35:13Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "19200008", "sourceModifiedDate": "2019-11-05T14:26:22Z", "supplierRef": {"id": "63fadca8-4905-475a-b32a-b4341293bcf4", "supplierName": "Kelly's Industrial Supplies"}, "totalAmount": -5} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "4a4e34b5-7f62-4b64-a44a-073398b14b41", "name": "Bank"}, "currency": "GBP", "currencyRate": 1, "date": "2017-10-11T00:00:00Z", "id": "7a5f621b-739f-4ed8-b738-2aae3ef886ac", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 123, "links": [{"amount": -123, "currencyRate": 1, "id": "e7a45898-2db3-424c-acb9-a51647740f26", "type": "Bill"}]}], "modifiedDate": "2022-10-26T13:33:17Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "17200006", "sourceModifiedDate": "2017-10-11T10:12:29Z", "supplierRef": {"id": "a7cad20d-44db-442b-ac1f-90475802d6fb", "supplierName": "Pencils Pencils Pencils"}, "totalAmount": 123} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"currency": "GBP", "date": "2017-11-23T00:00:00", "id": "135234103", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 14.3, "links": [{"amount": -14.3, "currencyRate": 1, "id": "10659723", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:21:36Z", "note": "ATOMIC SOFTWARE LIMITE WELLINGTON,NZL OTHER �14.30 - Bill payment against Pints1 (The Eagle)", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "7169654", "supplierName": "The Eagle"}, "totalAmount": 14.3} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "167679", "name": "Cash"}, "currency": "GBP", "date": "2021-08-18T00:00:00", "id": "16", "lines": [{"allocatedOnDate": "2021-08-18T00:00:00", "amount": 10, "links": [{"amount": -10, "currencyRate": 1, "id": "16", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "note": "Bill payment", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "29"}, "totalAmount": 10} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "825", "name": "Codat Europe Bank"}, "currency": "GBP", "currencyRate": 1, "date": "2021-03-26T00:00:00", "id": "112", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 120, "links": [{"amount": -120, "currencyRate": 1, "id": "7", "type": "Bill"}]}], "modifiedDate": "2023-01-30T14:48:40Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "Bill Payment #1", "sourceModifiedDate": "2021-03-26T10:31:06", "supplierRef": {"id": "724", "supplierName": "Vendor A.A.A"}, "totalAmount": 120} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "date": "2023-01-11T00:00:00", "id": "3A09-1071529982", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 532.97, "links": [{"amount": -532.97, "currencyRate": 1, "id": "38AA-1071513625", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:09:20Z", "note": "Monthly Truck Payment", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "101", "sourceModifiedDate": "2023-12-16T05:04:58", "supplierRef": {"id": "720000-1071512482", "supplierName": "Bayshore Auto Mall"}, "totalAmount": 532.97} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "date": "2019-05-13T00:00:00", "id": "20", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -5, "currencyRate": 1, "id": "18", "type": "Bill"}, {"amount": 5, "currencyRate": 1, "id": "19", "type": "CreditNote"}]}], "modifiedDate": "2023-01-18T11:02:47Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2019-05-13T13:14:26Z", "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "totalAmount": 0} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "81", "name": "Current"}, "currency": "HKD", "currencyRate": 0.078807, "date": "2016-01-23T00:00:00", "id": "158", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 7940.6, "links": [{"amount": -7940.6, "currencyRate": 1, "id": "157", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:42Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "1067", "sourceModifiedDate": "2016-09-13T21:19:36Z", "supplierRef": {"id": "57", "supplierName": "Hall's Promo Items"}, "totalAmount": 7940.6} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "date": "2020-01-05T00:00:00Z", "id": "45462", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 27, "links": [{"amount": -27, "currencyRate": 1, "id": "CON001", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-14T09:35:54Z", "note": "", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "Payment invoice 1", "sourceModifiedDate": "2020-02-28T14:23:46Z", "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "totalAmount": 27} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "date": "2022-01-29T00:00:00", "id": "255", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 117.5, "links": [{"amount": -117.5, "currencyRate": 1, "id": "86", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 64.63, "links": [{"amount": -64.63, "currencyRate": 1, "id": "87", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 50.57, "links": [{"amount": -50.57, "currencyRate": 1, "id": "250", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 36.87, "links": [{"amount": -36.87, "currencyRate": 1, "id": "251", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 101.14, "links": [{"amount": -101.14, "currencyRate": 1, "id": "252", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "note": "Purchase payment 255 linked to, purchase invoice 86, purchase invoice 87, purchase invoice 250, purchase invoice 251, purchase invoice 252.", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-11-25T09:43:54", "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "totalAmount": 370.71} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "date": "2018-02-15T00:00:00", "id": "d953b45e156011e8b45c025132dab352", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 52.02, "links": [{"amount": -52.02, "currencyRate": 1, "id": "ca430e0d156011e8b45c025132dab352", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-24T14:54:04Z", "note": "Supplier payment using credit/debit card - Cool stuff", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2019-11-20T09:30:03Z", "supplierRef": {"id": "ca430e0d156011e8b45c025132dab352", "supplierName": "Test Supplier"}, "totalAmount": 52.02} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "date": "2022-01-06T00:00:00", "id": "4471", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 20, "links": [{"amount": -20, "currencyRate": 1, "id": "4470", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:13Z", "note": "", "paymentMethodRef": {"id": "6", "name": "Cash"}, "sourceModifiedDate": "2022-02-23T12:03:30", "supplierRef": {"id": "3", "supplierName": "ADP"}, "totalAmount": 20} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "date": "2021-12-20T00:00:00", "id": "74004690-82a1-4810-aaca-6ce575af94b4", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 7267.2, "links": [{"amount": -7267.2, "currencyRate": 1, "id": "3945273c-cc04-479f-a4b5-1e3dc7a55ed1", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:37:10Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2021-01-02T22:51:40", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "totalAmount": 7267.2} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounting-bill-payments: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"currency": "EUR", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "x", "type": "Bill"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 1000}, {"currency": "GBP", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -1000, "id": "x", "type": "Bill"}, {"amount": 1000, "id": "y", "type": "CreditNote"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 0}, {"currency": "GBP", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "x", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "y", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 2000}, {"currency": "GBP", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": -1000, "links": [{"amount": 1000, "id": "y", "type": "CreditNote"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": -1000}, {"currency": "USD", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": -1000, "links": [{"amount": 1000, "id": "y", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": -1000}, {"currency": "USD", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -750, "id": "x", "type": "Bill"}, {"amount": 750, "id": "y", "type": "CreditNote"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 250, "links": [{"amount": -250, "id": "x", "type": "Bill"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 250}, {"currency": "GBP", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "x", "type": "Bill"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 1000}, {"currency": "GBP", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -1000, "id": "x", "type": "Bill"}, {"amount": 1000, "id": "y", "type": "CreditNote"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -1000, "id": "x", "type": "Bill"}, {"amount": 1000, "id": "z", "type": "CreditNote"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "x", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "customer-001", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 2000}, {"currency": "GBP", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -1000, "id": "w", "type": "Bill"}, {"amount": -1000, "id": "x", "type": "Bill"}, {"amount": 1000, "id": "y", "type": "CreditNote"}, {"amount": 1000, "id": "z", "type": "CreditNote"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 0}, {"currency": "GBP", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "x", "type": "Bill"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 1000}, {"currency": "EUR", "date": "1901-01-01", "id": "001", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "x", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 4000, "links": [{"amount": -4000, "id": "y", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 5000}, {"currency": "EUR", "date": "1901-01-01", "id": "001", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "x", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "y", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 3000, "links": [{"amount": -3000, "id": "y", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 5000}, {"currency": "GBP", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 500, "links": [{"amount": -1000, "id": "a", "type": "Bill"}, {"amount": -1000, "id": "b", "type": "Bill"}, {"amount": 750, "id": "y", "type": "CreditNote"}, {"amount": 750, "id": "z", "type": "CreditNote"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 500}], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "date": "2022-05-06T00:00:00", "id": "dcb18480-8b69-44d8-aa26-268b6a80d170", "lines": [{"allocatedOnDate": "2022-05-06T00:00:00", "amount": 71351.42, "links": [{"amount": -71351.42, "currencyRate": 1, "id": "81539597-e681-40c9-a4dd-ec2fffcde572", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "note": "Bill Payment against bill 81539597-e681-40c9-a4dd-ec2fffcde572", "paymentMethodRef": {"id": "cb4a5647-aa86-40ab-bb4f-158acaa99c12", "name": "Check payments-u4p"}, "sourceModifiedDate": "2022-05-06T00:00:00", "supplierRef": {"id": "8GeHBdBZiZ", "supplierName": "DuBuque, Goyette and Franecki"}, "totalAmount": 71351.42}, {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "date": "2022-05-14T13:12:00", "id": "ca0976d0-036d-4187-ab66-7169286b007d", "lines": [{"allocatedOnDate": "2022-05-14T13:12:00", "amount": 16221.64, "links": [{"amount": -16221.64, "currencyRate": 1, "id": "3f44d2be-d4c2-4cc3-8216-8add5265eb13", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "note": "Bill Payment against bill 3f44d2be-d4c2-4cc3-8216-8add5265eb13", "paymentMethodRef": {"id": "fc87fba8-812e-4a54-b633-29ef2abf4c12", "name": "CreditCard payments-u4p"}, "sourceModifiedDate": "2022-05-14T13:12:00", "supplierRef": {"id": "9efd64dc-4b31-425d-9eb2-7c7773593713", "supplierName": "Jacobson, Konopelski and Heidenreich"}, "totalAmount": 16221.64}], "totalResults": 232} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "621217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Petty Cash"}, "currency": "GBP", "currencyRate": 1, "date": "2019-01-01T00:00:00", "id": "19387f05-8ad1-ea11-bbaa-000d3a2b9185", "lines": [{"allocatedOnDate": "2019-01-01T00:00:00", "amount": 234, "links": [{"amount": -234, "currencyRate": 1, "id": "c8cb06bf-89d1-ea11-bbaa-000d3a2b9185-108006", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "Invoice 107006", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "108006", "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "c41217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "Wide World Importers"}, "totalAmount": 234}, {"accountRef": {"id": "621217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Petty Cash"}, "currency": "GBP", "currencyRate": 1, "date": "2019-01-01T00:00:00", "id": "3d387f05-8ad1-ea11-bbaa-000d3a2b9185", "lines": [{"allocatedOnDate": "2019-01-01T00:00:00", "amount": 390, "links": [{"amount": -390, "currencyRate": 1, "id": "cbcb06bf-89d1-ea11-bbaa-000d3a2b9185-108007", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "Invoice 107007", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "108007", "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "be1217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "Fabrikam, Inc."}, "totalAmount": 390}], "totalResults": 236} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "d79d65bd-1d7d-4f55-95d3-76b3a7b7b823", "name": "Bank 1"}, "currency": "EUR", "currencyRate": 1, "date": "2019-11-05T00:00:00Z", "id": "da7e456f-76f7-42ac-8dad-d90a040f3afb", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": -5, "links": [{"amount": 5, "currencyRate": 1, "id": "63fadca8-4905-475a-b32a-b4341293bcf4", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-26T13:35:13Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "19200008", "sourceModifiedDate": "2019-11-05T14:26:22Z", "supplierRef": {"id": "63fadca8-4905-475a-b32a-b4341293bcf4", "supplierName": "Kelly's Industrial Supplies"}, "totalAmount": -5}, {"accountRef": {"id": "1879b322-7758-4e20-8f3f-701df27f2340", "name": "Kas"}, "currency": "EUR", "currencyRate": 1, "date": "2019-11-07T00:00:00Z", "id": "002b8462-f3a3-4019-84fe-6a2af1f30c5a", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": -0.12, "links": [{"amount": 0.12, "currencyRate": 1, "id": "33f3016c-2ecf-4d17-911e-b385537e7341", "type": "CreditNote"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0.12, "links": [{"amount": -0.12, "currencyRate": 1, "id": "de6b3634-faf2-4688-b06b-72ed3ca6cf4e", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0.13, "links": [{"amount": -0.13, "currencyRate": 1, "id": "de6b3634-faf2-4688-b06b-72ed3ca6cf4e", "type": "Bill"}]}], "modifiedDate": "2022-10-26T13:35:14Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "19100002", "sourceModifiedDate": "2021-11-17T12:08:10Z", "supplierRef": {"id": "5811b467-53eb-4491-8ca1-bc9b7889811b", "supplierName": "Ann's test supplier 2"}, "totalAmount": 0.13}], "totalResults": 1173} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "4a4e34b5-7f62-4b64-a44a-073398b14b41", "name": "Bank"}, "currency": "GBP", "currencyRate": 1, "date": "2017-10-11T00:00:00Z", "id": "7a5f621b-739f-4ed8-b738-2aae3ef886ac", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 123, "links": [{"amount": -123, "currencyRate": 1, "id": "e7a45898-2db3-424c-acb9-a51647740f26", "type": "Bill"}]}], "modifiedDate": "2022-10-26T13:33:17Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "17200006", "sourceModifiedDate": "2017-10-11T10:12:29Z", "supplierRef": {"id": "a7cad20d-44db-442b-ac1f-90475802d6fb", "supplierName": "Pencils Pencils Pencils"}, "totalAmount": 123}, {"accountRef": {"id": "4a4e34b5-7f62-4b64-a44a-073398b14b41", "name": "Bank"}, "currency": "GBP", "currencyRate": 1, "date": "2017-10-31T00:00:00Z", "id": "b358df76-3930-42ad-8f38-78edcc60172d", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 55000, "links": [{"amount": -55000, "currencyRate": 1, "id": "41302634-76b5-4442-b800-0bb63780e77c", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-26T13:33:17Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "17200001", "sourceModifiedDate": "2019-02-14T17:56:54Z", "supplierRef": {"id": "41302634-76b5-4442-b800-0bb63780e77c", "supplierName": "Some Supplier"}, "totalAmount": 55000}], "totalResults": 39} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "date": "2017-11-23T00:00:00", "id": "135234103", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 14.3, "links": [{"amount": -14.3, "currencyRate": 1, "id": "10659723", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:21:36Z", "note": "ATOMIC SOFTWARE LIMITE WELLINGTON,NZL OTHER �14.30 - Bill payment against Pints1 (The Eagle)", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "7169654", "supplierName": "The Eagle"}, "totalAmount": 14.3}, {"currency": "GBP", "date": "2019-01-03T00:00:00", "id": "168350314", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 30, "links": [{"amount": -30, "currencyRate": 1, "id": "11224800", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:21:36Z", "note": "�30.00 - Bill payment against Test123 (A & J Fabtech Ltd)", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "6161941", "supplierName": "A & J Fabtech Ltd"}, "totalAmount": 30}], "totalResults": 89} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "167679", "name": "Cash"}, "currency": "GBP", "date": "2021-08-18T00:00:00", "id": "16", "lines": [{"allocatedOnDate": "2021-08-18T00:00:00", "amount": 10, "links": [{"amount": -10, "currencyRate": 1, "id": "16", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "note": "Bill payment", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "29"}, "totalAmount": 10}, {"accountRef": {"id": "167679", "name": "Cash"}, "currency": "USD", "date": "2021-08-18T00:00:00", "id": "18", "lines": [{"allocatedOnDate": "2021-08-18T00:00:00", "amount": 15, "links": [{"amount": -15, "currencyRate": 1, "id": "18", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "note": "Bill payment Ikea", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "39"}, "totalAmount": 15}], "totalResults": 26} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "825", "name": "Codat Europe Bank"}, "currency": "GBP", "currencyRate": 1, "date": "2021-03-26T00:00:00", "id": "112", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 120, "links": [{"amount": -120, "currencyRate": 1, "id": "7", "type": "Bill"}]}], "modifiedDate": "2023-01-30T14:48:40Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "Bill Payment #1", "sourceModifiedDate": "2021-03-26T10:31:06", "supplierRef": {"id": "724", "supplierName": "Vendor A.A.A"}, "totalAmount": 120}, {"accountRef": {"id": "825", "name": "Codat Europe Bank"}, "currency": "GBP", "currencyRate": 1, "date": "2022-07-11T00:00:00", "id": "159623-724", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": -555.55, "links": [{"amount": 555.55, "currencyRate": 1, "id": "724", "type": "PaymentOnAccount"}]}], "modifiedDate": "2023-01-30T14:48:40Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "Deposit #DEP25", "sourceModifiedDate": "2022-07-11T09:41:02", "supplierRef": {"id": "724", "supplierName": "Vendor A.A.A"}, "totalAmount": -555.55}], "totalResults": 3} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "date": "2023-01-11T00:00:00", "id": "3A09-1071529982", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 532.97, "links": [{"amount": -532.97, "currencyRate": 1, "id": "38AA-1071513625", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:09:20Z", "note": "Monthly Truck Payment", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "101", "sourceModifiedDate": "2023-12-16T05:04:58", "supplierRef": {"id": "720000-1071512482", "supplierName": "Bayshore Auto Mall"}, "totalAmount": 532.97}, {"accountRef": {"id": "8000007E-1197732180", "name": "CalOil Credit Card"}, "currency": "GBP", "currencyRate": 1, "date": "2023-01-15T00:00:00", "id": "84C2-1197705262", "lines": [{"allocatedOnDate": "2023-01-15T00:00:00", "amount": 4050.98, "links": [{"amount": -4050.98, "currencyRate": 1, "id": "84C2-1197705262", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:09:20Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2023-12-16T05:06:15", "supplierRef": {"id": "B0000-933272656", "supplierName": "Patton Hardware Supplies"}, "totalAmount": 4050.98}], "totalResults": 214} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "date": "2019-05-13T00:00:00", "id": "20", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -5, "currencyRate": 1, "id": "18", "type": "Bill"}, {"amount": 5, "currencyRate": 1, "id": "19", "type": "CreditNote"}]}], "modifiedDate": "2023-01-18T11:02:47Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2019-05-13T13:14:26Z", "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "totalAmount": 0}, {"accountRef": {"id": "63", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "date": "2019-05-31T00:00:00", "id": "25", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 5999.99, "links": [{"amount": -5999.99, "currencyRate": 1, "id": "24", "type": "Bill"}]}], "modifiedDate": "2023-01-18T11:02:47Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2019-05-31T12:55:10Z", "supplierRef": {"id": "5", "supplierName": "Callum McGinley"}, "totalAmount": 5999.99}], "totalResults": 126} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "81", "name": "Current"}, "currency": "HKD", "currencyRate": 0.078807, "date": "2016-01-23T00:00:00", "id": "158", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 7940.6, "links": [{"amount": -7940.6, "currencyRate": 1, "id": "157", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:42Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "1067", "sourceModifiedDate": "2016-09-13T21:19:36Z", "supplierRef": {"id": "57", "supplierName": "Hall's Promo Items"}, "totalAmount": 7940.6}, {"accountRef": {"id": "81", "name": "Current"}, "currency": "HKD", "currencyRate": 0.078807, "date": "2016-01-23T00:00:00", "id": "159", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 742.5, "links": [{"amount": -742.5, "currencyRate": 1, "id": "28", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:42Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "1068", "sourceModifiedDate": "2016-09-13T21:19:49Z", "supplierRef": {"id": "57", "supplierName": "Hall's Promo Items"}, "totalAmount": 742.5}], "totalResults": 191} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "date": "2020-01-05T00:00:00Z", "id": "45462", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 27, "links": [{"amount": -27, "currencyRate": 1, "id": "CON001", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-14T09:35:54Z", "note": "", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "Payment invoice 1", "sourceModifiedDate": "2020-02-28T14:23:46Z", "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "totalAmount": 27}, {"currency": "GBP", "currencyRate": 1, "date": "2020-01-17T00:00:00Z", "id": "45502", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 59, "links": [{"amount": -59, "currencyRate": 1, "id": "SDE001", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-14T09:35:54Z", "note": "pay3", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "payment inv3", "sourceModifiedDate": "2020-02-28T14:23:46Z", "supplierRef": {"id": "SDE001", "supplierName": "S D Enterprises"}, "totalAmount": 59}], "totalResults": 64} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "date": "2022-01-29T00:00:00", "id": "255", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 117.5, "links": [{"amount": -117.5, "currencyRate": 1, "id": "86", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 64.63, "links": [{"amount": -64.63, "currencyRate": 1, "id": "87", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 50.57, "links": [{"amount": -50.57, "currencyRate": 1, "id": "250", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 36.87, "links": [{"amount": -36.87, "currencyRate": 1, "id": "251", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 101.14, "links": [{"amount": -101.14, "currencyRate": 1, "id": "252", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "note": "Purchase payment 255 linked to, purchase invoice 86, purchase invoice 87, purchase invoice 250, purchase invoice 251, purchase invoice 252.", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-11-25T09:43:54", "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "totalAmount": 370.71}, {"currency": "GBP", "currencyRate": 1, "date": "2022-01-29T00:00:00", "id": "256", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 256.36, "links": [{"amount": -256.36, "currencyRate": 1, "id": "17", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "note": "Purchase payment 256 linked to, purchase invoice 17.", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-11-25T09:43:54", "supplierRef": {"id": "QUA001", "supplierName": "Quality Motors"}, "totalAmount": 256.36}], "totalResults": 27} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "date": "2018-02-15T00:00:00", "id": "d953b45e156011e8b45c025132dab352", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 52.02, "links": [{"amount": -52.02, "currencyRate": 1, "id": "ca430e0d156011e8b45c025132dab352", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-24T14:54:04Z", "note": "Supplier payment using credit/debit card - Cool stuff", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2019-11-20T09:30:03Z", "supplierRef": {"id": "ca430e0d156011e8b45c025132dab352", "supplierName": "Test Supplier"}, "totalAmount": 52.02}, {"accountRef": {"id": "9a3e4bc6267a11e797950a57719b2edb", "name": "Cash"}, "currency": "GBP", "currencyRate": 1, "date": "2018-03-06T00:00:00", "id": "a99b9aae216111e8b45c025132dab352", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 52.02, "links": [{"amount": -52.02, "currencyRate": 1, "id": "ca430e0d156011e8b45c025132dab352", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-24T14:54:04Z", "note": "Supplier payment using cash", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2018-03-06T17:13:17Z", "supplierRef": {"id": "ca430e0d156011e8b45c025132dab352", "supplierName": "Test Supplier"}, "totalAmount": 52.02}], "totalResults": 2225} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/billPayments?page=1&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "date": "2022-01-06T00:00:00", "id": "4471", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 20, "links": [{"amount": -20, "currencyRate": 1, "id": "4470", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:13Z", "note": "", "paymentMethodRef": {"id": "6", "name": "Cash"}, "sourceModifiedDate": "2022-02-23T12:03:30", "supplierRef": {"id": "3", "supplierName": "ADP"}, "totalAmount": 20}, {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "date": "2022-01-06T00:00:00", "id": "4472", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 5, "links": [{"amount": -5, "currencyRate": 1, "id": "4470", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:13Z", "note": "", "paymentMethodRef": {"id": "6", "name": "Cash"}, "sourceModifiedDate": "2022-02-23T12:06:58", "supplierRef": {"id": "3", "supplierName": "ADP"}, "totalAmount": 5}], "totalResults": 2} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "date": "2021-12-20T00:00:00", "id": "74004690-82a1-4810-aaca-6ce575af94b4", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 7267.2, "links": [{"amount": -7267.2, "currencyRate": 1, "id": "3945273c-cc04-479f-a4b5-1e3dc7a55ed1", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:37:10Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2021-01-02T22:51:40", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "totalAmount": 7267.2}, {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "date": "2022-02-17T00:00:00", "id": "f2062172-b444-4c8b-b797-9f4c7a4244c7", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 7267.2, "links": [{"amount": -7267.2, "currencyRate": 1, "id": "09aa506f-cb81-4cd3-a1ea-6a0b91804d5a", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:37:10Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2021-01-02T22:51:38", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "totalAmount": 7267.2}], "totalResults": 30} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-commerce-customer: + BigCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Portsmouth", "country": "United Kingdom", "line1": "My Billing Address ./*drop table", "postalCode": "PS13HJ", "region": "", "type": "Unknown"}, {"city": "Portsmouth", "country": "United Kingdom", "line1": "This is my address, I cant hit enter.", "postalCode": "PS13HJ", "region": "", "type": "Unknown"}], "createdDate": "2022-06-15T15:54:15Z", "customerName": "Amy Jones", "defaultCurrency": "XXX", "emailAddress": "a.durbanjackson+amy@codat.io", "id": "1", "modifiedDate": "2023-04-11T10:33:49Z", "phone": "07770666777", "sourceModifiedDate": "2022-06-15T15:54:15Z"} + Clover: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customerId: "" + responses: + "200": + application/json: {"addresses": [], "createdDate": "2021-09-22T13:10:12Z", "customerName": "", "defaultCurrency": "EUR", "emailAddress": "fred.smith@myCompany.com", "id": "2CBJ8R898ZJAR", "modifiedDate": "2023-01-09T11:01:03Z", "phone": "+44 25691 154789", "sourceModifiedDate": "0001-01-01T00:00:00"} + Mollie: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customerId: "" + responses: + "200": + application/json: {"addresses": [], "createdDate": "2022-01-18T11:41:54", "customerName": "Frod Baggins", "defaultCurrency": "USD", "emailAddress": "frodo.baggings@theshire.com", "id": "cst_NUkBHQmekz", "modifiedDate": "2022-03-17T15:47:28Z", "phone": "01224 658 999", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + Mollie Test: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customerId: "" + responses: + "200": + application/json: {"addresses": [], "createdDate": "2022-01-18T11:41:54", "customerName": "Frod Baggins", "defaultCurrency": "EUR", "emailAddress": "frodo.baggings@theshire.com", "id": "cst_NUkBHQmekz", "modifiedDate": "2022-08-17T11:33:19Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + PrestaShop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "City Test", "country": "US", "line1": "1 test street", "postalCode": "55678", "region": "Virginia", "type": "Unknown"}], "createdDate": "2021-09-02T07:54:26", "customerName": "Bob Smith", "defaultCurrency": "EUR", "emailAddress": "bob.smith@example.com", "id": "2", "modifiedDate": "2022-01-26T15:09:42Z", "phone": "01224 658 999", "sourceModifiedDate": "2021-09-02T07:54:26"} + Shopify: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "London", "country": "United Kingdom", "line1": "301 Ink Rooms, 28 Easton St, Farringdon", "line2": "28 Easton St, Farringdon", "postalCode": "WC1X 0BE", "region": "England", "type": "Unknown"}], "createdDate": "2021-11-18T15:24:03", "customerName": "AL A", "defaultCurrency": "USD", "emailAddress": "a.macra@codat.io", "id": "5839032287390", "modifiedDate": "2023-02-10T15:18:25Z", "phone": "01224 658 999", "sourceModifiedDate": "2021-11-18T15:24:03"} + Square: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "London", "line1": "1 Main Street", "line2": "Flat 20", "postalCode": "W1A 1AA", "region": "London", "type": "Unknown"}], "createdDate": "2021-03-08T11:21:11Z", "customerName": "Fred Smith", "defaultCurrency": "USD", "emailAddress": "fake@name.com", "id": "FT9948H3VD6GF8MPDD5438KY1M", "modifiedDate": "2022-08-02T10:27:32Z", "phone": "+441234567890", "sourceModifiedDate": "2021-03-08T11:21:11Z"} + Stripe Test: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customerId: "" + responses: + "200": + application/json: {"addresses": [], "createdDate": "2022-04-20T07:59:52Z", "customerName": "Barry Smith", "defaultCurrency": "gbp", "emailAddress": "barry@example.com", "id": "cus_LXdjls7KY5ZHaz", "modifiedDate": "2022-09-30T11:18:27Z", "note": "Test Subscription", "phone": "(877) 492-8687", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + WooCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "", "country": "", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "createdDate": "2021-03-11T09:04:27", "customerName": "Qa Test", "defaultCurrency": "EUR", "emailAddress": "a.macra@codat.io", "id": "201694267", "modifiedDate": "2021-07-13T16:19:00Z", "phone": "", "sourceModifiedDate": "2021-03-11T09:07:00"} + Zettle: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "City", "country": "GB", "line1": "Line1", "postalCode": "TT1 1TT", "type": "Unknown"}], "createdDate": "2021-01-07T16:17:34", "customerName": "Firstname Lastname", "defaultCurrency": "GBP", "emailAddress": "firstname.lastname@example.com", "id": "firstname.lastname@example.com", "modifiedDate": "2021-01-27T13:08:51Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2021-01-08T09:57:56"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customerId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-commerce-customers: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"createdDate": "2022-10-23T00:00:00Z", "customerName": "Fred Smith", "defaultCurrency": "GBP", "emailAddress": "fred.smith@myCompany.com", "id": "7110701885", "modifiedDate": "2022-10-23T00:00:00Z", "phone": "01224 658 999", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "totalResults": 1} + "400": {} + BigCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d1ebcf6d-f7f9-4841-8a06-fec12c492a48/connections/7c0a21e8-938a-40a4-b0f7-5ab5d46804b0/data/commerce-customers?page=1&pageSize=2"}, "next": {"href": "/companies/d1ebcf6d-f7f9-4841-8a06-fec12c492a48/connections/7c0a21e8-938a-40a4-b0f7-5ab5d46804b0/data/commerce-customers?page=2&pageSize=2"}, "self": {"href": "/companies/d1ebcf6d-f7f9-4841-8a06-fec12c492a48/connections/7c0a21e8-938a-40a4-b0f7-5ab5d46804b0/data/commerce-customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Portsmouth", "country": "United Kingdom", "line1": "My Billing Address ./*drop table", "postalCode": "PS13HJ", "region": "", "type": "Unknown"}, {"city": "Portsmouth", "country": "United Kingdom", "line1": "This is my address, I cant hit enter.", "postalCode": "PS13HJ", "region": "", "type": "Unknown"}], "createdDate": "2022-06-15T15:54:15Z", "customerName": "Amy Jones", "defaultCurrency": "XXX", "emailAddress": "a.jackson@email.me", "id": "1", "modifiedDate": "2023-04-11T10:33:49Z", "phone": "07770 666777", "sourceModifiedDate": "2022-06-15T15:54:15Z"}, {"addresses": [], "createdDate": "2023-04-11T15:49:25Z", "customerName": "Cust001 Cust001", "defaultCurrency": "XXX", "emailAddress": "Cust001@example.com", "id": "2", "modifiedDate": "2023-04-17T15:42:55Z", "phone": "05442 203941", "sourceModifiedDate": "2023-04-11T15:49:25Z"}], "totalResults": 201} + Clover: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/aae80eb3-1f56-41ca-a171-a59f9ee03b26/connections/4a5b633b-cd86-4715-a22b-62be98c4bcc5/data/commerce-customers?page=1&pageSize=2"}, "next": {"href": "/companies/aae80eb3-1f56-41ca-a171-a59f9ee03b26/connections/4a5b633b-cd86-4715-a22b-62be98c4bcc5/data/commerce-customers?page=2&pageSize=2"}, "self": {"href": "/companies/aae80eb3-1f56-41ca-a171-a59f9ee03b26/connections/4a5b633b-cd86-4715-a22b-62be98c4bcc5/data/commerce-customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "createdDate": "2021-09-22T13:10:12Z", "customerName": "", "defaultCurrency": "GBP", "emailAddress": "fred.smith@myCompany.com", "id": "2CBJ8R898ZJAR", "modifiedDate": "2023-01-09T11:01:03Z", "phone": "(877) 492-8687", "sourceModifiedDate": "0001-01-01T00:00:00"}, {"addresses": [], "createdDate": "2021-09-21T14:54:38Z", "customerName": "", "defaultCurrency": "GBP", "emailAddress": "fred.smith@myCompany.com", "id": "511JV0FRN2QYC", "modifiedDate": "2023-01-09T11:01:03Z", "phone": "+44 25691 154789", "sourceModifiedDate": "0001-01-01T00:00:00"}], "totalResults": 9} + Mollie: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/a68cb447-182d-4bbe-be1a-f526d11d69d5/connections/dfbf847b-cde8-4b00-b2f9-af51dec0d337/data/commerce-customers?page=1&pageSize=2"}, "next": {"href": "/companies/a68cb447-182d-4bbe-be1a-f526d11d69d5/connections/dfbf847b-cde8-4b00-b2f9-af51dec0d337/data/commerce-customers?page=2&pageSize=2"}, "self": {"href": "/companies/a68cb447-182d-4bbe-be1a-f526d11d69d5/connections/dfbf847b-cde8-4b00-b2f9-af51dec0d337/data/commerce-customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "createdDate": "2022-01-18T11:41:54", "customerName": "Frod Baggins", "defaultCurrency": "GBP", "emailAddress": "frodo.baggings@theshire.com", "id": "cst_NUkBHQmekz", "modifiedDate": "2022-03-17T15:47:28Z", "phone": "01224 658 999", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"addresses": [], "createdDate": "2022-01-18T11:42:05", "customerName": "Frodo Baggins", "defaultCurrency": "EUR", "emailAddress": "frodo.baggings@theshire.com", "id": "cst_BvBxwuwfvH", "modifiedDate": "2022-03-17T15:47:28Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "totalResults": 3} + Mollie Test: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b978f9fe-8d63-4cfc-b2c2-b61b72e22785/connections/d564f8fd-0766-4ab8-a427-7c893f9b9ff6/data/commerce-customers?page=1&pageSize=2"}, "next": {"href": "/companies/b978f9fe-8d63-4cfc-b2c2-b61b72e22785/connections/d564f8fd-0766-4ab8-a427-7c893f9b9ff6/data/commerce-customers?page=2&pageSize=2"}, "self": {"href": "/companies/b978f9fe-8d63-4cfc-b2c2-b61b72e22785/connections/d564f8fd-0766-4ab8-a427-7c893f9b9ff6/data/commerce-customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "createdDate": "2022-01-18T11:41:54", "customerName": "Frod Baggins", "defaultCurrency": "GBP", "emailAddress": "frodo.baggings@theshire.com", "id": "cst_NUkBHQmekz", "modifiedDate": "2022-08-17T11:33:19Z", "phone": "01224 658 999", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"addresses": [], "createdDate": "2022-01-18T11:42:05", "customerName": "Frodo Baggins", "defaultCurrency": "EUR", "emailAddress": "frodo.baggings@theshire.com", "id": "cst_BvBxwuwfvH", "modifiedDate": "2022-08-17T11:33:19Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "totalResults": 3} + PrestaShop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/2bf78e61-58ca-421a-a430-5dfa59cf15b0/connections/30774c1f-fdcd-491e-9e60-47e316b3ab9b/data/commerce-customers?page=1&pageSize=2"}, "next": {"href": "/companies/2bf78e61-58ca-421a-a430-5dfa59cf15b0/connections/30774c1f-fdcd-491e-9e60-47e316b3ab9b/data/commerce-customers?page=2&pageSize=2"}, "self": {"href": "/companies/2bf78e61-58ca-421a-a430-5dfa59cf15b0/connections/30774c1f-fdcd-491e-9e60-47e316b3ab9b/data/commerce-customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "City Test", "country": "US", "line1": "1 test street", "postalCode": "55678", "region": "Virginia", "type": "Unknown"}], "createdDate": "2021-09-02T07:54:26", "customerName": "Bob Smith", "defaultCurrency": "GBP", "emailAddress": "bob.smith@example.com", "id": "2", "modifiedDate": "2022-01-26T15:09:42Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2021-09-02T07:54:26"}, {"addresses": [], "createdDate": "2021-09-03T01:55:13", "customerName": "Fake Name", "defaultCurrency": "EUR", "emailAddress": "bob@bob.com", "id": "3", "modifiedDate": "2022-01-26T15:09:42Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2021-09-03T01:55:13"}], "totalResults": 5} + Shopify: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-customers?page=1&pageSize=2"}, "next": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-customers?page=2&pageSize=2"}, "self": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "London", "country": "United Kingdom", "line1": "301 Ink Rooms, 28 Easton St, Farringdon", "line2": "28 Easton St, Farringdon", "postalCode": "WC1X 0BE", "region": "England", "type": "Unknown"}], "createdDate": "2021-11-18T15:24:03", "customerName": "AL A", "defaultCurrency": "USD", "emailAddress": "a.macra@codat.io", "id": "5839032287390", "modifiedDate": "2023-02-10T15:18:25Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2021-11-18T15:24:03"}, {"addresses": [{"city": "London", "line1": "Look Street", "postalCode": "PO16 7GZ", "type": "Unknown"}, {"city": "London", "country": "United Kingdom", "line1": "Look Street", "postalCode": "PO16 7GZ", "region": "England", "type": "Unknown"}], "createdDate": "2021-03-19T10:12:37", "customerName": "Qa Test", "defaultCurrency": "USD", "emailAddress": "fred.smith@myCompany.com", "id": "5097398534302", "modifiedDate": "2023-02-10T15:18:25Z", "note": "", "phone": "+445593368390", "sourceModifiedDate": "2022-08-01T13:07:59"}], "totalResults": 6} + Square: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d779fc82-a098-4107-a9fc-c2a1dda3d522/connections/9b098b74-3770-4dad-9001-4c283a39f1e5/data/commerce-customers?page=1&pageSize=2"}, "self": {"href": "/companies/d779fc82-a098-4107-a9fc-c2a1dda3d522/connections/9b098b74-3770-4dad-9001-4c283a39f1e5/data/commerce-customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "London", "line1": "1 Main Street", "line2": "Flat 20", "postalCode": "W1A 1AA", "region": "London", "type": "Unknown"}], "createdDate": "2021-03-08T11:21:11Z", "customerName": "Fred Smith", "defaultCurrency": "GBP", "emailAddress": "fake@name.com", "id": "FT9948H3VD6GF8MPDD5438KY1M", "modifiedDate": "2022-08-02T10:27:32Z", "phone": "+441234567890", "sourceModifiedDate": "2021-03-08T11:21:11Z"}, {"addresses": [], "createdDate": "2020-11-19T14:56:00Z", "customerName": "Fred Smith", "defaultCurrency": "GBP", "emailAddress": "s.shandil+square@codat.io", "id": "GXQDPSZSMN6C58270SZN4YJZ8R", "modifiedDate": "2022-08-02T10:27:32Z", "phone": "+447729946295", "sourceModifiedDate": "2020-11-19T14:56:00Z"}], "totalResults": 2} + Stripe Test: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/8206e78e-e340-411e-b315-473c4ab73b48/connections/43e58373-0a1d-44a0-97f0-9fa9993a14fa/data/commerce-customers?page=1&pageSize=2"}, "next": {"href": "/companies/8206e78e-e340-411e-b315-473c4ab73b48/connections/43e58373-0a1d-44a0-97f0-9fa9993a14fa/data/commerce-customers?page=2&pageSize=2"}, "self": {"href": "/companies/8206e78e-e340-411e-b315-473c4ab73b48/connections/43e58373-0a1d-44a0-97f0-9fa9993a14fa/data/commerce-customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "createdDate": "2022-04-20T07:59:52Z", "customerName": "Barry Smith", "defaultCurrency": "gbp", "emailAddress": "barry@example.com", "id": "cus_LXdjls7KY5ZHaz", "modifiedDate": "2022-09-30T11:18:27Z", "note": "Test Subscription", "phone": "(877) 492-8687", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"addresses": [{"city": "London", "country": "GB", "line1": "301 Ink Rooms", "line2": "28 Easton Street", "postalCode": "WC1X 0BE", "type": "Billing"}, {"city": "London", "country": "GB", "line1": "301 Ink Rooms", "line2": "28 Easton Street", "postalCode": "WC1X 0BE", "type": "Delivery"}], "createdDate": "2022-04-20T07:30:01Z", "customerName": "David Dunlow", "defaultCurrency": "gbp", "emailAddress": "david@example.com", "id": "cus_LXdFFgHqqVURIv", "modifiedDate": "2022-09-30T11:18:27Z", "note": "Test Subscriptions", "phone": "+447545309714", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "totalResults": 14} + WooCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/010c6f53-8fc8-40ab-9ed5-41191cf9c6b5/connections/7545ca2e-5f58-4f98-8af2-3b2c38bb8074/data/commerce-customers?page=1&pageSize=2"}, "self": {"href": "/companies/010c6f53-8fc8-40ab-9ed5-41191cf9c6b5/connections/7545ca2e-5f58-4f98-8af2-3b2c38bb8074/data/commerce-customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "", "country": "", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "createdDate": "2021-03-11T09:04:27", "customerName": "Qa Test", "defaultCurrency": "USD", "emailAddress": "a.macra@codat.io", "id": "201694267", "modifiedDate": "2021-07-13T16:19:00Z", "phone": "", "sourceModifiedDate": "2021-03-11T09:07:00"}], "totalResults": 1} + Zettle: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fe8e3158-47e6-4367-9537-7d5001295500/connections/d60b15e7-7db9-459b-92a0-9557f7ebdeea/data/commerce-customers?page=1&pageSize=2"}, "self": {"href": "/companies/fe8e3158-47e6-4367-9537-7d5001295500/connections/d60b15e7-7db9-459b-92a0-9557f7ebdeea/data/commerce-customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "City", "country": "GB", "line1": "Line1", "postalCode": "TT1 1TT", "type": "Unknown"}], "createdDate": "2021-01-07T16:17:34", "customerName": "Firstname Lastname", "defaultCurrency": "GBP", "emailAddress": "firstname.lastname@example.com", "id": "firstname.lastname@example.com", "modifiedDate": "2021-01-27T13:08:51Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2021-01-08T09:57:56"}, {"addresses": [{"city": "London", "country": "GB", "line1": "Flat 1", "line2": "1 High Street", "region": "London", "type": "Unknown"}, {"city": "London", "country": "GB", "line1": "Flat 2", "line2": "2 High Street", "region": "London", "type": "Unknown"}], "createdDate": "2020-12-21T14:52:15", "customerName": "Joe Bloggs", "defaultCurrency": "GBP", "emailAddress": "joe@bloggs.com", "id": "joe@bloggs.com", "modifiedDate": "2021-01-27T13:08:51Z", "phone": "02012 345678", "sourceModifiedDate": "2020-12-21T14:52:15"}], "totalResults": 2} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-commerce-dispute: + Shopify: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + disputeId: "" + responses: + "200": + application/json: {"createdDate": "2021-03-19T13:16:27", "currency": "GBP", "disputedTransactions": [{"id": "3684116791454", "type": "Order"}], "dueDate": "2021-03-28T00:00:00", "id": "8502411422", "modifiedDate": "2023-02-10T15:18:22Z", "reason": "fraudulent", "sourceModifiedDate": "2021-03-28T11:00:17", "status": "Processing", "totalAmount": 175} + Stripe Test: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + disputeId: "" + responses: + "200": + application/json: {"createdDate": "2020-11-23T16:19:22Z", "currency": "GBP", "disputedTransactions": [{"id": "txn_1Hqhl8A8m8S1Gh7OtmAPNr9e", "type": "Payment"}], "dueDate": "2020-12-02T23:59:59Z", "id": "dp_1Hqhl8A8m8S1Gh7OJrvF3gsK", "modifiedDate": "2022-09-30T11:18:27Z", "reason": "fraudulent", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Processing", "totalAmount": 25} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + disputeId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-commerce-disputes: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"createdDate": "2021-03-22T14:39:55", "currency": "GBP", "disputedTransactions": [{"id": "e63ad857-7e12-4e64-9185-cdfd7c45d09d", "type": "Order"}], "dueDate": "2021-03-29T14:39:55", "id": "03e608e3-bd1c-454f-8c2b-fb0133e43b95", "modifiedDate": "2022-02-02T11:02:45Z", "reason": "Unhappy with product", "sourceModifiedDate": "2021-03-22T14:39:55", "status": "InquiryEvidenceRequired", "totalAmount": -47.66}], "totalResults": 1} + "400": {} + Shopify: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-disputes?page=1&pageSize=2"}, "self": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-disputes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdDate": "2021-03-19T13:16:27", "currency": "GBP", "disputedTransactions": [{"id": "3684116791454", "type": "Order"}], "dueDate": "2021-03-28T00:00:00", "id": "8502411422", "modifiedDate": "2023-02-10T15:18:22Z", "reason": "fraudulent", "sourceModifiedDate": "2021-03-28T11:00:17", "status": "Processing", "totalAmount": 175}, {"createdDate": "2021-03-19T13:18:31", "currency": "GBP", "disputedTransactions": [{"id": "3684119445662", "type": "Order"}], "dueDate": "2021-03-28T00:00:00", "id": "8502444190", "modifiedDate": "2023-02-10T15:18:22Z", "reason": "fraudulent", "sourceModifiedDate": "2021-03-28T11:00:18", "status": "Processing", "totalAmount": 600}], "totalResults": 2} + Stripe Test: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/8206e78e-e340-411e-b315-473c4ab73b48/connections/43e58373-0a1d-44a0-97f0-9fa9993a14fa/data/commerce-disputes?page=1&pageSize=2"}, "next": {"href": "/companies/8206e78e-e340-411e-b315-473c4ab73b48/connections/43e58373-0a1d-44a0-97f0-9fa9993a14fa/data/commerce-disputes?page=2&pageSize=2"}, "self": {"href": "/companies/8206e78e-e340-411e-b315-473c4ab73b48/connections/43e58373-0a1d-44a0-97f0-9fa9993a14fa/data/commerce-disputes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdDate": "2020-11-23T16:19:22Z", "currency": "GBP", "disputedTransactions": [{"id": "txn_1Hqhl8A8m8S1Gh7OtmAPNr9e", "type": "Payment"}], "dueDate": "2020-12-02T23:59:59Z", "id": "dp_1Hqhl8A8m8S1Gh7OJrvF3gsK", "modifiedDate": "2022-09-30T11:18:27Z", "reason": "fraudulent", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Processing", "totalAmount": 25}, {"createdDate": "2020-11-23T17:35:11Z", "currency": "GBP", "disputedTransactions": [{"id": "txn_1HqiwVA8m8S1Gh7O0IVelTQ5", "type": "Payment"}], "dueDate": "2020-12-02T23:59:59Z", "id": "dp_1HqiwVA8m8S1Gh7OpS3ozlcd", "modifiedDate": "2022-09-30T11:18:27Z", "reason": "product_not_received", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Lost", "totalAmount": 55}], "totalResults": 5} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-commerce-location: + Clover: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + locationId: "" + responses: + "200": + application/json: {"address": {"city": "London", "country": "GB", "line1": "301 Ink Rooms, 28 Easton Street", "postalCode": "WC1X 0BE", "region": "London", "type": "Inventory"}, "id": "GA3WP1ZC3ZFK1", "modifiedDate": "2023-01-09T11:01:03Z", "name": "Codat", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + Lightspeed K Trial: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + locationId: "" + responses: + "200": + application/json: {"address": {"country": "AU", "type": "Unknown"}, "id": "647208621834538", "modifiedDate": "2023-03-02T09:48:48Z", "name": "QA Shared - New Test Site", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + Shopify: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + locationId: "" + responses: + "200": + application/json: {"address": {"city": "London", "country": "GB", "line1": "301 Ink Rooms, 28 Easton St", "postalCode": "WC1X 0BE", "region": "London", "type": "Inventory"}, "id": "61375348894", "modifiedDate": "2023-02-10T15:18:25Z", "name": "301 Ink Rooms, 28 Easton St", "sourceModifiedDate": "2021-03-19T10:06:06"} + Square: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + locationId: "" + responses: + "200": + application/json: {"address": {"city": "London", "country": "GB", "line1": "301 Ink Rooms", "line2": "28 Easton Street", "postalCode": "WC1X0BE", "type": "Inventory"}, "id": "D8DVHD1G6NT2J", "modifiedDate": "2022-08-02T10:27:32Z", "name": "Codat Limited", "sourceModifiedDate": "2020-01-17T14:07:30Z"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + locationId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-commerce-locations: + Clover: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/aae80eb3-1f56-41ca-a171-a59f9ee03b26/connections/4a5b633b-cd86-4715-a22b-62be98c4bcc5/data/commerce-locations?page=1&pageSize=2"}, "self": {"href": "/companies/aae80eb3-1f56-41ca-a171-a59f9ee03b26/connections/4a5b633b-cd86-4715-a22b-62be98c4bcc5/data/commerce-locations"}}, "pageNumber": 1, "pageSize": 2, "results": [{"address": {"city": "London", "country": "GB", "line1": "301 Ink Rooms, 28 Easton Street", "postalCode": "WC1X 0BE", "region": "London", "type": "Inventory"}, "id": "GA3WP1ZC3ZFK1", "modifiedDate": "2023-01-09T11:01:03Z", "name": "Codat", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "totalResults": 1} + Lightspeed K Trial: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-locations?page=1&pageSize=2"}, "self": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-locations"}}, "pageNumber": 1, "pageSize": 2, "results": [{"address": {"country": "AU", "type": "Unknown"}, "id": "647208621834538", "modifiedDate": "2023-03-02T09:48:48Z", "name": "QA Shared - New Test Site", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "totalResults": 1} + Shopify: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-locations?page=1&pageSize=2"}, "self": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-locations"}}, "pageNumber": 1, "pageSize": 2, "results": [{"address": {"city": "London", "country": "GB", "line1": "301 Ink Rooms, 28 Easton St", "postalCode": "WC1X 0BE", "region": "London", "type": "Inventory"}, "id": "61375348894", "modifiedDate": "2023-02-10T15:18:25Z", "name": "301 Ink Rooms, 28 Easton St", "sourceModifiedDate": "2021-03-19T10:06:06"}], "totalResults": 1} + Square: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d779fc82-a098-4107-a9fc-c2a1dda3d522/connections/9b098b74-3770-4dad-9001-4c283a39f1e5/data/commerce-locations?page=1&pageSize=2"}, "self": {"href": "/companies/d779fc82-a098-4107-a9fc-c2a1dda3d522/connections/9b098b74-3770-4dad-9001-4c283a39f1e5/data/commerce-locations"}}, "pageNumber": 1, "pageSize": 2, "results": [{"address": {"city": "London", "country": "GB", "line1": "301 Ink Rooms", "line2": "28 Easton Street", "postalCode": "WC1X0BE", "type": "Inventory"}, "id": "D8DVHD1G6NT2J", "modifiedDate": "2022-08-02T10:27:32Z", "name": "Codat Limited", "sourceModifiedDate": "2020-01-17T14:07:30Z"}], "totalResults": 1} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-commerce-order: + Amazon Seller Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + orderId: "" + responses: + "200": + application/json: {"closedDate": "2022-10-23T00:00:00Z", "country": "US ", "createdDate": "1970-01-19T03:58:30Z", "currency": "USD", "customerRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "id": "902-1845936-5435065", "locationRef": {"id": "7110701885"}, "modifiedDate": "2023-01-09T09:12:12Z", "orderLineItems": [{"discountAllocations": [], "id": "O05015851154158", "productRef": {"id": "EILBDVJVNUAGVKRQ"}, "productVariantRef": {"id": "NABetaASINB00551Q3CS"}, "quantity": 1, "taxPercentage": 11.23, "taxes": [], "totalAmount": 10, "totalTaxAmount": 1.01, "unitPrice": 8.99}], "orderNumber": "902-1845936-5435065", "payments": [], "serviceCharges": [], "sourceModifiedDate": "1970-01-19T03:58:32Z", "totalAmount": 10, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 1.01} + BigCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + orderId: "" + responses: + "200": + application/json: {"closedDate": "2022-10-23T00:00:00Z", "country": "GBR", "createdDate": "2022-06-15T15:48:18Z", "currency": "GBP", "customerRef": {"id": "0"}, "id": "100", "locationRef": {"id": "EILBDVJVNUAGVKRQ"}, "modifiedDate": "2023-04-11T10:33:56Z", "orderLineItems": [{"discountAllocations": [{"name": "Manual Discount", "totalAmount": 3.36}], "id": "1", "productRef": {"id": "86", "name": "[Sample] Able Brewing System"}, "productVariantRef": {"id": "66", "name": "[Sample] Able Brewing System"}, "quantity": 1, "taxPercentage": 20, "taxes": [], "totalAmount": 221.64, "totalTaxAmount": 36.94, "unitPrice": 187.5}, {"discountAllocations": [{"name": "Manual Discount", "totalAmount": 6.64}], "id": "2", "productRef": {"id": "81", "name": "[Sample] Orbit Terrarium - Small"}, "productVariantRef": {"id": "65", "name": "[Sample] Orbit Terrarium - Small"}, "quantity": 5, "taxPercentage": 19.9999, "taxes": [], "totalAmount": 438.36, "totalTaxAmount": 73.06, "unitPrice": 74.1667}], "orderNumber": "100", "payments": [], "serviceCharges": [{"description": "Shipping Charge", "quantity": 1, "taxAmount": 2.5, "taxPercentage": 20, "taxes": [], "totalAmount": 15, "type": "Shipping"}], "sourceModifiedDate": "2022-06-15T15:48:18Z", "totalAmount": 675, "totalDiscount": 10, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 112.5} + Clover: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + orderId: "" + responses: + "200": + application/json: {"closedDate": "2022-10-23T00:00:00Z", "country": "GB ", "createdDate": "2021-05-24T10:33:41Z", "currency": "GBP", "customerRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "id": "0BCZPWGFC3M16", "locationRef": {"id": "GA3WP1ZC3ZFK1", "name": "Codat"}, "modifiedDate": "2022-09-08T15:47:43Z", "orderLineItems": [{"discountAllocations": [], "id": "985WY5J4H12XY", "productRef": {"id": "NMZHKK6FKF6ZJ", "name": "Laptop"}, "productVariantRef": {"id": "EILBDVJVNUAGVKRQ"}, "quantity": 1, "taxPercentage": 20, "taxes": [{"taxComponentRef": {"id": "KAWQTPZP3R9VT", "name": "VAT 20%"}}], "totalAmount": 1200, "totalTaxAmount": 200, "unitPrice": 1000}], "orderNumber": "0BCZPWGFC3M16", "payments": [{"amount": 0, "createdDate": "2022-10-23T00:00:00Z", "currency": "EUR", "dueDate": "2022-10-23T00:00:00Z", "id": "S2D924NX13T2G", "modifiedDate": "2022-10-23T00:00:00Z", "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "type": "Cash"}], "serviceCharges": [], "sourceModifiedDate": "2021-05-24T10:33:45Z", "totalAmount": 1200, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 200} + Lightspeed K Trial: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + orderId: "" + responses: + "200": + application/json: {"closedDate": "2022-12-09T02:27:46Z", "country": "AU ", "createdDate": "2022-12-09T02:27:14Z", "currency": "AUD", "customerRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "id": "A61465.1", "locationRef": {"id": "647208621834538", "name": "QA Shared - New Test Site"}, "modifiedDate": "2023-03-08T13:49:34Z", "orderLineItems": [{"discountAllocations": [], "id": "S61465.1", "productRef": {"id": "647208621834617", "name": "Hot Chocolate"}, "productVariantRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "quantity": 1, "taxPercentage": 10, "taxes": [{"taxComponentRef": {"id": "GST10", "name": "10% GST"}}], "totalAmount": 5, "totalTaxAmount": 0.45, "unitPrice": 4.5455}], "orderNumber": "A61465.1", "payments": [{"amount": 5, "createdDate": "2022-12-09T02:27:46", "currency": "AUD", "dueDate": "0001-01-01T00:00:00", "id": "R61465.1_1_A61465.1_2022-12-09T02:27:46.273Z", "modifiedDate": "2023-03-02T09:50:43", "paymentProvider": "SagePay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "type": "Unknown"}], "serviceCharges": [], "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 5, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 0.45} + Mollie: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + orderId: "" + responses: + "200": + application/json: {"closedDate": "2022-10-23T00:00:00Z", "country": "NLD", "createdDate": "2022-01-20T09:28:32", "currency": "EUR", "customerRef": {"id": "EILBDVJVNUAGVKRQ"}, "id": "ord_2at3ck", "locationRef": {"id": "7110701885"}, "modifiedDate": "2022-03-17T15:47:28Z", "orderLineItems": [{"discountAllocations": [], "id": "odl_1.3tvc32", "productRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "productVariantRef": {"id": "EILBDVJVNUAGVKRQ"}, "quantity": 1, "taxPercentage": 21, "taxes": [], "totalAmount": 329.99, "totalTaxAmount": 57.27, "unitPrice": 329.99}, {"discountAllocations": [{"name": "Discount", "totalAmount": 100}], "id": "odl_1.x95vuk", "productRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "productVariantRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "quantity": 2, "taxPercentage": 21, "taxes": [], "totalAmount": 698, "totalTaxAmount": 121.14, "unitPrice": 399}], "orderNumber": "1337", "payments": [{"amount": 1027.99, "createdDate": "2022-02-08T15:44:22", "currency": "EUR", "dueDate": "0001-01-01T00:00:00", "id": "tr_GpHuaqHrca", "modifiedDate": "2022-03-17T15:47:28", "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-02-08T16:02:02", "status": "Failed", "type": "OnlineCard"}, {"amount": 1027.99, "createdDate": "2022-01-20T09:28:32", "currency": "EUR", "dueDate": "0001-01-01T00:00:00", "id": "tr_w7RGQc3k3V", "modifiedDate": "2022-03-17T15:47:28", "paymentProvider": "Checkout.com", "sourceModifiedDate": "2022-01-20T09:46:02", "status": "Failed", "type": "OnlineCard"}], "serviceCharges": [], "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 1027.99, "totalDiscount": 100, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 178.41} + Mollie Test: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + orderId: "" + responses: + "200": + application/json: {"closedDate": "2022-10-23T00:00:00Z", "country": "NLD", "createdDate": "2022-01-20T09:28:32", "currency": "EUR", "customerRef": {"id": "7110701885"}, "id": "ord_2at3ck", "locationRef": {"id": "EILBDVJVNUAGVKRQ"}, "modifiedDate": "2022-08-17T11:33:19Z", "orderLineItems": [{"discountAllocations": [{"name": "Discount", "totalAmount": 100}], "id": "odl_1.x95vuk", "productRef": {"id": "EILBDVJVNUAGVKRQ"}, "productVariantRef": {"id": "EILBDVJVNUAGVKRQ"}, "quantity": 2, "taxPercentage": 21, "taxes": [], "totalAmount": 698, "totalTaxAmount": 121.14, "unitPrice": 338.43}, {"discountAllocations": [], "id": "odl_1.3tvc32", "productRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "productVariantRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "quantity": 1, "taxPercentage": 21, "taxes": [], "totalAmount": 329.99, "totalTaxAmount": 57.27, "unitPrice": 272.72}], "orderNumber": "1337", "payments": [{"amount": 0, "createdDate": "2022-10-23T00:00:00Z", "currency": "USD", "dueDate": "2022-10-23T00:00:00Z", "id": "tr_GpHuaqHrca", "modifiedDate": "2022-10-23T00:00:00Z", "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "type": "Cash"}, {"amount": 194.12, "createdDate": "2022-10-23T00:00:00Z", "currency": "USD", "dueDate": "2022-10-23T00:00:00Z", "id": "tr_w7RGQc3k3V", "modifiedDate": "2022-10-23T00:00:00Z", "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "type": "Cash"}], "serviceCharges": [], "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 1027.99, "totalDiscount": 100, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 178.41} + Partner Commerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + orderId: "" + responses: + "200": + application/json: {"closedDate": "2022-10-23T00:00:00Z", "country": "GM ", "createdDate": "2021-02-10T01:37:23", "currency": "CAD", "customerRef": {"id": "0dc0206d-f22f-48c9-a4e5-79f8383c3426"}, "id": "6d135134-2f77-45f7-af3d-ee873e42da45", "locationRef": {"id": "d84a8ce0-d7e4-400a-b07a-d4bddd9c1873"}, "modifiedDate": "2022-05-12T07:22:02Z", "orderLineItems": [{"discountAllocations": [{"name": "Discount", "totalAmount": 8.54}, {"name": "Discount", "totalAmount": 17.09}], "id": "89f5e83a-c87d-4b60-a009-0ea9065867aa", "productRef": {"id": "98ef828e-33e1-4c23-9383-a029f1d6a3a6"}, "productVariantRef": {"id": "dffcd99e-13bb-4b89-89ef-719b3b0777e6"}, "quantity": 3, "taxPercentage": 20, "taxes": [], "totalAmount": 85.44, "totalTaxAmount": 17.09, "unitPrice": 28.48}, {"discountAllocations": [], "id": "4c65f0d9-05c8-48eb-9c4a-1774f5073e66", "productRef": {"id": "561f8efb-3429-4c1f-a014-1fa595f9b3c6"}, "productVariantRef": {"id": "e0715a7a-0179-4a2e-b40d-800fd2f36764"}, "quantity": 3, "taxPercentage": 20, "taxes": [], "totalAmount": 118.38, "totalTaxAmount": 23.68, "unitPrice": 39.46}], "orderNumber": "93128704", "payments": [{"amount": 194.12, "createdDate": "2022-10-23T00:00:00Z", "currency": "EUR", "dueDate": "2022-10-23T00:00:00Z", "id": "3ec3d4c4-8003-4f77-a44e-08b3e17057bf", "modifiedDate": "2022-10-23T00:00:00Z", "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "type": "Cash"}], "serviceCharges": [], "sourceModifiedDate": "2021-02-10T01:37:23", "totalAmount": 203.82, "totalDiscount": 25.63, "totalGratuity": 80.81, "totalRefund": 0, "totalTaxAmount": 40.77} + PrestaShop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + orderId: "" + responses: + "200": + application/json: {"closedDate": "2022-10-23T00:00:00Z", "country": "US ", "createdDate": "2021-09-02T06:00:54", "currency": "USD", "customerRef": {"id": "1", "name": "John DOE"}, "id": "1", "locationRef": {"id": "EILBDVJVNUAGVKRQ"}, "modifiedDate": "2022-01-26T15:09:42Z", "orderLineItems": [{"discountAllocations": [], "id": "1", "productRef": {"id": "1", "name": "Hummingbird printed t-shirt"}, "productVariantRef": {"id": "EILBDVJVNUAGVKRQ"}, "quantity": 1, "taxPercentage": 0, "taxes": [], "totalAmount": 23.9, "totalTaxAmount": 0, "unitPrice": 23.9}, {"discountAllocations": [], "id": "2", "productRef": {"id": "2", "name": "Hummingbird printed sweater"}, "productVariantRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "quantity": 1, "taxPercentage": 0, "taxes": [], "totalAmount": 35.9, "totalTaxAmount": 0, "unitPrice": 35.9}], "orderNumber": "XKBKNABJK", "payments": [], "serviceCharges": [{"description": "Shipping", "quantity": 1, "taxAmount": 0, "taxPercentage": 0, "taxes": [], "totalAmount": 2, "type": "Shipping"}], "sourceModifiedDate": "2021-09-02T06:00:54", "totalAmount": 61.8, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 0} + Shopify: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + orderId: "" + responses: + "200": + application/json: {"closedDate": "2022-10-23T00:00:00Z", "country": "XXX", "createdDate": "2021-03-19T13:18:33", "currency": "GBP", "customerRef": {"id": "5097398534302", "name": "Qa Test"}, "id": "3684119445662", "locationRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "modifiedDate": "2023-02-10T15:18:24Z", "orderLineItems": [{"discountAllocations": [], "id": "9670458146974", "productRef": {"id": "6595494117534", "name": "Monitor"}, "productVariantRef": {"id": "39444526694558", "name": "Monitor"}, "quantity": 4, "taxPercentage": 0, "taxes": [], "totalAmount": 600, "totalTaxAmount": 0, "unitPrice": 150}], "orderNumber": "1007", "payments": [{"amount": 600, "createdDate": "2021-03-19T13:17:49", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "4630233579678", "modifiedDate": "2023-02-10T15:18:24", "paymentProvider": "Shopify Payments", "sourceModifiedDate": "2021-03-19T13:17:49", "status": "Failed", "type": "OnlineCard"}, {"amount": 600, "createdDate": "2021-03-19T13:18:29", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "4630234497182", "modifiedDate": "2023-02-10T15:18:24", "paymentProvider": "Shopify Payments", "sourceModifiedDate": "2021-03-19T13:18:29", "status": "Paid", "type": "OnlineCard"}], "serviceCharges": [], "sourceModifiedDate": "2022-08-01T13:12:35", "totalAmount": 600, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 0} + Square: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + orderId: "" + responses: + "200": + application/json: {"closedDate": "0001-01-01T00:00:00", "country": "GB ", "createdDate": "2021-02-14T19:38:28Z", "currency": "GBP", "customerRef": {"id": "EILBDVJVNUAGVKRQ"}, "id": "BDYNvtIYyWClkTjnh99CFR3fPwKZY", "locationRef": {"id": "D8DVHD1G6NT2J", "name": "Codat Limited"}, "modifiedDate": "2022-08-02T10:27:33Z", "orderLineItems": [{"discountAllocations": [], "id": "lLJpgArKQbBEn9nTvLRHP", "productRef": {"id": "EILBDVJVNUAGVKRQ"}, "productVariantRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "quantity": 1, "taxPercentage": 0, "taxes": [], "totalAmount": 50, "totalTaxAmount": 0, "unitPrice": 50}], "orderNumber": "BDYNvtIYyWClkTjnh99CFR3fPwKZY", "payments": [], "serviceCharges": [], "sourceModifiedDate": "2021-02-14T19:38:28Z", "totalAmount": 50, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 0} + SumUp: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + orderId: "" + responses: + "200": + application/json: {"closedDate": "2022-10-23T00:00:00Z", "country": "XXX", "createdDate": "2021-03-30T12:20:40Z", "currency": "GBP", "customerRef": {"id": "EILBDVJVNUAGVKRQ"}, "id": "07efcdd0-7f61-4d82-957f-52e8f0bd3f89", "locationRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "modifiedDate": "2022-09-14T10:58:04Z", "orderLineItems": [{"discountAllocations": [], "id": "Product undefined by SumUp", "productRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "productVariantRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "quantity": 1, "taxPercentage": 0, "taxes": [], "totalAmount": 200, "totalTaxAmount": 0, "unitPrice": 200}], "orderNumber": "TECXTU2KT6", "payments": [{"amount": 194.12, "createdDate": "2022-10-23T00:00:00Z", "currency": "GBP", "dueDate": "2022-10-23T00:00:00Z", "id": "07efcdd0-7f61-4d82-957f-52e8f0bd3f89", "modifiedDate": "2022-10-23T00:00:00Z", "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "type": "Cash"}], "serviceCharges": [], "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 200, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 0} + WooCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + orderId: "" + responses: + "200": + application/json: {"closedDate": "2022-10-23T00:00:00Z", "country": "GB ", "createdDate": "2021-03-27T23:29:38Z", "currency": "GBP", "customerRef": {"id": "200585744"}, "id": "111", "locationRef": {"id": "7110701885"}, "modifiedDate": "2022-07-11T15:35:48Z", "orderLineItems": [{"discountAllocations": [], "id": "53", "productRef": {"id": "82"}, "productVariantRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "quantity": 2, "taxPercentage": 20, "taxes": [], "totalAmount": 12, "totalTaxAmount": 2, "unitPrice": 5}, {"discountAllocations": [], "id": "54", "productRef": {"id": "81"}, "productVariantRef": {"id": "7110701885"}, "quantity": 2, "taxPercentage": 20, "taxes": [], "totalAmount": 24, "totalTaxAmount": 4, "unitPrice": 10}], "orderNumber": "111", "payments": [], "serviceCharges": [{"description": "Royal Mail", "quantity": 1, "taxAmount": 0, "taxPercentage": 0, "taxes": [], "totalAmount": 3.5, "type": "Shipping"}], "sourceModifiedDate": "2021-04-01T13:34:59Z", "totalAmount": 39.5, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 6} + Zettle: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + orderId: "" + responses: + "200": + application/json: {"closedDate": "2022-10-23T00:00:00Z", "country": "GB ", "createdDate": "2020-11-23T14:27:20Z", "currency": "GBP", "customerRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "id": "7TunRi2XEeueVK3fSQEQIw", "locationRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "modifiedDate": "2021-10-27T15:22:37Z", "orderLineItems": [{"discountAllocations": [], "id": "0", "productRef": {"id": "7f9f31e4-2d97-11eb-9f55-acde48001122"}, "productVariantRef": {"id": "7f9f35ea-2d97-11eb-9f55-acde48001122"}, "quantity": 1, "taxPercentage": 0, "taxes": [], "totalAmount": 45, "totalTaxAmount": 0, "unitPrice": 45}], "orderNumber": "3", "payments": [{"amount": 45, "createdDate": "2020-11-23T14:27:19", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "ed97bcde-2d97-11eb-a42e-25130f2dd258", "modifiedDate": "2021-10-27T15:22:37", "paymentProvider": "SagePay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown", "type": "Paypal"}], "serviceCharges": [], "sourceModifiedDate": "2020-11-23T14:27:20Z", "totalAmount": 45, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 0} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + orderId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-commerce-orders: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"closedDate": "2022-10-23T00:00:00Z", "country": "CAN", "createdDate": "2021-03-28T03:00:14", "currency": "CAD", "customerRef": {"id": "2634d180-7205-43f0-a73d-84af6443a005", "name": "Emmy Roberts"}, "id": "01e63721-1205-478e-8503-9d8bf8a93f44", "locationRef": {"id": "47bbffc7-c045-4b0f-a3bb-ecf1f669edfa"}, "modifiedDate": "2022-02-02T11:02:45Z", "orderLineItems": [{"discountAllocations": [], "id": "116113a6-54d3-4624-ba73-26a77a5ffd51", "productRef": {"id": "ac186646-41f2-4280-afea-1012c59459ab", "name": "Intelligent Concrete Salad"}, "productVariantRef": {"id": "f9ca9de5-9e31-460d-ac81-368f4e7c8fc0", "name": "Small Incredible Wooden Soap"}, "quantity": 1, "taxPercentage": 20, "taxes": [{"taxComponentRef": {"id": "72", "name": "Sales Tax"}}, {"taxComponentRef": {"id": "72", "name": "City Tax"}}], "totalAmount": 12, "totalTaxAmount": 2, "unitPrice": 10}], "orderNumber": "99123956", "payments": [{"amount": 12, "createdDate": "2021-03-28T03:00:14", "currency": "CAD", "dueDate": "2021-04-04T03:00:14", "id": "defdceb6-83a3-4b7d-a74e-e9ef947d5f48", "modifiedDate": "2022-02-02T11:02:45", "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown", "type": "Paypal"}], "serviceCharges": [{"description": "Service Charge", "quantity": 1, "taxAmount": 0.2, "taxPercentage": 20, "taxes": [{"taxComponentRef": {"id": "72", "name": "Service Tax"}}], "totalAmount": 1.2, "type": "Generic"}], "sourceModifiedDate": "2021-03-28T03:00:14", "totalAmount": 12, "totalDiscount": 0, "totalGratuity": 1, "totalRefund": 0, "totalTaxAmount": 2}], "totalResults": 1} + "400": {} + Amazon Seller Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/6a59da96-e6d2-4c5c-ace7-65ba8be6a472/connections/58be1638-2c74-4ad4-8ff3-8c5b98b5f0fe/data/commerce-orders?page=1&pageSize=2"}, "self": {"href": "/companies/6a59da96-e6d2-4c5c-ace7-65ba8be6a472/connections/58be1638-2c74-4ad4-8ff3-8c5b98b5f0fe/data/commerce-orders"}}, "pageNumber": 1, "pageSize": 2, "results": [{"closedDate": "2022-10-23T00:00:00Z", "country": "US ", "createdDate": "1970-01-19T03:58:30Z", "currency": "USD", "customerRef": {"id": "7110701885"}, "id": "902-1845936-5435065", "locationRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "modifiedDate": "2023-01-09T09:12:12Z", "orderLineItems": [{"discountAllocations": [], "id": "O05015851154158", "productRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "productVariantRef": {"id": "NABetaASINB00551Q3CS"}, "quantity": 1, "taxPercentage": 11.23, "taxes": [], "totalAmount": 10, "totalTaxAmount": 1.01, "unitPrice": 8.99}], "orderNumber": "902-1845936-5435065", "payments": [], "serviceCharges": [], "sourceModifiedDate": "1970-01-19T03:58:32Z", "totalAmount": 10, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 1.01}], "totalResults": 1} + BigCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d1ebcf6d-f7f9-4841-8a06-fec12c492a48/connections/7c0a21e8-938a-40a4-b0f7-5ab5d46804b0/data/commerce-orders?page=1&pageSize=2"}, "next": {"href": "/companies/d1ebcf6d-f7f9-4841-8a06-fec12c492a48/connections/7c0a21e8-938a-40a4-b0f7-5ab5d46804b0/data/commerce-orders?page=2&pageSize=2"}, "self": {"href": "/companies/d1ebcf6d-f7f9-4841-8a06-fec12c492a48/connections/7c0a21e8-938a-40a4-b0f7-5ab5d46804b0/data/commerce-orders"}}, "pageNumber": 1, "pageSize": 2, "results": [{"closedDate": "2022-10-23T00:00:00Z", "country": "GBR", "createdDate": "2022-06-15T15:48:18Z", "currency": "GBP", "customerRef": {"id": "0"}, "id": "100", "locationRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "modifiedDate": "2023-04-11T10:33:56Z", "orderLineItems": [{"discountAllocations": [{"name": "Manual Discount", "totalAmount": 3.36}], "id": "1", "productRef": {"id": "86", "name": "[Sample] Able Brewing System"}, "productVariantRef": {"id": "66", "name": "[Sample] Able Brewing System"}, "quantity": 1, "taxPercentage": 20, "taxes": [], "totalAmount": 221.64, "totalTaxAmount": 36.94, "unitPrice": 187.5}, {"discountAllocations": [{"name": "Manual Discount", "totalAmount": 6.64}], "id": "2", "productRef": {"id": "81", "name": "[Sample] Orbit Terrarium - Small"}, "productVariantRef": {"id": "65", "name": "[Sample] Orbit Terrarium - Small"}, "quantity": 5, "taxPercentage": 19.9999, "taxes": [], "totalAmount": 438.36, "totalTaxAmount": 73.06, "unitPrice": 74.1667}], "orderNumber": "100", "payments": [], "serviceCharges": [{"description": "Shipping Charge", "quantity": 1, "taxAmount": 2.5, "taxPercentage": 20, "taxes": [], "totalAmount": 15, "type": "Shipping"}], "sourceModifiedDate": "2022-06-15T15:48:18Z", "totalAmount": 675, "totalDiscount": 10, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 112.5}, {"closedDate": "2022-10-23T00:00:00Z", "country": "GBR", "createdDate": "2022-06-15T15:49:02Z", "currency": "GBP", "customerRef": {"id": "0"}, "id": "101", "locationRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "modifiedDate": "2023-04-11T10:33:56Z", "orderLineItems": [{"discountAllocations": [{"name": "Manual Discount", "totalAmount": 3.36}], "id": "3", "productRef": {"id": "86", "name": "[Sample] Able Brewing System"}, "productVariantRef": {"id": "66", "name": "[Sample] Able Brewing System"}, "quantity": 1, "taxPercentage": 20, "taxes": [], "totalAmount": 221.64, "totalTaxAmount": 36.94, "unitPrice": 187.5}, {"discountAllocations": [{"name": "Manual Discount", "totalAmount": 6.64}], "id": "4", "productRef": {"id": "81", "name": "[Sample] Orbit Terrarium - Small"}, "productVariantRef": {"id": "65", "name": "[Sample] Orbit Terrarium - Small"}, "quantity": 5, "taxPercentage": 19.9999, "taxes": [], "totalAmount": 438.36, "totalTaxAmount": 73.06, "unitPrice": 74.1667}], "orderNumber": "101", "payments": [], "serviceCharges": [{"description": "Shipping Charge", "quantity": 1, "taxAmount": 2.5, "taxPercentage": 20, "taxes": [], "totalAmount": 15, "type": "Shipping"}], "sourceModifiedDate": "2022-06-15T15:49:02Z", "totalAmount": 675, "totalDiscount": 10, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 112.5}], "totalResults": 14} + Clover: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/1535235d-5efb-4d17-9d94-491c1f35ff92/connections/ed802898-f920-486b-b553-d7b4c1ac6c8d/data/commerce-orders?page=1&pageSize=2"}, "next": {"href": "/companies/1535235d-5efb-4d17-9d94-491c1f35ff92/connections/ed802898-f920-486b-b553-d7b4c1ac6c8d/data/commerce-orders?page=2&pageSize=2"}, "self": {"href": "/companies/1535235d-5efb-4d17-9d94-491c1f35ff92/connections/ed802898-f920-486b-b553-d7b4c1ac6c8d/data/commerce-orders"}}, "pageNumber": 1, "pageSize": 2, "results": [{"closedDate": "2022-10-23T00:00:00Z", "country": "GB ", "createdDate": "2021-05-24T10:33:41Z", "currency": "GBP", "customerRef": {"id": "7110701885"}, "id": "0BCZPWGFC3M16", "locationRef": {"id": "GA3WP1ZC3ZFK1", "name": "Codat"}, "modifiedDate": "2022-09-08T15:47:43Z", "orderLineItems": [{"discountAllocations": [], "id": "985WY5J4H12XY", "productRef": {"id": "NMZHKK6FKF6ZJ", "name": "Laptop"}, "productVariantRef": {"id": "EILBDVJVNUAGVKRQ"}, "quantity": 1, "taxPercentage": 20, "taxes": [{"taxComponentRef": {"id": "KAWQTPZP3R9VT", "name": "VAT 20%"}}], "totalAmount": 1200, "totalTaxAmount": 200, "unitPrice": 1000}], "orderNumber": "0BCZPWGFC3M16", "payments": [{"amount": -283.56, "createdDate": "2022-10-23T00:00:00Z", "currency": "GBP", "dueDate": "2022-10-23T00:00:00Z", "id": "S2D924NX13T2G", "modifiedDate": "2022-10-23T00:00:00Z", "paymentProvider": "SagePay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "type": "Cash"}], "serviceCharges": [], "sourceModifiedDate": "2021-05-24T10:33:45Z", "totalAmount": 1200, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 200}, {"closedDate": "2022-10-23T00:00:00Z", "country": "GB ", "createdDate": "2021-05-24T11:24:48Z", "currency": "GBP", "customerRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "id": "0G22TXMYQQE54", "locationRef": {"id": "GA3WP1ZC3ZFK1", "name": "Codat"}, "modifiedDate": "2022-09-08T15:47:43Z", "orderLineItems": [{"discountAllocations": [], "id": "GZ73TPFAV6NTP", "productRef": {"id": "QVAV6KM1457B0", "name": "Desktop"}, "productVariantRef": {"id": "7110701885"}, "quantity": 1, "taxPercentage": 20, "taxes": [{"taxComponentRef": {"id": "KAWQTPZP3R9VT", "name": "VAT 20%"}}], "totalAmount": 1440, "totalTaxAmount": 240, "unitPrice": 1200}, {"discountAllocations": [{"name": "�10 off", "totalAmount": 100}], "id": "Discount: �10 off", "productRef": {"id": "7110701885"}, "productVariantRef": {"id": "7110701885"}, "quantity": 1, "taxPercentage": 0, "taxes": [], "totalAmount": -100, "totalTaxAmount": 0, "unitPrice": 0}], "orderNumber": "0G22TXMYQQE54", "payments": [{"amount": -283.56, "createdDate": "2022-10-23T00:00:00Z", "currency": "USD", "dueDate": "2022-10-23T00:00:00Z", "id": "H726AAJQYE3SP", "modifiedDate": "2022-10-23T00:00:00Z", "paymentProvider": "Checkout.com", "sourceModifiedDate": "2022-10-23T00:00:00Z", "type": "Cash"}], "serviceCharges": [], "sourceModifiedDate": "2021-05-24T11:24:52Z", "totalAmount": 1340, "totalDiscount": 100, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 240}], "totalResults": 76} + Lightspeed K Trial: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-orders?page=1&pageSize=2"}, "next": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-orders?page=2&pageSize=2"}, "self": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-orders"}}, "pageNumber": 1, "pageSize": 2, "results": [{"closedDate": "2022-12-09T02:27:46Z", "country": "AU ", "createdDate": "2022-12-09T02:27:14Z", "currency": "AUD", "customerRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "id": "A61465.1", "locationRef": {"id": "647208621834538", "name": "QA Shared - New Test Site"}, "modifiedDate": "2023-03-08T13:49:34Z", "orderLineItems": [{"discountAllocations": [], "id": "S61465.1", "productRef": {"id": "647208621834617", "name": "Hot Chocolate"}, "productVariantRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "quantity": 1, "taxPercentage": 10, "taxes": [{"taxComponentRef": {"id": "GST10", "name": "10% GST"}}], "totalAmount": 5, "totalTaxAmount": 0.45, "unitPrice": 4.5455}], "orderNumber": "A61465.1", "payments": [{"amount": 5, "createdDate": "2022-12-09T02:27:46", "currency": "AUD", "dueDate": "0001-01-01T00:00:00", "id": "R61465.1_1_A61465.1_2022-12-09T02:27:46.273Z", "modifiedDate": "2023-03-02T09:50:43", "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "type": "Unknown"}], "serviceCharges": [], "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 5, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 0.45}, {"closedDate": "2022-12-12T23:21:29Z", "country": "AU ", "createdDate": "2022-12-12T23:20:12Z", "currency": "AUD", "customerRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "id": "A61465.2", "locationRef": {"id": "647208621834538", "name": "QA Shared - New Test Site"}, "modifiedDate": "2023-03-08T13:49:34Z", "orderLineItems": [{"discountAllocations": [], "id": "S61465.2", "productRef": {"id": "647208621834663", "name": "Royal"}, "productVariantRef": {"id": "7110701885"}, "quantity": 1, "taxPercentage": 10, "taxes": [{"taxComponentRef": {"id": "GST10", "name": "10% GST"}}], "totalAmount": 5, "totalTaxAmount": 0.46, "unitPrice": 4.5455}, {"discountAllocations": [], "id": "S61465.3", "productRef": {"id": "647208621834623", "name": "Mocha"}, "productVariantRef": {"id": "EILBDVJVNUAGVKRQ"}, "quantity": 1, "taxPercentage": 10, "taxes": [{"taxComponentRef": {"id": "GST10", "name": "10% GST"}}], "totalAmount": 5, "totalTaxAmount": 0.45, "unitPrice": 4.5455}], "orderNumber": "A61465.2", "payments": [{"amount": 10, "createdDate": "2022-12-12T23:21:29", "currency": "AUD", "dueDate": "0001-01-01T00:00:00", "id": "R61465.2_1_A61465.2_2022-12-12T23:21:29.006Z", "modifiedDate": "2023-03-02T09:50:43", "paymentProvider": "Checkout.com", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "type": "Unknown"}], "serviceCharges": [], "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 10, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 0.91}], "totalResults": 24} + Mollie: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/a68cb447-182d-4bbe-be1a-f526d11d69d5/connections/dfbf847b-cde8-4b00-b2f9-af51dec0d337/data/commerce-orders?page=1&pageSize=2"}, "self": {"href": "/companies/a68cb447-182d-4bbe-be1a-f526d11d69d5/connections/dfbf847b-cde8-4b00-b2f9-af51dec0d337/data/commerce-orders"}}, "pageNumber": 1, "pageSize": 2, "results": [{"closedDate": "2022-10-23T00:00:00Z", "country": "NLD", "createdDate": "2022-01-20T09:28:32", "currency": "EUR", "customerRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "id": "ord_2at3ck", "locationRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "modifiedDate": "2022-03-17T15:47:28Z", "orderLineItems": [{"discountAllocations": [], "id": "odl_1.3tvc32", "productRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "productVariantRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "quantity": 1, "taxPercentage": 21, "taxes": [], "totalAmount": 329.99, "totalTaxAmount": 57.27, "unitPrice": 329.99}, {"discountAllocations": [{"name": "Discount", "totalAmount": 100}], "id": "odl_1.x95vuk", "productRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "productVariantRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "quantity": 2, "taxPercentage": 21, "taxes": [], "totalAmount": 698, "totalTaxAmount": 121.14, "unitPrice": 399}], "orderNumber": "1337", "payments": [{"amount": 1027.99, "createdDate": "2022-02-08T15:44:22", "currency": "EUR", "dueDate": "0001-01-01T00:00:00", "id": "tr_GpHuaqHrca", "modifiedDate": "2022-03-17T15:47:28", "paymentProvider": "SagePay", "sourceModifiedDate": "2022-02-08T16:02:02", "status": "Failed", "type": "OnlineCard"}, {"amount": 1027.99, "createdDate": "2022-01-20T09:28:32", "currency": "EUR", "dueDate": "0001-01-01T00:00:00", "id": "tr_w7RGQc3k3V", "modifiedDate": "2022-03-17T15:47:28", "paymentProvider": "SagePay", "sourceModifiedDate": "2022-01-20T09:46:02", "status": "Failed", "type": "OnlineCard"}], "serviceCharges": [], "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 1027.99, "totalDiscount": 100, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 178.41}], "totalResults": 1} + Mollie Test: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b978f9fe-8d63-4cfc-b2c2-b61b72e22785/connections/d564f8fd-0766-4ab8-a427-7c893f9b9ff6/data/commerce-orders?page=1&pageSize=2"}, "self": {"href": "/companies/b978f9fe-8d63-4cfc-b2c2-b61b72e22785/connections/d564f8fd-0766-4ab8-a427-7c893f9b9ff6/data/commerce-orders"}}, "pageNumber": 1, "pageSize": 2, "results": [{"closedDate": "2022-10-23T00:00:00Z", "country": "NLD", "createdDate": "2022-01-20T09:28:32", "currency": "EUR", "customerRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "id": "ord_2at3ck", "locationRef": {"id": "EILBDVJVNUAGVKRQ"}, "modifiedDate": "2022-08-17T11:33:19Z", "orderLineItems": [{"discountAllocations": [{"name": "Discount", "totalAmount": 100}], "id": "odl_1.x95vuk", "productRef": {"id": "7110701885"}, "productVariantRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "quantity": 2, "taxPercentage": 21, "taxes": [], "totalAmount": 698, "totalTaxAmount": 121.14, "unitPrice": 338.43}, {"discountAllocations": [], "id": "odl_1.3tvc32", "productRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "productVariantRef": {"id": "EILBDVJVNUAGVKRQ"}, "quantity": 1, "taxPercentage": 21, "taxes": [], "totalAmount": 329.99, "totalTaxAmount": 57.27, "unitPrice": 272.72}], "orderNumber": "1337", "payments": [{"amount": 0, "createdDate": "2022-10-23T00:00:00Z", "currency": "EUR", "dueDate": "2022-10-23T00:00:00Z", "id": "tr_GpHuaqHrca", "modifiedDate": "2022-10-23T00:00:00Z", "paymentProvider": "SagePay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "type": "Cash"}, {"amount": 194.12, "createdDate": "2022-10-23T00:00:00Z", "currency": "USD", "dueDate": "2022-10-23T00:00:00Z", "id": "tr_w7RGQc3k3V", "modifiedDate": "2022-10-23T00:00:00Z", "paymentProvider": "SagePay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "type": "Cash"}], "serviceCharges": [], "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 1027.99, "totalDiscount": 100, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 178.41}], "totalResults": 1} + Partner Commerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/4342cb7d-d7b1-492f-851e-4aa5084933c1/connections/9e5422fa-f03f-4d58-bcf4-161b574ab350/data/commerce-orders?page=1&pageSize=2"}, "self": {"href": "/companies/4342cb7d-d7b1-492f-851e-4aa5084933c1/connections/9e5422fa-f03f-4d58-bcf4-161b574ab350/data/commerce-orders"}}, "pageNumber": 1, "pageSize": 2, "results": [{"closedDate": "2022-10-23T00:00:00Z", "country": "GM ", "createdDate": "2021-02-10T01:37:23", "currency": "CAD", "customerRef": {"id": "0dc0206d-f22f-48c9-a4e5-79f8383c3426"}, "id": "6d135134-2f77-45f7-af3d-ee873e42da45", "locationRef": {"id": "d84a8ce0-d7e4-400a-b07a-d4bddd9c1873"}, "modifiedDate": "2022-05-12T07:22:02Z", "orderLineItems": [{"discountAllocations": [{"name": "Discount", "totalAmount": 8.54}, {"name": "Discount", "totalAmount": 17.09}], "id": "89f5e83a-c87d-4b60-a009-0ea9065867aa", "productRef": {"id": "98ef828e-33e1-4c23-9383-a029f1d6a3a6"}, "productVariantRef": {"id": "dffcd99e-13bb-4b89-89ef-719b3b0777e6"}, "quantity": 3, "taxPercentage": 20, "taxes": [], "totalAmount": 85.44, "totalTaxAmount": 17.09, "unitPrice": 28.48}, {"discountAllocations": [], "id": "4c65f0d9-05c8-48eb-9c4a-1774f5073e66", "productRef": {"id": "561f8efb-3429-4c1f-a014-1fa595f9b3c6"}, "productVariantRef": {"id": "e0715a7a-0179-4a2e-b40d-800fd2f36764"}, "quantity": 3, "taxPercentage": 20, "taxes": [], "totalAmount": 118.38, "totalTaxAmount": 23.68, "unitPrice": 39.46}], "orderNumber": "93128704", "payments": [{"amount": 0, "createdDate": "2022-10-23T00:00:00Z", "currency": "EUR", "dueDate": "2022-10-23T00:00:00Z", "id": "3ec3d4c4-8003-4f77-a44e-08b3e17057bf", "modifiedDate": "2022-10-23T00:00:00Z", "paymentProvider": "SagePay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "type": "Cash"}], "serviceCharges": [], "sourceModifiedDate": "2021-02-10T01:37:23", "totalAmount": 203.82, "totalDiscount": 25.63, "totalGratuity": 80.81, "totalRefund": 0, "totalTaxAmount": 40.77}], "totalResults": 1} + PrestaShop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/2bf78e61-58ca-421a-a430-5dfa59cf15b0/connections/30774c1f-fdcd-491e-9e60-47e316b3ab9b/data/commerce-orders?page=1&pageSize=2"}, "next": {"href": "/companies/2bf78e61-58ca-421a-a430-5dfa59cf15b0/connections/30774c1f-fdcd-491e-9e60-47e316b3ab9b/data/commerce-orders?page=2&pageSize=2"}, "self": {"href": "/companies/2bf78e61-58ca-421a-a430-5dfa59cf15b0/connections/30774c1f-fdcd-491e-9e60-47e316b3ab9b/data/commerce-orders"}}, "pageNumber": 1, "pageSize": 2, "results": [{"closedDate": "2022-10-23T00:00:00Z", "country": "US ", "createdDate": "2021-09-02T06:00:54", "currency": "USD", "customerRef": {"id": "1", "name": "John DOE"}, "id": "1", "locationRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "modifiedDate": "2022-01-26T15:09:42Z", "orderLineItems": [{"discountAllocations": [], "id": "1", "productRef": {"id": "1", "name": "Hummingbird printed t-shirt"}, "productVariantRef": {"id": "EILBDVJVNUAGVKRQ"}, "quantity": 1, "taxPercentage": 0, "taxes": [], "totalAmount": 23.9, "totalTaxAmount": 0, "unitPrice": 23.9}, {"discountAllocations": [], "id": "2", "productRef": {"id": "2", "name": "Hummingbird printed sweater"}, "productVariantRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "quantity": 1, "taxPercentage": 0, "taxes": [], "totalAmount": 35.9, "totalTaxAmount": 0, "unitPrice": 35.9}], "orderNumber": "XKBKNABJK", "payments": [], "serviceCharges": [{"description": "Shipping", "quantity": 1, "taxAmount": 0, "taxPercentage": 0, "taxes": [], "totalAmount": 2, "type": "Shipping"}], "sourceModifiedDate": "2021-09-02T06:00:54", "totalAmount": 61.8, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 0}, {"closedDate": "2022-10-23T00:00:00Z", "country": "US ", "createdDate": "2021-09-28T08:09:46", "currency": "USD", "customerRef": {"id": "5", "name": "Tobi Yinusa"}, "id": "10", "locationRef": {"id": "7110701885"}, "modifiedDate": "2022-01-26T15:09:42Z", "orderLineItems": [{"discountAllocations": [{"name": "20% Discount", "totalAmount": 4.78}], "id": "14", "productRef": {"id": "1", "name": "Hummingbird printed t-shirt"}, "productVariantRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "quantity": 1, "taxPercentage": 0, "taxes": [], "totalAmount": 19.12, "totalTaxAmount": 0, "unitPrice": 23.9}], "orderNumber": "UFQZXPGQU", "payments": [], "serviceCharges": [], "sourceModifiedDate": "2021-09-28T08:09:46", "totalAmount": 19.12, "totalDiscount": 4.78, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 0}], "totalResults": 10} + Shopify: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-orders?page=1&pageSize=2"}, "next": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-orders?page=2&pageSize=2"}, "self": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-orders"}}, "pageNumber": 1, "pageSize": 2, "results": [{"closedDate": "2022-10-23T00:00:00Z", "country": "XXX", "createdDate": "2021-03-19T13:18:33", "currency": "GBP", "customerRef": {"id": "5097398534302", "name": "Qa Test"}, "id": "3684119445662", "locationRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "modifiedDate": "2023-02-10T15:18:24Z", "orderLineItems": [{"discountAllocations": [], "id": "9670458146974", "productRef": {"id": "6595494117534", "name": "Monitor"}, "productVariantRef": {"id": "39444526694558", "name": "Monitor"}, "quantity": 4, "taxPercentage": 0, "taxes": [], "totalAmount": 600, "totalTaxAmount": 0, "unitPrice": 150}], "orderNumber": "1007", "payments": [{"amount": 600, "createdDate": "2021-03-19T13:17:49", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "4630233579678", "modifiedDate": "2023-02-10T15:18:24", "paymentProvider": "Shopify Payments", "sourceModifiedDate": "2021-03-19T13:17:49", "status": "Failed", "type": "OnlineCard"}, {"amount": 600, "createdDate": "2021-03-19T13:18:29", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "4630234497182", "modifiedDate": "2023-02-10T15:18:24", "paymentProvider": "Shopify Payments", "sourceModifiedDate": "2021-03-19T13:18:29", "status": "Paid", "type": "OnlineCard"}], "serviceCharges": [], "sourceModifiedDate": "2022-08-01T13:12:35", "totalAmount": 600, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 0}, {"closedDate": "2022-10-23T00:00:00Z", "country": "XXX", "createdDate": "2021-03-19T13:57:30", "currency": "GBP", "customerRef": {"id": "5097398534302", "name": "Qa Test"}, "id": "3684180361374", "locationRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "modifiedDate": "2023-02-10T15:18:24Z", "orderLineItems": [{"discountAllocations": [], "id": "9670570901662", "productRef": {"id": "6595497787550", "name": "Keyboard"}, "productVariantRef": {"id": "39444537213086", "name": "Keyboard"}, "quantity": 3, "taxPercentage": 0, "taxes": [], "totalAmount": 105, "totalTaxAmount": 0, "unitPrice": 35}], "orderNumber": "1011", "payments": [{"amount": 105, "createdDate": "2021-03-19T13:57:30", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "4630311108766", "modifiedDate": "2023-02-10T15:18:24", "paymentProvider": "Manual", "sourceModifiedDate": "2021-03-19T13:57:30", "status": "Paid", "type": "Unknown"}], "serviceCharges": [], "sourceModifiedDate": "2022-08-01T13:12:35", "totalAmount": 105, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 0}], "totalResults": 30} + Square: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d779fc82-a098-4107-a9fc-c2a1dda3d522/connections/9b098b74-3770-4dad-9001-4c283a39f1e5/data/commerce-orders?page=1&pageSize=2"}, "self": {"href": "/companies/d779fc82-a098-4107-a9fc-c2a1dda3d522/connections/9b098b74-3770-4dad-9001-4c283a39f1e5/data/commerce-orders"}}, "pageNumber": 1, "pageSize": 2, "results": [{"closedDate": "0001-01-01T00:00:00", "country": "GB ", "createdDate": "2021-02-14T19:38:28Z", "currency": "GBP", "customerRef": {"id": "7110701885"}, "id": "BDYNvtIYyWClkTjnh99CFR3fPwKZY", "locationRef": {"id": "D8DVHD1G6NT2J", "name": "Codat Limited"}, "modifiedDate": "2022-08-02T10:27:33Z", "orderLineItems": [{"discountAllocations": [], "id": "lLJpgArKQbBEn9nTvLRHP", "productRef": {"id": "EILBDVJVNUAGVKRQ"}, "productVariantRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "quantity": 1, "taxPercentage": 0, "taxes": [], "totalAmount": 50, "totalTaxAmount": 0, "unitPrice": 50}], "orderNumber": "BDYNvtIYyWClkTjnh99CFR3fPwKZY", "payments": [], "serviceCharges": [], "sourceModifiedDate": "2021-02-14T19:38:28Z", "totalAmount": 50, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 0}], "totalResults": 1} + SumUp: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/e170dbe2-be50-474f-b449-82add37108de/connections/1e631dd5-a30b-4bad-ad5c-315c9743535b/data/commerce-orders?page=1&pageSize=2"}, "next": {"href": "/companies/e170dbe2-be50-474f-b449-82add37108de/connections/1e631dd5-a30b-4bad-ad5c-315c9743535b/data/commerce-orders?page=2&pageSize=2"}, "self": {"href": "/companies/e170dbe2-be50-474f-b449-82add37108de/connections/1e631dd5-a30b-4bad-ad5c-315c9743535b/data/commerce-orders"}}, "pageNumber": 1, "pageSize": 2, "results": [{"closedDate": "2022-10-23T00:00:00Z", "country": "XXX", "createdDate": "2021-03-30T12:20:40Z", "currency": "GBP", "customerRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "id": "07efcdd0-7f61-4d82-957f-52e8f0bd3f89", "locationRef": {"id": "7110701885"}, "modifiedDate": "2022-09-14T10:58:04Z", "orderLineItems": [{"discountAllocations": [], "id": "Product undefined by SumUp", "productRef": {"id": "7110701885"}, "productVariantRef": {"id": "EILBDVJVNUAGVKRQ"}, "quantity": 1, "taxPercentage": 0, "taxes": [], "totalAmount": 200, "totalTaxAmount": 0, "unitPrice": 200}], "orderNumber": "TECXTU2KT6", "payments": [{"amount": 0, "createdDate": "2022-10-23T00:00:00Z", "currency": "GBP", "dueDate": "2022-10-23T00:00:00Z", "id": "07efcdd0-7f61-4d82-957f-52e8f0bd3f89", "modifiedDate": "2022-10-23T00:00:00Z", "paymentProvider": "SagePay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "type": "Cash"}], "serviceCharges": [], "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 200, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 0}, {"closedDate": "2022-10-23T00:00:00Z", "country": "XXX", "createdDate": "2021-03-26T21:09:59Z", "currency": "GBP", "customerRef": {"id": "EILBDVJVNUAGVKRQ"}, "id": "46d36a64-ea48-4e37-9340-3548cbf3ca2f", "locationRef": {"id": "EILBDVJVNUAGVKRQ"}, "modifiedDate": "2022-09-14T10:58:04Z", "orderLineItems": [{"discountAllocations": [], "id": "Sale of some product", "productRef": {"id": "EILBDVJVNUAGVKRQ"}, "productVariantRef": {"id": "EILBDVJVNUAGVKRQ"}, "quantity": 1, "taxPercentage": 0, "taxes": [], "totalAmount": 15, "totalTaxAmount": 0, "unitPrice": 15}], "orderNumber": "TNEU7333HZ", "payments": [{"amount": 0, "createdDate": "2022-10-23T00:00:00Z", "currency": "GBP", "dueDate": "2022-10-23T00:00:00Z", "id": "46d36a64-ea48-4e37-9340-3548cbf3ca2f", "modifiedDate": "2022-10-23T00:00:00Z", "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "type": "Cash"}], "serviceCharges": [], "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 15, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 0}], "totalResults": 6} + WooCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/00396b78-7113-4b1f-996f-4c561b00573a/connections/b39ed7d6-5eda-44c5-85bb-647d03edd649/data/commerce-orders?page=1&pageSize=2"}, "next": {"href": "/companies/00396b78-7113-4b1f-996f-4c561b00573a/connections/b39ed7d6-5eda-44c5-85bb-647d03edd649/data/commerce-orders?page=2&pageSize=2"}, "self": {"href": "/companies/00396b78-7113-4b1f-996f-4c561b00573a/connections/b39ed7d6-5eda-44c5-85bb-647d03edd649/data/commerce-orders"}}, "pageNumber": 1, "pageSize": 2, "results": [{"closedDate": "2022-10-23T00:00:00Z", "country": "GB ", "createdDate": "2021-03-27T23:29:38Z", "currency": "GBP", "customerRef": {"id": "200585744"}, "id": "111", "locationRef": {"id": "EILBDVJVNUAGVKRQ"}, "modifiedDate": "2022-07-11T15:35:48Z", "orderLineItems": [{"discountAllocations": [], "id": "53", "productRef": {"id": "82"}, "productVariantRef": {"id": "EILBDVJVNUAGVKRQ"}, "quantity": 2, "taxPercentage": 20, "taxes": [], "totalAmount": 12, "totalTaxAmount": 2, "unitPrice": 5}, {"discountAllocations": [], "id": "54", "productRef": {"id": "81"}, "productVariantRef": {"id": "7110701885"}, "quantity": 2, "taxPercentage": 20, "taxes": [], "totalAmount": 24, "totalTaxAmount": 4, "unitPrice": 10}], "orderNumber": "111", "payments": [], "serviceCharges": [{"description": "Royal Mail", "quantity": 1, "taxAmount": 0, "taxPercentage": 0, "taxes": [], "totalAmount": 3.5, "type": "Shipping"}], "sourceModifiedDate": "2021-04-01T13:34:59Z", "totalAmount": 39.5, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 6}, {"closedDate": "2022-10-23T00:00:00Z", "country": "GB ", "createdDate": "2021-09-24T12:15:29Z", "currency": "GBP", "customerRef": {"id": "EILBDVJVNUAGVKRQ"}, "id": "145", "locationRef": {"id": "7110701885"}, "modifiedDate": "2022-07-11T15:35:48Z", "orderLineItems": [{"discountAllocations": [], "id": "59", "productRef": {"id": "87"}, "productVariantRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "quantity": 2, "taxPercentage": 25, "taxes": [], "totalAmount": 27.5, "totalTaxAmount": 5.5, "unitPrice": 11}], "orderNumber": "145", "payments": [], "serviceCharges": [], "sourceModifiedDate": "2022-03-24T16:01:23Z", "totalAmount": 27.5, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 5.5}], "totalResults": 25} + Zettle: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/9d448ad0-4508-47fc-bd3b-6950493151f1/connections/c7baa8da-3302-464b-8aa1-edcd4c900902/data/commerce-orders?page=1&pageSize=2"}, "next": {"href": "/companies/9d448ad0-4508-47fc-bd3b-6950493151f1/connections/c7baa8da-3302-464b-8aa1-edcd4c900902/data/commerce-orders?page=2&pageSize=2"}, "self": {"href": "/companies/9d448ad0-4508-47fc-bd3b-6950493151f1/connections/c7baa8da-3302-464b-8aa1-edcd4c900902/data/commerce-orders"}}, "pageNumber": 1, "pageSize": 2, "results": [{"closedDate": "2022-10-23T00:00:00Z", "country": "GB ", "createdDate": "2020-11-23T14:27:20Z", "currency": "GBP", "customerRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2"}, "id": "7TunRi2XEeueVK3fSQEQIw", "locationRef": {"id": "EILBDVJVNUAGVKRQ"}, "modifiedDate": "2021-10-27T15:22:37Z", "orderLineItems": [{"discountAllocations": [], "id": "0", "productRef": {"id": "7f9f31e4-2d97-11eb-9f55-acde48001122"}, "productVariantRef": {"id": "7f9f35ea-2d97-11eb-9f55-acde48001122"}, "quantity": 1, "taxPercentage": 0, "taxes": [], "totalAmount": 45, "totalTaxAmount": 0, "unitPrice": 45}], "orderNumber": "3", "payments": [{"amount": 45, "createdDate": "2020-11-23T14:27:19", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "ed97bcde-2d97-11eb-a42e-25130f2dd258", "modifiedDate": "2021-10-27T15:22:37", "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown", "type": "Paypal"}], "serviceCharges": [], "sourceModifiedDate": "2020-11-23T14:27:20Z", "totalAmount": 45, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 0}, {"closedDate": "2022-10-23T00:00:00Z", "country": "GB ", "createdDate": "2020-11-23T14:28:05Z", "currency": "GBP", "customerRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "id": "CV5TJC2YEeueVK3fSQEQIw", "locationRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab"}, "modifiedDate": "2021-10-27T15:22:37Z", "orderLineItems": [{"discountAllocations": [], "id": "0", "productRef": {"id": "89570bee-2d97-11eb-9f55-acde48001122"}, "productVariantRef": {"id": "89570c52-2d97-11eb-9f55-acde48001122"}, "quantity": 1, "taxPercentage": 5, "taxes": [], "totalAmount": 25, "totalTaxAmount": 1.19, "unitPrice": 23.81}], "orderNumber": "4", "payments": [{"amount": 25, "createdDate": "2020-11-23T14:28:04", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "09b94cfc-2d98-11eb-8021-0e1b9dcbeca1", "modifiedDate": "2021-10-27T15:22:37", "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown", "type": "Paypal"}], "serviceCharges": [], "sourceModifiedDate": "2020-11-23T14:28:05Z", "totalAmount": 25, "totalDiscount": 0, "totalGratuity": 0, "totalRefund": 0, "totalTaxAmount": 1.19}], "totalResults": 6} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-commerce-payment-method: + Amazon Seller Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentMethodId: "" + responses: + "200": + application/json: {"id": "COD", "modifiedDate": "2023-01-09T09:12:03Z", "name": "Cash On Delivery", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"} + BigCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentMethodId: "" + responses: + "200": + application/json: {"id": "bigcommerce_gift_certificate", "modifiedDate": "2023-04-11T10:33:48Z", "name": "Gift Certificate", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"} + Clover: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentMethodId: "" + responses: + "200": + application/json: {"id": "0DPQ6QP48YYHW", "modifiedDate": "2023-01-09T11:01:04Z", "name": "TapMango Wallet", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"} + Lightspeed K Trial: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentMethodId: "" + responses: + "200": + application/json: {"id": "647208621834260", "modifiedDate": "2023-03-02T09:48:56Z", "name": "Cash", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"} + Mollie: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentMethodId: "" + responses: + "200": + application/json: {"id": "applepay", "modifiedDate": "2022-08-09T15:08:19Z", "name": "Apple Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown"} + Mollie Test: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentMethodId: "" + responses: + "200": + application/json: {"id": "applepay", "modifiedDate": "2022-08-17T11:33:19Z", "name": "Apple Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown"} + Square: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentMethodId: "" + responses: + "200": + application/json: {"id": "BANK_ACCOUNT", "modifiedDate": "2022-08-02T10:27:32Z", "name": "Bank Account", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown"} + SumUp: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentMethodId: "" + responses: + "200": + application/json: {"id": "CASH", "modifiedDate": "2022-09-14T10:58:03Z", "name": "Cash", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentMethodId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-commerce-payment-methods: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Amazon Seller Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/6a59da96-e6d2-4c5c-ace7-65ba8be6a472/connections/58be1638-2c74-4ad4-8ff3-8c5b98b5f0fe/data/commerce-paymentMethods?page=1&pageSize=2"}, "next": {"href": "/companies/6a59da96-e6d2-4c5c-ace7-65ba8be6a472/connections/58be1638-2c74-4ad4-8ff3-8c5b98b5f0fe/data/commerce-paymentMethods?page=2&pageSize=2"}, "self": {"href": "/companies/6a59da96-e6d2-4c5c-ace7-65ba8be6a472/connections/58be1638-2c74-4ad4-8ff3-8c5b98b5f0fe/data/commerce-paymentMethods"}}, "pageNumber": 1, "pageSize": 2, "results": [{"id": "COD", "modifiedDate": "2023-01-09T09:12:03Z", "name": "Cash On Delivery", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"id": "GC", "modifiedDate": "2023-01-09T09:12:03Z", "name": "Gift Card", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 3} + BigCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d1ebcf6d-f7f9-4841-8a06-fec12c492a48/connections/7c0a21e8-938a-40a4-b0f7-5ab5d46804b0/data/commerce-paymentMethods?page=1&pageSize=2"}, "self": {"href": "/companies/d1ebcf6d-f7f9-4841-8a06-fec12c492a48/connections/7c0a21e8-938a-40a4-b0f7-5ab5d46804b0/data/commerce-paymentMethods"}}, "pageNumber": 1, "pageSize": 2, "results": [{"id": "bigcommerce_gift_certificate", "modifiedDate": "2023-04-11T10:33:48Z", "name": "Gift Certificate", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"id": "bigcommerce_store_credit", "modifiedDate": "2023-04-11T10:33:48Z", "name": "Store Credit", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 2} + Clover: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/aae80eb3-1f56-41ca-a171-a59f9ee03b26/connections/4a5b633b-cd86-4715-a22b-62be98c4bcc5/data/commerce-paymentMethods?page=1&pageSize=2"}, "next": {"href": "/companies/aae80eb3-1f56-41ca-a171-a59f9ee03b26/connections/4a5b633b-cd86-4715-a22b-62be98c4bcc5/data/commerce-paymentMethods?page=2&pageSize=2"}, "self": {"href": "/companies/aae80eb3-1f56-41ca-a171-a59f9ee03b26/connections/4a5b633b-cd86-4715-a22b-62be98c4bcc5/data/commerce-paymentMethods"}}, "pageNumber": 1, "pageSize": 2, "results": [{"id": "0DPQ6QP48YYHW", "modifiedDate": "2023-01-09T11:01:04Z", "name": "TapMango Wallet", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"id": "24H1ANYP1BNXG", "modifiedDate": "2023-01-09T11:01:04Z", "name": "MyTab", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 13} + Lightspeed K Trial: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-paymentMethods?page=1&pageSize=2"}, "next": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-paymentMethods?page=2&pageSize=2"}, "self": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-paymentMethods"}}, "pageNumber": 1, "pageSize": 2, "results": [{"id": "647208621834260", "modifiedDate": "2023-03-02T09:48:56Z", "name": "Cash", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"id": "647208621834261", "modifiedDate": "2023-03-02T09:48:56Z", "name": "Credit Card", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 11} + Mollie: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/a2503b54-143c-4705-8bec-9ef84f51ca86/connections/4c8df852-f1b3-4642-939b-c33d6f34a312/data/commerce-paymentMethods?page=1&pageSize=2"}, "next": {"href": "/companies/a2503b54-143c-4705-8bec-9ef84f51ca86/connections/4c8df852-f1b3-4642-939b-c33d6f34a312/data/commerce-paymentMethods?page=2&pageSize=2"}, "self": {"href": "/companies/a2503b54-143c-4705-8bec-9ef84f51ca86/connections/4c8df852-f1b3-4642-939b-c33d6f34a312/data/commerce-paymentMethods"}}, "pageNumber": 1, "pageSize": 2, "results": [{"id": "applepay", "modifiedDate": "2022-08-09T15:08:19Z", "name": "Apple Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown"}, {"id": "bancontact", "modifiedDate": "2022-08-09T15:08:19Z", "name": "Bancontact", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown"}], "totalResults": 19} + Mollie Test: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b978f9fe-8d63-4cfc-b2c2-b61b72e22785/connections/d564f8fd-0766-4ab8-a427-7c893f9b9ff6/data/commerce-paymentMethods?page=1&pageSize=2"}, "next": {"href": "/companies/b978f9fe-8d63-4cfc-b2c2-b61b72e22785/connections/d564f8fd-0766-4ab8-a427-7c893f9b9ff6/data/commerce-paymentMethods?page=2&pageSize=2"}, "self": {"href": "/companies/b978f9fe-8d63-4cfc-b2c2-b61b72e22785/connections/d564f8fd-0766-4ab8-a427-7c893f9b9ff6/data/commerce-paymentMethods"}}, "pageNumber": 1, "pageSize": 2, "results": [{"id": "applepay", "modifiedDate": "2022-08-17T11:33:19Z", "name": "Apple Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown"}, {"id": "bancontact", "modifiedDate": "2022-08-17T11:33:19Z", "name": "Bancontact", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown"}], "totalResults": 19} + Square: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d779fc82-a098-4107-a9fc-c2a1dda3d522/connections/9b098b74-3770-4dad-9001-4c283a39f1e5/data/commerce-paymentMethods?page=1&pageSize=2"}, "next": {"href": "/companies/d779fc82-a098-4107-a9fc-c2a1dda3d522/connections/9b098b74-3770-4dad-9001-4c283a39f1e5/data/commerce-paymentMethods?page=2&pageSize=2"}, "self": {"href": "/companies/d779fc82-a098-4107-a9fc-c2a1dda3d522/connections/9b098b74-3770-4dad-9001-4c283a39f1e5/data/commerce-paymentMethods"}}, "pageNumber": 1, "pageSize": 2, "results": [{"id": "BANK_ACCOUNT", "modifiedDate": "2022-08-02T10:27:32Z", "name": "Bank Account", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown"}, {"id": "BUY_NOW_PAY_LATER", "modifiedDate": "2022-08-02T10:27:32Z", "name": "Buy Now Pay Later", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown"}], "totalResults": 20} + SumUp: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/e170dbe2-be50-474f-b449-82add37108de/connections/1e631dd5-a30b-4bad-ad5c-315c9743535b/data/commerce-paymentMethods?page=1&pageSize=2"}, "next": {"href": "/companies/e170dbe2-be50-474f-b449-82add37108de/connections/1e631dd5-a30b-4bad-ad5c-315c9743535b/data/commerce-paymentMethods?page=2&pageSize=2"}, "self": {"href": "/companies/e170dbe2-be50-474f-b449-82add37108de/connections/1e631dd5-a30b-4bad-ad5c-315c9743535b/data/commerce-paymentMethods"}}, "pageNumber": 1, "pageSize": 2, "results": [{"id": "CASH", "modifiedDate": "2022-09-14T10:58:03Z", "name": "Cash", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"id": "CC_CUSTOMER_ENTERED", "modifiedDate": "2022-09-14T10:58:03Z", "name": "Credit Card", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 8} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-commerce-payment: + BigCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentId: "" + responses: + "200": + application/json: {"amount": -64, "createdDate": "2022-06-15T17:13:13Z", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "103_1_1_refund", "modifiedDate": "2023-04-11T10:33:52Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "bigpaypay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid"} + Clover: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentId: "" + responses: + "200": + application/json: {"amount": 1000, "createdDate": "2021-05-24T10:35:08Z", "currency": "USD", "dueDate": "0001-01-01T00:00:00", "id": "01J7HV88GT6B8", "modifiedDate": "2023-01-09T11:01:02Z", "paymentMethodRef": {"id": "BR5M17TG091SP", "name": "Credit Card"}, "paymentProvider": "clover", "sourceModifiedDate": "2021-05-24T10:35:08Z", "status": "Paid"} + Lightspeed K Trial: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentId: "" + responses: + "200": + application/json: {"amount": 0, "createdDate": "2023-01-05T03:34:50Z", "currency": "AUD", "dueDate": "0001-01-01T00:00:00", "id": "1_A62084.1_2023-01-05T03:34:50.296Z", "modifiedDate": "2023-03-02T09:50:43Z", "paymentMethodRef": {"id": "0"}, "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid"} + Mollie: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentId: "" + responses: + "200": + application/json: {"amount": -20, "createdDate": "2022-01-17T16:00:46", "currency": "EUR", "dueDate": "0001-01-01T00:00:00", "id": "re_Azhe8TzfUK", "modifiedDate": "2022-03-17T16:15:23Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "mollie", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid"} + PrestaShop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentId: "" + responses: + "200": + application/json: {"amount": 20.9, "createdDate": "2021-09-08T01:52:55", "currency": "USD", "dueDate": "0001-01-01T00:00:00", "id": "1", "modifiedDate": "2022-01-26T15:09:42Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "Checkout.com", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid"} + Shopify: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentId: "" + responses: + "200": + application/json: {"amount": 600, "createdDate": "2021-03-19T13:17:49Z", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "4630233579678", "modifiedDate": "2023-02-10T15:18:24Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "Shopify Payments", "sourceModifiedDate": "2021-03-19T13:17:49Z", "status": "Failed"} + SumUp: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentId: "" + responses: + "200": + application/json: {"amount": 200, "createdDate": "2021-03-30T12:20:40Z", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "07efcdd0-7f61-4d82-957f-52e8f0bd3f89", "modifiedDate": "2022-03-17T16:13:46Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "sumup", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Cancelled"} + WooCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentId: "" + responses: + "200": + application/json: {"amount": 0, "createdDate": "2021-03-11T09:07:00Z", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "33", "modifiedDate": "2021-07-13T16:19:00Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid"} + Zettle: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentId: "" + responses: + "200": + application/json: {"amount": 25, "createdDate": "2020-11-23T14:28:04Z", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "09b94cfc-2d98-11eb-8021-0e1b9dcbeca1", "modifiedDate": "2021-10-27T15:22:37Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "SagePay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + paymentId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-commerce-payments: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + BigCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d1ebcf6d-f7f9-4841-8a06-fec12c492a48/connections/7c0a21e8-938a-40a4-b0f7-5ab5d46804b0/data/commerce-payments?page=1&pageSize=2"}, "next": {"href": "/companies/d1ebcf6d-f7f9-4841-8a06-fec12c492a48/connections/7c0a21e8-938a-40a4-b0f7-5ab5d46804b0/data/commerce-payments?page=2&pageSize=2"}, "self": {"href": "/companies/d1ebcf6d-f7f9-4841-8a06-fec12c492a48/connections/7c0a21e8-938a-40a4-b0f7-5ab5d46804b0/data/commerce-payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amount": -64, "createdDate": "2022-06-15T17:13:13Z", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "103_1_1_refund", "modifiedDate": "2023-04-11T10:33:52Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "bigpaypay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid"}, {"amount": -33.95, "createdDate": "2022-06-24T13:57:01Z", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "105_2_2_refund", "modifiedDate": "2023-04-11T10:33:52Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "bigpaypay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid"}], "totalResults": 20} + Clover: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/aae80eb3-1f56-41ca-a171-a59f9ee03b26/connections/4a5b633b-cd86-4715-a22b-62be98c4bcc5/data/commerce-payments?page=1&pageSize=2"}, "next": {"href": "/companies/aae80eb3-1f56-41ca-a171-a59f9ee03b26/connections/4a5b633b-cd86-4715-a22b-62be98c4bcc5/data/commerce-payments?page=2&pageSize=2"}, "self": {"href": "/companies/aae80eb3-1f56-41ca-a171-a59f9ee03b26/connections/4a5b633b-cd86-4715-a22b-62be98c4bcc5/data/commerce-payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amount": 1000, "createdDate": "2021-05-24T10:35:08Z", "currency": "USD", "dueDate": "0001-01-01T00:00:00", "id": "01J7HV88GT6B8", "modifiedDate": "2023-01-09T11:01:02Z", "paymentMethodRef": {"id": "BR5M17TG091SP", "name": "Credit Card"}, "paymentProvider": "clover", "sourceModifiedDate": "2021-05-24T10:35:08Z", "status": "Paid"}, {"amount": 1000, "createdDate": "2021-05-24T10:35:31Z", "currency": "USD", "dueDate": "0001-01-01T00:00:00", "id": "0A8ZMPG40Q9AM", "modifiedDate": "2023-01-09T11:01:02Z", "paymentMethodRef": {"id": "BR5M17TG091SP", "name": "Credit Card"}, "paymentProvider": "clover", "sourceModifiedDate": "2021-05-24T10:35:31Z", "status": "Paid"}], "totalResults": 77} + Lightspeed K Trial: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-payments?page=1&pageSize=2"}, "next": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-payments?page=2&pageSize=2"}, "self": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amount": 0, "createdDate": "2023-01-05T03:34:50Z", "currency": "AUD", "dueDate": "0001-01-01T00:00:00", "id": "1_A62084.1_2023-01-05T03:34:50.296Z", "modifiedDate": "2023-03-02T09:50:43Z", "paymentMethodRef": {"id": "0"}, "paymentProvider": "Checkout.com", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid"}, {"amount": 5, "createdDate": "2022-12-09T02:27:46Z", "currency": "AUD", "dueDate": "0001-01-01T00:00:00", "id": "R61465.1_1_A61465.1_2022-12-09T02:27:46.273Z", "modifiedDate": "2023-03-02T09:50:43Z", "paymentMethodRef": {"id": "647208621834714", "name": "LSPay - Mary"}, "paymentProvider": "SagePay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid"}], "totalResults": 26} + Mollie: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/65fe5864-16d7-41f4-8823-87ae1cf3a283/connections/1dbbf0ab-a27a-45b0-982a-ae0d8985affc/data/commerce-payments?page=1&pageSize=2"}, "next": {"href": "/companies/65fe5864-16d7-41f4-8823-87ae1cf3a283/connections/1dbbf0ab-a27a-45b0-982a-ae0d8985affc/data/commerce-payments?page=2&pageSize=2"}, "self": {"href": "/companies/65fe5864-16d7-41f4-8823-87ae1cf3a283/connections/1dbbf0ab-a27a-45b0-982a-ae0d8985affc/data/commerce-payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amount": -20, "createdDate": "2022-01-17T16:00:46", "currency": "EUR", "dueDate": "0001-01-01T00:00:00", "id": "re_Azhe8TzfUK", "modifiedDate": "2022-03-17T16:15:23Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "mollie", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid"}, {"amount": -60, "createdDate": "2022-01-17T16:00:05", "currency": "EUR", "dueDate": "0001-01-01T00:00:00", "id": "re_NPKEJhQveu", "modifiedDate": "2022-03-17T16:15:23Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "mollie", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid"}], "totalResults": 16} + PrestaShop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/2bf78e61-58ca-421a-a430-5dfa59cf15b0/connections/30774c1f-fdcd-491e-9e60-47e316b3ab9b/data/commerce-payments?page=1&pageSize=2"}, "next": {"href": "/companies/2bf78e61-58ca-421a-a430-5dfa59cf15b0/connections/30774c1f-fdcd-491e-9e60-47e316b3ab9b/data/commerce-payments?page=2&pageSize=2"}, "self": {"href": "/companies/2bf78e61-58ca-421a-a430-5dfa59cf15b0/connections/30774c1f-fdcd-491e-9e60-47e316b3ab9b/data/commerce-payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amount": 20.9, "createdDate": "2021-09-08T01:52:55", "currency": "USD", "dueDate": "0001-01-01T00:00:00", "id": "1", "modifiedDate": "2022-01-26T15:09:42Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid"}, {"amount": 20.9, "createdDate": "2021-09-08T01:53:28", "currency": "USD", "dueDate": "0001-01-01T00:00:00", "id": "2", "modifiedDate": "2022-01-26T15:09:42Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid"}], "totalResults": 5} + Shopify: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-payments?page=1&pageSize=2"}, "next": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-payments?page=2&pageSize=2"}, "self": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amount": 600, "createdDate": "2021-03-19T13:17:49Z", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "4630233579678", "modifiedDate": "2023-02-10T15:18:24Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "Shopify Payments", "sourceModifiedDate": "2021-03-19T13:17:49Z", "status": "Failed"}, {"amount": 600, "createdDate": "2021-03-19T13:18:29Z", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "4630234497182", "modifiedDate": "2023-02-10T15:18:24Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "Shopify Payments", "sourceModifiedDate": "2021-03-19T13:18:29Z", "status": "Paid"}], "totalResults": 46} + SumUp: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d9e78460-7ee5-4a34-a3f4-9652a5946b1f/connections/60959ebe-8491-4368-bf0a-f715c3ce2e53/data/commerce-payments?page=1&pageSize=2"}, "next": {"href": "/companies/d9e78460-7ee5-4a34-a3f4-9652a5946b1f/connections/60959ebe-8491-4368-bf0a-f715c3ce2e53/data/commerce-payments?page=2&pageSize=2"}, "self": {"href": "/companies/d9e78460-7ee5-4a34-a3f4-9652a5946b1f/connections/60959ebe-8491-4368-bf0a-f715c3ce2e53/data/commerce-payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amount": 200, "createdDate": "2021-03-30T12:20:40Z", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "07efcdd0-7f61-4d82-957f-52e8f0bd3f89", "modifiedDate": "2022-03-17T16:13:46Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "sumup", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Cancelled"}, {"amount": 15, "createdDate": "2021-03-26T21:09:59Z", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "46d36a64-ea48-4e37-9340-3548cbf3ca2f", "modifiedDate": "2022-03-17T16:13:46Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "sumup", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid"}], "totalResults": 6} + WooCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/010c6f53-8fc8-40ab-9ed5-41191cf9c6b5/connections/7545ca2e-5f58-4f98-8af2-3b2c38bb8074/data/commerce-payments?page=1&pageSize=2"}, "next": {"href": "/companies/010c6f53-8fc8-40ab-9ed5-41191cf9c6b5/connections/7545ca2e-5f58-4f98-8af2-3b2c38bb8074/data/commerce-payments?page=2&pageSize=2"}, "self": {"href": "/companies/010c6f53-8fc8-40ab-9ed5-41191cf9c6b5/connections/7545ca2e-5f58-4f98-8af2-3b2c38bb8074/data/commerce-payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amount": 0, "createdDate": "2021-03-11T09:07:00Z", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "33", "modifiedDate": "2021-07-13T16:19:00Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "Checkout.com", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid"}, {"amount": 30, "createdDate": "2021-03-11T09:08:56Z", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "35", "modifiedDate": "2021-07-13T16:19:00Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid"}], "totalResults": 5} + Zettle: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/9d448ad0-4508-47fc-bd3b-6950493151f1/connections/c7baa8da-3302-464b-8aa1-edcd4c900902/data/commerce-payments?page=1&pageSize=2"}, "next": {"href": "/companies/9d448ad0-4508-47fc-bd3b-6950493151f1/connections/c7baa8da-3302-464b-8aa1-edcd4c900902/data/commerce-payments?page=2&pageSize=2"}, "self": {"href": "/companies/9d448ad0-4508-47fc-bd3b-6950493151f1/connections/c7baa8da-3302-464b-8aa1-edcd4c900902/data/commerce-payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amount": 25, "createdDate": "2020-11-23T14:28:04Z", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "09b94cfc-2d98-11eb-8021-0e1b9dcbeca1", "modifiedDate": "2021-10-27T15:22:37Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "SagePay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown"}, {"amount": 58.5, "createdDate": "2020-11-23T14:28:47Z", "currency": "GBP", "dueDate": "0001-01-01T00:00:00", "id": "226580d6-2d98-11eb-a35c-fed5e63de507", "modifiedDate": "2021-10-27T15:22:37Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "paymentProvider": "Amazon Pay", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown"}], "totalResults": 8} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-commerce-product-category: + Lightspeed K Trial: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + productId: "" + responses: + "200": + application/json: {"ancestorRefs": [], "hasChildren": false, "id": "647208621834281", "modifiedDate": "2023-03-02T09:49:11Z", "name": "Alcoholic beverages", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + productId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-commerce-product-categories: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"ancestorRefs": [], "id": "\"102\"", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Entertainment", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "totalResults": 1} + "400": {} + Lightspeed K Trial: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-productCategories?page=1&pageSize=2"}, "next": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-productCategories?page=2&pageSize=2"}, "self": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-productCategories"}}, "pageNumber": 1, "pageSize": 2, "results": [{"ancestorRefs": [], "hasChildren": false, "id": "647208621834281", "modifiedDate": "2023-03-02T09:49:11Z", "name": "Alcoholic beverages", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"ancestorRefs": [], "hasChildren": false, "id": "647208621834282", "modifiedDate": "2023-03-02T09:49:11Z", "name": "NA beverages", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "totalResults": 8} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-commerce-product: + Amazon Seller Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + productId: "" + responses: + "200": + application/json: {"categorization": "DEVICE", "description": "Cast from your phone to your TV with this all new chromecast.", "id": "Chromecast", "isGiftCard": false, "name": "Chromecast", "variants": [{"barcode": "CSE370", "createdDate": "2021-02-07T12:30:01Z", "id": "packaging_asin_gating", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": false, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Chromecast in a cardboard box", "prices": [{"currency": "GBP", "unitPrice": 50}], "shippingRequired": false, "sku": "packaging_asin_gating", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "meters", "vatPercentage": 0}]} + BigCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + productId: "" + responses: + "200": + application/json: {"categorization": "Shop All, Utility", "description": "The last laundry cart you'll ever buy. This industrial non-collapsable cart is constructed with a steel framed body using heavyweight canvas capped with a soft leather rim sitting on four smooth rolling casters. Keeps the grubby garments off the floor and almost makes laundry enjoyable. Can also be used as the ideal storage solution: many people find it ideal for children's toys or a load of chopped firewood. Load it up and wheel it away. Natural Heavyweight Canvas with Vegetable Tanned Leather Rim Measure�", "id": "103", "isGiftCard": false, "name": "[Sample] Canvas Laundry Cart", "variants": [{"barcode": "", "createdDate": "0001-01-01T00:00:00", "id": "71", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": false, "modifiedDate": "2022-10-23T00:00:00Z", "name": "[Sample] Canvas Laundry Cart", "prices": [{"currency": "GBP", "unitPrice": 200}], "shippingRequired": true, "sku": "CLC", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 0}]} + Clover: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + productId: "" + responses: + "200": + application/json: {"categorization": "Hardware", "description": "Coffee", "id": "DJANHKK2AVEYY", "isGiftCard": false, "name": "Coffee", "variants": [{"barcode": "1234", "createdDate": "0001-01-01T00:00:00", "id": "DJANHKK2AVEYY", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Coffee", "prices": [{"currency": "GBP", "unitPrice": 3}], "shippingRequired": false, "sku": "12222", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 20}]} + Lightspeed K Trial: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + productId: "" + responses: + "200": + application/json: {"categorization": "Alcoholic beverages", "description": "Alcoholic beverages", "id": "647208621834539", "isGiftCard": false, "name": "Alcoholic beverages", "variants": []} + PrestaShop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + productId: "" + responses: + "200": + application/json: {"categorization": "Home - Clothes - Men", "description": "Symbol of lightness and delicacy, the hummingbird evokes curiosity and joy. Studio Design' PolyFaune collection features classic products with colorful patterns, inspired by the traditional japanese origamis. To wear with a chino or jeans. The sublimation textile printing process provides an exceptional color rendering and a color, guaranteed overtime.", "id": "1", "isGiftCard": false, "name": "Hummingbird printed t-shirt", "variants": [{"barcode": "CSE370", "createdDate": "0001-01-01T00:00:00", "id": "8", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Hummingbird printed t-shirt (Size = XL, Color = Black)", "prices": [{"currency": "USD", "unitPrice": 23.9}], "shippingRequired": true, "sku": "demo_1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 6}, {"barcode": "CSE370", "createdDate": "0001-01-01T00:00:00", "id": "4", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Hummingbird printed t-shirt (Size = M, Color = Black)", "prices": [{"currency": "USD", "unitPrice": 23.9}], "shippingRequired": true, "sku": "demo_1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "meters", "vatPercentage": 6}, {"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "5", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Hummingbird printed t-shirt (Size = L, Color = White)", "prices": [{"currency": "USD", "unitPrice": 23.9}], "shippingRequired": true, "sku": "demo_1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "meters", "vatPercentage": 6}, {"barcode": "CSE370", "createdDate": "0001-01-01T00:00:00", "id": "3", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Hummingbird printed t-shirt (Size = M, Color = White)", "prices": [{"currency": "USD", "unitPrice": 23.9}], "shippingRequired": true, "sku": "demo_1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 6}, {"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "6", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Hummingbird printed t-shirt (Size = L, Color = Black)", "prices": [{"currency": "USD", "unitPrice": 23.9}], "shippingRequired": true, "sku": "demo_1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 6}, {"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "1", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Hummingbird printed t-shirt (Size = S, Color = White)", "prices": [{"currency": "USD", "unitPrice": 23.9}], "shippingRequired": true, "sku": "demo_1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "meters", "vatPercentage": 6}, {"barcode": "CSE370", "createdDate": "0001-01-01T00:00:00", "id": "2", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Hummingbird printed t-shirt (Size = S, Color = Black)", "prices": [{"currency": "USD", "unitPrice": 23.9}], "shippingRequired": true, "sku": "demo_1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "meters", "vatPercentage": 6}, {"barcode": "CSE370", "createdDate": "0001-01-01T00:00:00", "id": "7", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Hummingbird printed t-shirt (Size = XL, Color = White)", "prices": [{"currency": "USD", "unitPrice": 23.9}], "shippingRequired": true, "sku": "demo_1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 6}]} + Shopify: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + productId: "" + responses: + "200": + application/json: {"categorization": "Asus", "description": "", "id": "6595494117534", "isGiftCard": false, "name": "Monitor", "variants": [{"barcode": "", "createdDate": "2021-03-19T10:13:22Z", "id": "39444526694558", "inventory": {"locations": [], "totalQuantity": 91}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Monitor", "prices": [{"currency": "GBP", "unitPrice": 150}], "shippingRequired": true, "sku": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 0}]} + Square: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + productId: "" + responses: + "200": + application/json: {"categorization": "Hardware", "description": "1tb Western Digital Hard Drive", "id": "AX54KZQ3UAVCVPUMNEGFEU35", "isGiftCard": false, "name": "Monitor", "variants": [{"barcode": "564158468416486458646886484", "createdDate": "2021-02-18T15:47:31Z", "id": "A5BUT6SYUNYRSQ2R7GZ6UKN6", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Regular", "prices": [{"currency": "GBP", "unitPrice": 200}], "shippingRequired": false, "sku": "A725BA2", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 10}]} + Stripe Test: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + productId: "" + responses: + "200": + application/json: {"categorization": "Support Services", "description": "Nice cozy cotton t shirt", "id": "prod_IaSbzLnxOHmC0i", "isGiftCard": false, "name": "Blue T Shirt", "variants": [{"barcode": "564158468416486458646886484", "createdDate": "2021-01-22T06:52:16Z", "id": "price_1ICJVEA8m8S1Gh7OIOCDOG8j", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": false, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Blue T Shirt - Standard Price", "prices": [{"currency": "GBP", "unitPrice": 15}], "shippingRequired": true, "sku": "LargeBrownHat", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 0}, {"barcode": "CSE370", "createdDate": "2021-01-22T06:47:34Z", "id": "price_1ICJQgA8m8S1Gh7OfErQdx5R", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": false, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Blue T Shirt - Standard Price", "prices": [{"currency": "USD", "unitPrice": 30}], "shippingRequired": true, "sku": "LargeBrownHat", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "meters", "vatPercentage": 0}, {"barcode": "CSE370", "createdDate": "2020-12-17T08:19:48Z", "id": "price_1HzHiCA8m8S1Gh7OXZVa6r3F", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": false, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Blue T Shirt - Standard Price", "prices": [{"currency": "GBP", "unitPrice": 15}], "shippingRequired": true, "sku": "A725BA2", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "meters", "vatPercentage": 0}]} + WooCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + productId: "" + responses: + "200": + application/json: {"categorization": "Hardware", "description": "", "id": "27", "isGiftCard": false, "name": "Monitor", "variants": [{"barcode": "CSE370", "createdDate": "2021-03-11T08:55:22", "id": "27", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Monitor", "prices": [{"currency": "GBP", "unitPrice": 150}], "shippingRequired": true, "sku": "Coat-Black-Md", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 0}]} + Zettle: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + productId: "" + responses: + "200": + application/json: {"categorization": "Clothing", "description": "Install of Windows 11 (Professional Edition)", "id": "9d21fd90-a34a-11eb-b574-ad6abe469b61", "isGiftCard": false, "name": "T-Shirt", "variants": [{"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "bb9bcf30-a34a-11eb-b574-ad6abe469b61", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Medium", "prices": [{"currency": "GBP", "unitPrice": 10}], "shippingRequired": false, "sku": "Coat-Red-Lrg", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 20}, {"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "b919df40-a34a-11eb-b574-ad6abe469b61", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Large", "prices": [{"currency": "GBP", "unitPrice": 10}], "shippingRequired": false, "sku": "Coat-Red-Lrg", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 20}, {"barcode": "CSE370", "createdDate": "0001-01-01T00:00:00", "id": "bcb5cab0-a34a-11eb-b574-ad6abe469b61", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Small", "prices": [{"currency": "GBP", "unitPrice": 10}], "shippingRequired": false, "sku": "LargeBrownHat", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 20}]} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + productId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-commerce-products: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Amazon Seller Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/6a59da96-e6d2-4c5c-ace7-65ba8be6a472/connections/58be1638-2c74-4ad4-8ff3-8c5b98b5f0fe/data/commerce-products?page=1&pageSize=2"}, "next": {"href": "/companies/6a59da96-e6d2-4c5c-ace7-65ba8be6a472/connections/58be1638-2c74-4ad4-8ff3-8c5b98b5f0fe/data/commerce-products?page=2&pageSize=2"}, "self": {"href": "/companies/6a59da96-e6d2-4c5c-ace7-65ba8be6a472/connections/58be1638-2c74-4ad4-8ff3-8c5b98b5f0fe/data/commerce-products"}}, "pageNumber": 1, "pageSize": 2, "results": [{"categorization": "DEVICE", "description": "Cast from your phone to your TV with this all new chromecast.", "id": "Chromecast", "isGiftCard": false, "name": "Chromecast", "variants": [{"barcode": "CSE370", "createdDate": "2021-02-07T12:30:01Z", "id": "packaging_asin_gating", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": false, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Chromecast in a cardboard box", "prices": [{"currency": "GBP", "unitPrice": 50}], "shippingRequired": false, "sku": "packaging_asin_gating", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 0}]}, {"categorization": "COAT", "description": "Wind and rainproof, keeping you dry all year round.", "id": "vb554a-bl1915", "isGiftCard": false, "name": "Waterproof Jacket", "variants": [{"barcode": "CSE370", "createdDate": "2021-02-07T12:30:01Z", "id": "ARRIS,SB6141", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": false, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Waterproof Jacket (Black)", "prices": [{"currency": "GBP", "unitPrice": 200}], "shippingRequired": false, "sku": "ARRIS,SB6141", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 0}, {"barcode": "564158468416486458646886484", "createdDate": "2021-02-07T12:30:01Z", "id": "RTN66U-N9000", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": false, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Waterproof Jacket (Blue)", "prices": [{"currency": "GBP", "unitPrice": 200}], "shippingRequired": false, "sku": "RTN66U-N9000", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "meters", "vatPercentage": 0}, {"barcode": "CSE370", "createdDate": "2021-02-07T12:30:01Z", "id": "TLWR841N", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": false, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Waterproof Jacket (Red)", "prices": [{"currency": "GBP", "unitPrice": 200}], "shippingRequired": false, "sku": "TLWR841N", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 0}]}], "totalResults": 3} + BigCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d1ebcf6d-f7f9-4841-8a06-fec12c492a48/connections/7c0a21e8-938a-40a4-b0f7-5ab5d46804b0/data/commerce-products?page=1&pageSize=2"}, "next": {"href": "/companies/d1ebcf6d-f7f9-4841-8a06-fec12c492a48/connections/7c0a21e8-938a-40a4-b0f7-5ab5d46804b0/data/commerce-products?page=2&pageSize=2"}, "self": {"href": "/companies/d1ebcf6d-f7f9-4841-8a06-fec12c492a48/connections/7c0a21e8-938a-40a4-b0f7-5ab5d46804b0/data/commerce-products"}}, "pageNumber": 1, "pageSize": 2, "results": [{"categorization": "Shop All, Utility", "description": "The last laundry cart you'll ever buy. This industrial non-collapsable cart is constructed with a steel framed body using heavyweight canvas capped with a soft leather rim sitting on four smooth rolling casters. Keeps the grubby garments off the floor and almost makes laundry enjoyable. Can also be used as the ideal storage solution: many people find it ideal for children's toys or a load of chopped firewood. Load it up and wheel it away. Natural Heavyweight Canvas with Vegetable Tanned Leather Rim Measure�", "id": "103", "isGiftCard": false, "name": "[Sample] Canvas Laundry Cart", "variants": [{"barcode": "", "createdDate": "0001-01-01T00:00:00", "id": "71", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": false, "modifiedDate": "2022-10-23T00:00:00Z", "name": "[Sample] Canvas Laundry Cart", "prices": [{"currency": "GBP", "unitPrice": 200}], "shippingRequired": true, "sku": "CLC", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "meters", "vatPercentage": 0}]}, {"categorization": "Shop All, Utility", "description": "This powder coated steel utility caddy ensures your cleaning essentials are stowed away in one spot ready for your household chores. Brushes, cloths, liquid soaps can all easily be stashed away. Also ideal to be used as a garden caddy to easily grab from the shed for a days work. Works well as a mop bucket too. The wood carrying handle ensures a comfortable grip when toting it from room to room. Measures 19 h x 36 w x 20 dia cm/7.5 h x 14.1 w x 7.8 dia in", "id": "104", "isGiftCard": false, "name": "[Sample] Utility Caddy", "variants": [{"barcode": "", "createdDate": "0001-01-01T00:00:00", "id": "72", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": false, "modifiedDate": "2022-10-23T00:00:00Z", "name": "[Sample] Utility Caddy", "prices": [{"currency": "GBP", "unitPrice": 45.95}], "shippingRequired": true, "sku": "OFSUC", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 0}]}], "totalResults": 18} + Clover: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/aae80eb3-1f56-41ca-a171-a59f9ee03b26/connections/4a5b633b-cd86-4715-a22b-62be98c4bcc5/data/commerce-products?page=1&pageSize=2"}, "next": {"href": "/companies/aae80eb3-1f56-41ca-a171-a59f9ee03b26/connections/4a5b633b-cd86-4715-a22b-62be98c4bcc5/data/commerce-products?page=2&pageSize=2"}, "self": {"href": "/companies/aae80eb3-1f56-41ca-a171-a59f9ee03b26/connections/4a5b633b-cd86-4715-a22b-62be98c4bcc5/data/commerce-products"}}, "pageNumber": 1, "pageSize": 2, "results": [{"categorization": "Hardware", "description": "Coffee", "id": "DJANHKK2AVEYY", "isGiftCard": false, "name": "Coffee", "variants": [{"barcode": "1234", "createdDate": "0001-01-01T00:00:00", "id": "DJANHKK2AVEYY", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Coffee", "prices": [{"currency": "GBP", "unitPrice": 3}], "shippingRequired": false, "sku": "12222", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 20}]}, {"categorization": "Software", "description": "Cool Laptop", "id": "NMZHKK6FKF6ZJ", "isGiftCard": false, "name": "Laptop", "variants": [{"barcode": "123", "createdDate": "0001-01-01T00:00:00", "id": "NMZHKK6FKF6ZJ", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Laptop", "prices": [{"currency": "GBP", "unitPrice": 1000}], "shippingRequired": false, "sku": "111", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 20}]}], "totalResults": 3} + Lightspeed K Trial: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-products?page=1&pageSize=2"}, "next": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-products?page=2&pageSize=2"}, "self": {"href": "/companies/36e3213b-02f6-4264-96ce-6dd53ea69e57/connections/278ba962-466a-452b-92b0-4bdee3a23463/data/commerce-products"}}, "pageNumber": 1, "pageSize": 2, "results": [{"categorization": "Alcoholic beverages", "description": "Alcoholic beverages", "id": "647208621834539", "isGiftCard": false, "name": "Alcoholic beverages", "variants": []}, {"categorization": "NA beverages", "description": "NA beverages", "id": "647208621834542", "isGiftCard": false, "name": "NA beverages", "variants": []}], "totalResults": 39} + PrestaShop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/2bf78e61-58ca-421a-a430-5dfa59cf15b0/connections/30774c1f-fdcd-491e-9e60-47e316b3ab9b/data/commerce-products?page=1&pageSize=2"}, "next": {"href": "/companies/2bf78e61-58ca-421a-a430-5dfa59cf15b0/connections/30774c1f-fdcd-491e-9e60-47e316b3ab9b/data/commerce-products?page=2&pageSize=2"}, "self": {"href": "/companies/2bf78e61-58ca-421a-a430-5dfa59cf15b0/connections/30774c1f-fdcd-491e-9e60-47e316b3ab9b/data/commerce-products"}}, "pageNumber": 1, "pageSize": 2, "results": [{"categorization": "Home - Clothes - Men", "description": "Symbol of lightness and delicacy, the hummingbird evokes curiosity and joy. Studio Design' PolyFaune collection features classic products with colorful patterns, inspired by the traditional japanese origamis. To wear with a chino or jeans. The sublimation textile printing process provides an exceptional color rendering and a color, guaranteed overtime.", "id": "1", "isGiftCard": false, "name": "Hummingbird printed t-shirt", "variants": [{"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "8", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Hummingbird printed t-shirt (Size = XL, Color = Black)", "prices": [{"currency": "USD", "unitPrice": 23.9}], "shippingRequired": true, "sku": "demo_1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 6}, {"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "4", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Hummingbird printed t-shirt (Size = M, Color = Black)", "prices": [{"currency": "USD", "unitPrice": 23.9}], "shippingRequired": true, "sku": "demo_1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 6}, {"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "5", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Hummingbird printed t-shirt (Size = L, Color = White)", "prices": [{"currency": "USD", "unitPrice": 23.9}], "shippingRequired": true, "sku": "demo_1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 6}, {"barcode": "CSE370", "createdDate": "0001-01-01T00:00:00", "id": "3", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Hummingbird printed t-shirt (Size = M, Color = White)", "prices": [{"currency": "USD", "unitPrice": 23.9}], "shippingRequired": true, "sku": "demo_1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 6}, {"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "6", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Hummingbird printed t-shirt (Size = L, Color = Black)", "prices": [{"currency": "USD", "unitPrice": 23.9}], "shippingRequired": true, "sku": "demo_1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 6}, {"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "1", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Hummingbird printed t-shirt (Size = S, Color = White)", "prices": [{"currency": "USD", "unitPrice": 23.9}], "shippingRequired": true, "sku": "demo_1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 6}, {"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "2", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Hummingbird printed t-shirt (Size = S, Color = Black)", "prices": [{"currency": "USD", "unitPrice": 23.9}], "shippingRequired": true, "sku": "demo_1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "meters", "vatPercentage": 6}, {"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "7", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Hummingbird printed t-shirt (Size = XL, Color = White)", "prices": [{"currency": "USD", "unitPrice": 23.9}], "shippingRequired": true, "sku": "demo_1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "meters", "vatPercentage": 6}]}, {"categorization": "Home - Accessories - Home Accessories", "description": "The brown bear cushion will add a graphic and colorful touch to your sofa, armchair or bed. Create a modern and zen atmosphere that inspires relaxation. Cover 100% cotton, machine washable at 60� / Filling 100% hypoallergenic polyester.", "id": "10", "isGiftCard": false, "name": "Brown bear cushion", "variants": [{"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "24", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Brown bear cushion (Color = White)", "prices": [{"currency": "USD", "unitPrice": 18.9}], "shippingRequired": true, "sku": "demo_16", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 6}, {"barcode": "CSE370", "createdDate": "0001-01-01T00:00:00", "id": "25", "inventory": {"locations": [], "totalQuantity": 300}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Brown bear cushion (Color = Black)", "prices": [{"currency": "USD", "unitPrice": 18.9}], "shippingRequired": true, "sku": "demo_16", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "meters", "vatPercentage": 6}]}], "totalResults": 22} + Shopify: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-products?page=1&pageSize=2"}, "next": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-products?page=2&pageSize=2"}, "self": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-products"}}, "pageNumber": 1, "pageSize": 2, "results": [{"categorization": "Asus", "description": "", "id": "6595494117534", "isGiftCard": false, "name": "Monitor", "variants": [{"barcode": "", "createdDate": "2021-03-19T10:13:22Z", "id": "39444526694558", "inventory": {"locations": [], "totalQuantity": 91}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Monitor", "prices": [{"currency": "GBP", "unitPrice": 150}], "shippingRequired": true, "sku": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 0}]}, {"categorization": "Logitech", "description": "", "id": "6595497066654", "isGiftCard": false, "name": "Mouse", "variants": [{"barcode": "", "createdDate": "2021-03-19T10:14:01Z", "id": "39444533706910", "inventory": {"locations": [], "totalQuantity": 71}, "isTaxEnabled": false, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Mouse", "prices": [{"currency": "GBP", "unitPrice": 25}], "shippingRequired": true, "sku": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 0}]}], "totalResults": 4} + Square: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/25debd39-e024-41a1-a86c-4fd47f29c853/connections/d5071fdf-a769-48f3-b39e-e588d515bb83/data/commerce-products?page=1&pageSize=2"}, "next": {"href": "/companies/25debd39-e024-41a1-a86c-4fd47f29c853/connections/d5071fdf-a769-48f3-b39e-e588d515bb83/data/commerce-products?page=2&pageSize=2"}, "self": {"href": "/companies/25debd39-e024-41a1-a86c-4fd47f29c853/connections/d5071fdf-a769-48f3-b39e-e588d515bb83/data/commerce-products"}}, "pageNumber": 1, "pageSize": 2, "results": [{"categorization": "Hardware", "description": "Install of Windows 11 (Professional Edition)", "id": "AX54KZQ3UAVCVPUMNEGFEU35", "isGiftCard": false, "name": "Monitor", "variants": [{"barcode": "CSE370", "createdDate": "2021-02-18T15:47:31Z", "id": "A5BUT6SYUNYRSQ2R7GZ6UKN6", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Regular", "prices": [{"currency": "GBP", "unitPrice": 200}], "shippingRequired": false, "sku": "A725BA2", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 10}]}, {"categorization": "Furniture", "description": "1 hour of support from an agent (phone or remote)", "id": "FYRIQNFTFRGQNQZGZG66MJWI", "isGiftCard": false, "name": "Desk", "variants": [{"barcode": "564158468416486458646886484", "createdDate": "2021-02-18T15:47:45Z", "id": "VMKSQEABA3WIYGXNAV63JOTZ", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Regular", "prices": [{"currency": "GBP", "unitPrice": 70}], "shippingRequired": false, "sku": "Coat-Red-Lrg", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 10}]}], "totalResults": 4} + Stripe Test: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/8206e78e-e340-411e-b315-473c4ab73b48/connections/43e58373-0a1d-44a0-97f0-9fa9993a14fa/data/commerce-products?page=1&pageSize=2"}, "next": {"href": "/companies/8206e78e-e340-411e-b315-473c4ab73b48/connections/43e58373-0a1d-44a0-97f0-9fa9993a14fa/data/commerce-products?page=2&pageSize=2"}, "self": {"href": "/companies/8206e78e-e340-411e-b315-473c4ab73b48/connections/43e58373-0a1d-44a0-97f0-9fa9993a14fa/data/commerce-products"}}, "pageNumber": 1, "pageSize": 2, "results": [{"categorization": "Hardware", "description": "Nice cozy cotton t shirt", "id": "prod_IaSbzLnxOHmC0i", "isGiftCard": false, "name": "Blue T Shirt", "variants": [{"barcode": "CSE370", "createdDate": "2021-01-22T06:52:16Z", "id": "price_1ICJVEA8m8S1Gh7OIOCDOG8j", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": false, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Blue T Shirt - Standard Price", "prices": [{"currency": "GBP", "unitPrice": 15}], "shippingRequired": true, "sku": "A725BA2", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 0}, {"barcode": "564158468416486458646886484", "createdDate": "2021-01-22T06:47:34Z", "id": "price_1ICJQgA8m8S1Gh7OfErQdx5R", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": false, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Blue T Shirt - Standard Price", "prices": [{"currency": "USD", "unitPrice": 30}], "shippingRequired": true, "sku": "A725BA2", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 0}, {"barcode": "564158468416486458646886484", "createdDate": "2020-12-17T08:19:48Z", "id": "price_1HzHiCA8m8S1Gh7OXZVa6r3F", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": false, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Blue T Shirt - Standard Price", "prices": [{"currency": "GBP", "unitPrice": 15}], "shippingRequired": true, "sku": "LargeBrownHat", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "meters", "vatPercentage": 0}]}, {"categorization": "Support Services", "description": "1tb Western Digital Hard Drive", "id": "prod_IQ6G1MDsvUb87Y", "isGiftCard": false, "name": "Laptop", "variants": [{"barcode": "564158468416486458646886484", "createdDate": "2020-11-19T16:32:45Z", "id": "price_1HpG3tA8m8S1Gh7Oa6bGLvVD", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": false, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Laptop - Standard Price", "prices": [{"currency": "GBP", "unitPrice": 100}], "shippingRequired": false, "sku": "LargeBrownHat", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 0}]}], "totalResults": 4} + WooCommerce: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/010c6f53-8fc8-40ab-9ed5-41191cf9c6b5/connections/7545ca2e-5f58-4f98-8af2-3b2c38bb8074/data/commerce-products?page=1&pageSize=2"}, "next": {"href": "/companies/010c6f53-8fc8-40ab-9ed5-41191cf9c6b5/connections/7545ca2e-5f58-4f98-8af2-3b2c38bb8074/data/commerce-products?page=2&pageSize=2"}, "self": {"href": "/companies/010c6f53-8fc8-40ab-9ed5-41191cf9c6b5/connections/7545ca2e-5f58-4f98-8af2-3b2c38bb8074/data/commerce-products"}}, "pageNumber": 1, "pageSize": 2, "results": [{"categorization": "Hardware", "description": "", "id": "27", "isGiftCard": false, "name": "Monitor", "variants": [{"barcode": "CSE370", "createdDate": "2021-03-11T08:55:22", "id": "27", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Monitor", "prices": [{"currency": "GBP", "unitPrice": 150}], "shippingRequired": true, "sku": "A725BA2", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "meters", "vatPercentage": 0}]}, {"categorization": "Hardware", "description": "", "id": "28", "isGiftCard": false, "name": "Keyboard", "variants": [{"barcode": "CSE370", "createdDate": "2021-03-11T09:02:58", "id": "28", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Keyboard", "prices": [{"currency": "GBP", "unitPrice": 30}], "shippingRequired": true, "sku": "Coat-Red-Lrg", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 0}]}], "totalResults": 3} + Zettle: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/9d448ad0-4508-47fc-bd3b-6950493151f1/connections/c7baa8da-3302-464b-8aa1-edcd4c900902/data/commerce-products?page=1&pageSize=2"}, "self": {"href": "/companies/9d448ad0-4508-47fc-bd3b-6950493151f1/connections/c7baa8da-3302-464b-8aa1-edcd4c900902/data/commerce-products"}}, "pageNumber": 1, "pageSize": 2, "results": [{"categorization": "Clothing", "description": "1tb Western Digital Hard Drive", "id": "9d21fd90-a34a-11eb-b574-ad6abe469b61", "isGiftCard": false, "name": "T-Shirt", "variants": [{"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "bb9bcf30-a34a-11eb-b574-ad6abe469b61", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Medium", "prices": [{"currency": "GBP", "unitPrice": 10}], "shippingRequired": false, "sku": "A725BA2", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "meters", "vatPercentage": 20}, {"barcode": "CSE370", "createdDate": "0001-01-01T00:00:00", "id": "b919df40-a34a-11eb-b574-ad6abe469b61", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Large", "prices": [{"currency": "GBP", "unitPrice": 10}], "shippingRequired": false, "sku": "A725BA2", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 20}, {"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "bcb5cab0-a34a-11eb-b574-ad6abe469b61", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Small", "prices": [{"currency": "GBP", "unitPrice": 10}], "shippingRequired": false, "sku": "A725BA2", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 20}]}, {"categorization": "Clothing", "description": "Install of Windows 11 (Professional Edition)", "id": "e02c2930-a34a-11eb-b9db-8f5efc0924aa", "isGiftCard": false, "name": "Hoodie", "variants": [{"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "fa180e40-a34a-11eb-b9db-8f5efc0924aa", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Medium", "prices": [{"currency": "GBP", "unitPrice": 30}], "shippingRequired": false, "sku": "Coat-Red-Lrg", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 20}, {"barcode": "CSE370", "createdDate": "0001-01-01T00:00:00", "id": "fc412fd0-a34a-11eb-b9db-8f5efc0924aa", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Extra Large", "prices": [{"currency": "GBP", "unitPrice": 30}], "shippingRequired": false, "sku": "Coat-Red-Lrg", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "m", "vatPercentage": 20}, {"barcode": "564158468416486458646886484", "createdDate": "0001-01-01T00:00:00", "id": "f8a03b50-a34a-11eb-b9db-8f5efc0924aa", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Small", "prices": [{"currency": "GBP", "unitPrice": 30}], "shippingRequired": false, "sku": "Coat-Black-Md", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "kg", "vatPercentage": 20}, {"barcode": "CSE370", "createdDate": "0001-01-01T00:00:00", "id": "fac1bbc0-a34a-11eb-b9db-8f5efc0924aa", "inventory": {"locations": [], "totalQuantity": 0}, "isTaxEnabled": true, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Large", "prices": [{"currency": "GBP", "unitPrice": 30}], "shippingRequired": false, "sku": "Coat-Black-Md", "sourceModifiedDate": "2022-10-23T00:00:00Z", "unitOfMeasure": "meters", "vatPercentage": 20}]}], "totalResults": 2} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-commerce-transaction: + Mollie: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transactionId: "" + responses: + "200": + application/json: {"createdDate": "2022-01-17T16:00:46", "currency": "EUR", "id": "re_Azhe8TzfUK", "modifiedDate": "2022-03-17T15:47:28Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "subType": "Invoice payment", "totalAmount": -20, "transactionSourceRef": {"id": "EILBDVJVNUAGVKRQ", "type": "Payment"}, "type": "Refund"} + Mollie Test: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transactionId: "" + responses: + "200": + application/json: {"createdDate": "2022-01-17T16:00:46", "currency": "EUR", "id": "re_Azhe8TzfUK", "modifiedDate": "2022-08-17T11:33:19Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "subType": "PaymentRefund", "totalAmount": -20, "transactionSourceRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab", "type": "Unknown"}, "type": "Refund"} + Shopify: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transactionId: "" + responses: + "200": + application/json: {"createdDate": "2021-03-19T13:16:26", "currency": "GBP", "id": "ShopifyPayment-1633176289438", "modifiedDate": "2023-02-10T15:18:23Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2021-03-19T13:16:26", "subType": "charge", "totalAmount": 175, "transactionSourceRef": {"id": "3684116791454", "type": "Order"}, "type": "Payment"} + Stripe Test: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transactionId: "" + responses: + "200": + application/json: {"createdDate": "2020-11-19T16:56:06Z", "currency": "GBP", "id": "txn_1HpGQUA8m8S1Gh7OR21pB0Yj", "modifiedDate": "2022-09-30T11:18:28Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "subType": "charge", "totalAmount": 50, "transactionSourceRef": {"id": "ch_1HpGQUA8m8S1Gh7Ot4WDTus5", "type": "Payment"}, "type": "Payment"} + SumUp: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transactionId: "" + responses: + "200": + application/json: {"createdDate": "2021-03-26T21:09:59Z", "currency": "GBP", "id": "46d36a64-ea48-4e37-9340-3548cbf3ca2f", "modifiedDate": "2022-09-14T10:58:03Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "subType": "PAYMENT", "totalAmount": 15, "transactionSourceRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2", "type": "Unknown"}, "type": "Payment"} + Zettle: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transactionId: "" + responses: + "200": + application/json: {"createdDate": "2020-11-23T14:27:38Z", "currency": "GBP", "id": "PAYMENT:09b94cfc-2d98-11eb-8021-0e1b9dcbeca1", "modifiedDate": "2021-10-27T15:23:04Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2020-11-25T23:10:01Z", "subType": "CardPayment", "totalAmount": 25, "transactionSourceRef": {"id": "09b94cfc-2d98-11eb-8021-0e1b9dcbeca1", "type": "Unknown"}, "type": "Payment"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + transactionId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-commerce-transactions: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Mollie: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/a68cb447-182d-4bbe-be1a-f526d11d69d5/connections/dfbf847b-cde8-4b00-b2f9-af51dec0d337/data/commerce-transactions?page=1&pageSize=2"}, "next": {"href": "/companies/a68cb447-182d-4bbe-be1a-f526d11d69d5/connections/dfbf847b-cde8-4b00-b2f9-af51dec0d337/data/commerce-transactions?page=2&pageSize=2"}, "self": {"href": "/companies/a68cb447-182d-4bbe-be1a-f526d11d69d5/connections/dfbf847b-cde8-4b00-b2f9-af51dec0d337/data/commerce-transactions"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdDate": "2022-01-17T16:00:46", "currency": "EUR", "id": "re_Azhe8TzfUK", "modifiedDate": "2022-03-17T15:47:28Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "subType": "Invoice payment", "totalAmount": -20, "transactionSourceRef": {"id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2", "type": "ServiceCharge"}, "type": "Refund"}, {"createdDate": "2022-01-17T16:00:05", "currency": "EUR", "id": "re_NPKEJhQveu", "modifiedDate": "2022-03-17T15:47:28Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "subType": "Invoice payment", "totalAmount": -60, "transactionSourceRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab", "type": "Fee"}, "type": "Refund"}], "totalResults": 7} + Mollie Test: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b978f9fe-8d63-4cfc-b2c2-b61b72e22785/connections/d564f8fd-0766-4ab8-a427-7c893f9b9ff6/data/commerce-transactions?page=1&pageSize=2"}, "next": {"href": "/companies/b978f9fe-8d63-4cfc-b2c2-b61b72e22785/connections/d564f8fd-0766-4ab8-a427-7c893f9b9ff6/data/commerce-transactions?page=2&pageSize=2"}, "self": {"href": "/companies/b978f9fe-8d63-4cfc-b2c2-b61b72e22785/connections/d564f8fd-0766-4ab8-a427-7c893f9b9ff6/data/commerce-transactions"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdDate": "2022-01-17T16:00:46", "currency": "EUR", "id": "re_Azhe8TzfUK", "modifiedDate": "2022-08-17T11:33:19Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "subType": "PaymentRefund", "totalAmount": -20, "transactionSourceRef": {"id": "7110701885", "type": "ServiceCharge"}, "type": "Refund"}, {"createdDate": "2022-01-17T16:00:05", "currency": "EUR", "id": "re_NPKEJhQveu", "modifiedDate": "2022-08-17T11:33:19Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "subType": "PaymentRefund", "totalAmount": -60, "transactionSourceRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab", "type": "Unknown"}, "type": "Refund"}], "totalResults": 7} + Shopify: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-transactions?page=1&pageSize=2"}, "next": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-transactions?page=2&pageSize=2"}, "self": {"href": "/companies/0bc1cc44-c6d2-4537-9591-b1ad6b5e3c94/connections/d38fa6d3-d712-4cf6-9d9d-f03bacd87595/data/commerce-transactions"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdDate": "2021-03-19T13:16:26", "currency": "GBP", "id": "ShopifyPayment-1633176289438", "modifiedDate": "2023-02-10T15:18:23Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2021-03-19T13:16:26", "subType": "charge", "totalAmount": 175, "transactionSourceRef": {"id": "3684116791454", "type": "Order"}, "type": "Payment"}, {"createdDate": "2021-03-19T13:16:26", "currency": "GBP", "id": "ShopifyPayment-1633176289438:Fee", "modifiedDate": "2023-02-10T15:18:23Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2021-03-19T13:16:26", "subType": "charge", "totalAmount": -4.05, "transactionSourceRef": {"id": "3684116791454", "type": "Order"}, "type": "PaymentFee"}], "totalResults": 64} + Stripe Test: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/8206e78e-e340-411e-b315-473c4ab73b48/connections/43e58373-0a1d-44a0-97f0-9fa9993a14fa/data/commerce-transactions?page=1&pageSize=2"}, "next": {"href": "/companies/8206e78e-e340-411e-b315-473c4ab73b48/connections/43e58373-0a1d-44a0-97f0-9fa9993a14fa/data/commerce-transactions?page=2&pageSize=2"}, "self": {"href": "/companies/8206e78e-e340-411e-b315-473c4ab73b48/connections/43e58373-0a1d-44a0-97f0-9fa9993a14fa/data/commerce-transactions"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdDate": "2020-11-19T16:56:06Z", "currency": "GBP", "id": "txn_1HpGQUA8m8S1Gh7OR21pB0Yj", "modifiedDate": "2022-09-30T11:18:28Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "subType": "charge", "totalAmount": 50, "transactionSourceRef": {"id": "ch_1HpGQUA8m8S1Gh7Ot4WDTus5", "type": "Payment"}, "type": "Payment"}, {"createdDate": "2020-11-19T16:56:06Z", "currency": "GBP", "id": "txn_1HpGQUA8m8S1Gh7OR21pB0Yj:Stripe processing fees", "modifiedDate": "2022-09-30T11:18:28Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "subType": "stripe_fee", "totalAmount": -0.9, "transactionSourceRef": {"id": "ch_1HpGQUA8m8S1Gh7Ot4WDTus5", "type": "Payment"}, "type": "PaymentFee"}], "totalResults": 70} + SumUp: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/e170dbe2-be50-474f-b449-82add37108de/connections/1e631dd5-a30b-4bad-ad5c-315c9743535b/data/commerce-transactions?page=1&pageSize=2"}, "next": {"href": "/companies/e170dbe2-be50-474f-b449-82add37108de/connections/1e631dd5-a30b-4bad-ad5c-315c9743535b/data/commerce-transactions?page=2&pageSize=2"}, "self": {"href": "/companies/e170dbe2-be50-474f-b449-82add37108de/connections/1e631dd5-a30b-4bad-ad5c-315c9743535b/data/commerce-transactions"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdDate": "2021-03-26T21:09:59Z", "currency": "GBP", "id": "46d36a64-ea48-4e37-9340-3548cbf3ca2f", "modifiedDate": "2022-09-14T10:58:03Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "subType": "PAYMENT", "totalAmount": 15, "transactionSourceRef": {"id": "7110701885", "type": "Fee"}, "type": "Payment"}, {"createdDate": "2021-03-30T12:22:14Z", "currency": "GBP", "id": "471914a4-a82f-4fc4-b39b-9986fd706d26", "modifiedDate": "2022-09-14T10:58:03Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "subType": "PAYMENT", "totalAmount": 215, "transactionSourceRef": {"id": "13d946f0-c5d5-42bc-b092-97ece17923ab", "type": "Payment"}, "type": "Payment"}], "totalResults": 3} + Zettle: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/9d448ad0-4508-47fc-bd3b-6950493151f1/connections/c7baa8da-3302-464b-8aa1-edcd4c900902/data/commerce-transactions?page=1&pageSize=2"}, "next": {"href": "/companies/9d448ad0-4508-47fc-bd3b-6950493151f1/connections/c7baa8da-3302-464b-8aa1-edcd4c900902/data/commerce-transactions?page=2&pageSize=2"}, "self": {"href": "/companies/9d448ad0-4508-47fc-bd3b-6950493151f1/connections/c7baa8da-3302-464b-8aa1-edcd4c900902/data/commerce-transactions"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdDate": "2020-11-23T14:27:38Z", "currency": "GBP", "id": "PAYMENT:09b94cfc-2d98-11eb-8021-0e1b9dcbeca1", "modifiedDate": "2021-10-27T15:23:04Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2020-11-25T23:10:01Z", "subType": "CardPayment", "totalAmount": 25, "transactionSourceRef": {"id": "09b94cfc-2d98-11eb-8021-0e1b9dcbeca1", "type": "Unknown"}, "type": "Payment"}, {"createdDate": "2020-11-23T14:28:20Z", "currency": "GBP", "id": "PAYMENT:226580d6-2d98-11eb-a35c-fed5e63de507", "modifiedDate": "2021-10-27T15:23:04Z", "sourceCreatedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2020-11-25T23:10:02Z", "subType": "CardPayment", "totalAmount": 58.5, "transactionSourceRef": {"id": "226580d6-2d98-11eb-a35c-fed5e63de507", "type": "Unknown"}, "type": "Payment"}], "totalResults": 16} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-commerce-customer-retention-metrics: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + reportDate: "29-09-2020" + periodLength: 497588 + numberOfPeriods: 431272 + periodUnit: "Day" + responses: + "200": + application/json: + - reportInfo: + name: customer_retention + displayName: Customer Retention + dimensions: + - index: 0 + displayName: Period + type: datespan + items: + - index: 0 + displayName: Period 0 + start: '2022-01-01' + end: '2022-12-31' + - index: 1 + displayName: Customer retention metrics + type: string + items: + - index: 0 + value: Existing customers + - index: 1 + value: New customers + - index: 2 + value: Total customers + - index: 3 + value: Retention rate + - index: 4 + value: Repeat rate + measures: + - displayName: Count + index: 0 + type: int + - displayName: Percentage + index: 1 + type: percentage + reportData: + - dimension: 0 + dimensionDisplayName: Period + item: 0 + itemDisplayName: Period 0 + components: + - dimension: 1 + dimensionDisplayName: Customer retention metrics + item: 0 + itemDisplayName: Existing customers + measures: + - index: 0 + measureDisplayName: Count + value: 13 + - dimension: 1 + dimensionDisplayName: Customer retention metrics + item: 1 + itemDisplayName: New customers + measures: + - index: 0 + measureDisplayName: Count + value: 47 + - dimension: 1 + dimensionDisplayName: Customer retention metrics + item: 2 + itemDisplayName: Total customers + measures: + - index: 0 + measureDisplayName: Count + value: 60 + - dimension: 1 + dimensionDisplayName: Customer retention metrics + item: 3 + itemDisplayName: Retention rate + measures: + - index: 1 + measureDisplayName: Percentage + value: 0 + - dimension: 1 + dimensionDisplayName: Customer retention metrics + item: 4 + itemDisplayName: Repeat rate + measures: + - index: 1 + measureDisplayName: Percentage + value: 21.67 + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + reportDate: "29-09-2020" + periodLength: 613110 + numberOfPeriods: 651906 + periodUnit: "Week" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-commerce-lifetime-value-metrics: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + reportDate: "29-09-2020" + periodLength: 900865 + numberOfPeriods: 500610 + periodUnit: "Year" + responses: + "200": + application/json: + - reportInfo: + name: lifetime_value + displayName: Lifetime Value + dimensions: + - index: 0 + displayName: Period + type: datespan + items: + - index: 0 + displayName: Period 0 + start: '2022-01-01' + end: '2022-12-31' + - index: 1 + displayName: Lifetime value metrics + type: string + items: + - index: 0 + value: Lifetime value + measures: + - displayName: Value + units: GBP + index: 0 + type: currency + reportData: + - dimension: 0 + dimensionDisplayName: Period + item: 0 + itemDisplayName: Period 0 + components: + - dimension: 1 + dimensionDisplayName: Lifetime value metrics + item: 0 + itemDisplayName: Lifetime value + measures: + - index: 0 + measureDisplayName: Value + value: 3782.07 + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + reportDate: "29-09-2020" + periodLength: 614777 + numberOfPeriods: 731824 + periodUnit: "Month" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-commerce-revenue-metrics: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + reportDate: "29-09-2020" + periodLength: 307462 + numberOfPeriods: 120092 + periodUnit: "Year" + responses: + "200": + application/json: + - reportInfo: + name: revenue + displayName: Revenue + dimensions: + - index: 0 + displayName: Period + type: datespan + items: + - index: 0 + displayName: Period 0 + start: '2022-01-01' + end: '2022-12-31' + - index: 1 + displayName: Revenue metrics + type: string + items: + - index: 0 + value: Revenue + - index: 1 + value: Revenue growth + measures: + - displayName: Value + units: GBP + index: 0 + type: currency + - displayName: Percentage change vs. previous period + units: '%' + index: 1 + type: percentage + reportData: + - dimension: 0 + dimensionDisplayName: Period + item: 0 + itemDisplayName: Period 0 + components: + - dimension: 1 + dimensionDisplayName: Revenue metrics + item: 0 + itemDisplayName: Revenue + measures: + - index: 0 + measureDisplayName: Value + value: 2392.48 + - dimension: 1 + dimensionDisplayName: Revenue metrics + item: 1 + itemDisplayName: Revenue growth + measures: + - index: 1 + measureDisplayName: Percentage change vs. previous period + value: 276.65 + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + reportDate: "29-09-2020" + periodLength: 944219 + numberOfPeriods: 712717 + periodUnit: "Day" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-commerce-orders-report: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + reportDate: "29-09-2020" + periodLength: 491586 + numberOfPeriods: 393849 + periodUnit: "Year" + responses: + "200": + application/json: + - reportInfo: + name: orders + displayName: Orders + dimensions: + - index: 0 + displayName: Period + type: datespan + items: + - index: 0 + displayName: Period 0 + start: '2022-01-01' + end: '2022-12-31' + - index: 1 + displayName: Order metrics + type: string + items: + - index: 0 + value: Number of orders + - index: 1 + value: Total value + - index: 2 + value: Average order value + measures: + - displayName: Count + index: 0 + type: int + - displayName: Value + units: GBP + index: 1 + type: currency + reportData: + - dimension: 0 + dimensionDisplayName: Period + item: 0 + itemDisplayName: Period 0 + components: + - dimension: 1 + dimensionDisplayName: Order metrics + item: 0 + itemDisplayName: Number of orders + measures: + - index: 0 + measureDisplayName: Count + value: 94 + - dimension: 1 + dimensionDisplayName: Order metrics + item: 1 + itemDisplayName: Total value + measures: + - index: 1 + measureDisplayName: Value + value: 3315.18 + - dimension: 1 + dimensionDisplayName: Order metrics + item: 2 + itemDisplayName: Average order value + measures: + - index: 1 + measureDisplayName: Value + value: 35.27 + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + reportDate: "29-09-2020" + periodLength: 776309 + numberOfPeriods: 632929 + periodUnit: "Month" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-commerce-refunds-report: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + reportDate: "29-09-2020" + periodLength: 277786 + numberOfPeriods: 810912 + periodUnit: "Month" + responses: + "200": + application/json: + - reportInfo: + name: refunds + displayName: Refunds + dimensions: + - index: 0 + displayName: Period + type: datespan + items: + - index: 0 + displayName: Period 0 + start: '2022-01-01' + end: '2022-12-31' + - index: 1 + displayName: Refund metrics + type: string + items: + - index: 0 + value: Number of refunds + - index: 1 + value: Value of refunds + - index: 2 + value: Refund rate + measures: + - displayName: Count + index: 0 + type: int + - displayName: Value + units: GBP + index: 1 + type: currency + - displayName: Percentage + units: '%' + index: 2 + type: percentage + reportData: + - dimension: 0 + dimensionDisplayName: Period + item: 0 + itemDisplayName: Period 0 + components: + - dimension: 1 + dimensionDisplayName: Refund metrics + item: 0 + itemDisplayName: Number of refunds + measures: + - index: 0 + measureDisplayName: Count + value: 39 + - dimension: 1 + dimensionDisplayName: Refund metrics + item: 1 + itemDisplayName: Value of refunds + measures: + - index: 1 + measureDisplayName: Value + value: 642.82 + - dimension: 1 + dimensionDisplayName: Refund metrics + item: 2 + itemDisplayName: Refund rate + measures: + - index: 2 + measureDisplayName: Percentage + value: 0.41 + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + reportDate: "29-09-2020" + periodLength: 876670 + numberOfPeriods: 225134 + periodUnit: "Week" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-accounting-profile: + Example 1: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"accountingPlatformRef": "1700060034_ETD", "addresses": [{"city": "London", "country": "United Kingdom", "line1": "301 Ink Rooms", "line2": "28 Easton Street", "postalCode": "WC1X 0BE", "region": "England", "type": "Billing"}, {"city": "London", "country": "UK", "line1": "28 Easton Street", "postalCode": "WC1X 0BE", "type": "Delivery"}], "baseCurrency": "GBP", "companyLegalName": "Codat Ltd", "companyName": "Codat", "createdDate": "2020-03-09T15:19:26", "financialYearStartDate": "2023-04-01T00:00:00", "ledgerLockDate": "2022-10-23T00:00:00Z", "phoneNumbers": [{"number": "02012 345678", "type": "Landline"}, {"number": "07123 456789", "type": "Mobile"}, {"number": "02012 345678", "type": "Fax"}], "registrationNumber": "5590111724", "sourceUrls": {"Api": "https://api.codat.io"}, "taxNumber": "74111622555799035846", "webLinks": [{"type": "Website", "url": "https://www.codat.io/"}, {"type": "Social", "url": "https://www.linkedin.com/company/codat-limited/"}]} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-commerce-profile: + Example 1: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"accountBalances": [{"available": 20053.23, "currency": "GBP", "pending": 2034.23, "reserved": 517.23}], "addresses": [{"city": "London", "country": "United Kingdom", "line1": "301 Ink Rooms", "line2": "28 Easton Street", "postalCode": "WC1X 0BE", "region": "England", "type": "Billing"}, {"city": "London", "country": "UK", "line1": "28 Easton Street", "postalCode": "WC1X 0BE", "type": "Delivery"}], "baseCurrency": "GBP", "companyLegalName": "Codat Ltd", "companyName": "Codat", "createdDate": "2019-03-07T16:50:49", "modifiedDate": "2022-03-10T15:42:13", "phoneNumbers": [{"number": "02012 345678", "type": "Landline"}, {"number": "07123 456789", "type": "Mobile"}, {"number": "02012 345678", "type": "Fax"}], "registrationNumber": "5590111724", "sourceModifiedDate": "2021-06-10T01:48:49", "sourceUrls": {"Api": "https://api.codat.io"}, "webLinks": [{"type": "Website", "url": "https://www.codat.io/"}, {"type": "Social", "url": "https://www.linkedin.com/company/codat-limited/"}]} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + download-accounting-customer-attachment: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customerId: "" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-customer: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Fernandohaven", "country": "United Kingdom", "line1": "Suite 214", "line2": "8439 Lueilwitz Passage", "postalCode": "JG04 7PV", "region": "Northern Ireland", "type": "Delivery"}, {"city": "Juliochester", "country": "United Kingdom", "line1": "Suite 096", "line2": "864 Halie Course", "postalCode": "DZ8 4BF", "region": "England", "type": "Delivery"}, {"city": "Naderborough", "country": "United Kingdom", "line1": "Suite 001", "line2": "416 Stokes Fords", "postalCode": "XG25 0XX", "region": "Wales", "type": "Delivery"}], "contactName": "Werner Langworth", "contacts": [{"address": {"city": "Hortenseville", "country": "United Kingdom", "line1": "Apt. 145", "line2": "317 Williamson Freeway", "postalCode": "CV4 2HR", "region": "Scotland", "type": "Delivery"}, "email": "Werner_Langworth@hotmail.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Werner Langworth", "phone": [], "status": "Active"}, {"address": {"city": "South Ali", "country": "United Kingdom", "line1": "Suite 075", "line2": "9921 Dickens Walk", "postalCode": "TI04 4OO", "region": "Scotland", "type": "Delivery"}, "email": "Belle51@yahoo.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Belle Glover", "phone": [], "status": "Active"}], "customerName": "Arjun Kuvalis", "defaultCurrency": "GBP", "emailAddress": "Arjun34@hotmail.com", "id": "c8180244-74ac-40cf-a5df-6d83661c44d7", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:16Z", "phone": "014605 64820", "registrationNumber": "NI7JEJVM", "sourceModifiedDate": "2022-07-03T01:27:00", "status": "Active", "taxNumber": "7505220209.583549"} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "", "country": "", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "contactName": "", "contacts": [{"address": {"city": "", "country": "", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}, "email": "", "modifiedDate": "2022-10-23T00:00:00Z", "name": "", "phone": [], "status": "Active"}], "customerName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "0e2f7751-7696-ed11-bff5-6045bd0d2ad6", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "phone": "", "sourceModifiedDate": "2023-01-17T14:50:54Z", "status": "Active", "taxNumber": ""} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"country": "NL", "type": "Billing"}], "contacts": [], "customerName": "Ab Netherlands", "defaultCurrency": "EUR", "id": "555f8251-c65a-433a-a813-5dbe04321d1e", "modifiedDate": "2022-10-26T13:32:05Z", "sourceModifiedDate": "2021-06-14T15:26:37Z", "status": "Active"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "London", "country": "GB", "line1": "Ink Rooms", "postalCode": "WC1X 0BE", "type": "Billing"}], "contacts": [], "customerName": "Abdi 99", "defaultCurrency": "GBP", "emailAddress": "email@codat.io", "id": "5f20075a-a28e-434d-81a6-2db0dc170e87", "modifiedDate": "2022-10-26T13:33:08Z", "registrationNumber": "123456789", "sourceModifiedDate": "2020-02-26T11:23:50Z", "status": "Active", "taxNumber": "GB339 0727 47"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Test 1", "contacts": [{"address": {"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Test 1", "phone": [], "status": "Unknown"}], "customerName": "-", "defaultCurrency": "USD", "id": "11526230", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sourceModifiedDate": "2023-04-17T06:02:46Z", "status": "Active"} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Some city", "country": "Country 1", "line1": "Line 1", "line2": "Line 2", "postalCode": "SW1 2JQ", "region": "A region", "type": "Billing"}], "contactName": "test person name", "contacts": [{"email": "test14A@example.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "test person1", "phone": [{"number": "24681012", "type": "Primary"}, {"number": "121086420", "type": "Unknown"}], "status": "Active"}, {"email": "test14B@example.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "test person2", "phone": [{"number": "123456789", "type": "Primary"}, {"number": "987654321", "type": "Unknown"}], "status": "Active"}, {"email": "test14@example.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "test person name", "phone": [{"number": "01876 541245", "type": "Unknown"}], "status": "Active"}], "customerName": "A test customer 14 (updated)", "defaultCurrency": "GBP", "emailAddress": "test14@example.com", "id": "634509", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "phone": "01876 541245", "sourceModifiedDate": "2022-05-18T09:23:56", "status": "Active"} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [], "contactName": "", "contacts": [{"email": "", "modifiedDate": "2022-10-23T00:00:00Z", "name": "", "phone": [], "status": "Active"}], "customerName": "Chekko Customer Test 01", "defaultCurrency": "EUR", "emailAddress": "", "id": "92227673", "modifiedDate": "2022-09-30T10:29:15Z", "phone": "", "sourceModifiedDate": "0001-01-01T00:00:00", "status": "Active", "taxNumber": ""} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [], "contactName": "Mr Test Customer", "contacts": [], "customerName": "119 Test Customer", "defaultCurrency": "GBP", "id": "773", "modifiedDate": "2023-01-30T14:48:02Z", "sourceModifiedDate": "2022-01-11T12:28:49", "status": "Active"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Bayshore", "line1": "Kristy Abercrombie", "line2": "5647 Cypress Hill Rd", "postalCode": "94326", "region": "CA", "type": "Delivery"}, {"city": "Bayshore", "line1": "Kristy Abercrombie", "line2": "5647 Cypress Hill Rd", "postalCode": "94326", "region": "CA", "type": "Billing"}], "contactName": "Kristy Abercrombie", "contacts": [{"email": "kristy@samplename.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Abercrombie, Kristy", "phone": [{"number": "415-555-6579", "type": "Primary"}], "status": "Active"}, {"modifiedDate": "2022-10-23T00:00:00Z", "name": "Kristy Abercrombie", "phone": [], "status": "Active"}, {"modifiedDate": "2022-10-23T00:00:00Z", "name": "Steve Darcangelo", "phone": [], "status": "Active"}], "customerName": "Abercrombie, Kristy", "defaultCurrency": "GBP", "emailAddress": "kristy@samplename.com", "id": "150000-933272658", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:07:55Z", "phone": "415-555-6579", "sourceModifiedDate": "2023-12-16T05:06:42", "status": "Active"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [], "contactName": "Abraham's Company", "contacts": [{"email": "ab@email.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Abe", "phone": [{"number": "01111111111", "type": "Mobile"}], "status": "Active"}], "customerName": "Abe", "defaultCurrency": "GBP", "emailAddress": "ab@email.com", "id": "9", "modifiedDate": "2023-01-18T11:02:35Z", "registrationNumber": "XXXX9900001", "sourceModifiedDate": "2022-12-08T15:42:59Z", "status": "Active", "taxNumber": "XXXX9900001"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "New York, NY", "line1": "123 Main St", "type": "Billing"}], "contactName": "Kristy Abercrombie", "contacts": [{"address": {"city": "New York, NY", "line1": "123 Main St", "type": "Billing"}, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Abercrombie International Group (deleted)", "phone": [], "status": "Archived"}], "customerName": "Abercrombie International Group", "defaultCurrency": "GBP", "id": "66", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:56Z", "sourceModifiedDate": "2016-09-12T18:53:19Z", "status": "Archived"} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Blackpool", "country": "", "line1": "67a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Delivery"}, {"city": "Manchester", "country": "", "line1": "23a Union Street", "line2": "", "postalCode": "M2 6JK", "region": "", "type": "Delivery"}, {"city": "Blackpool", "country": "Great Britain", "line1": "67a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Billing"}], "contactName": "Lee Dalkin", "contacts": [{"email": "newbusinessadvice@sage.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Lee Dalkin", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Landline"}, {"number": "01742 876 236", "type": "Fax"}], "status": "Active"}, {"email": "", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Malcolm Leverret", "phone": [], "status": "Active"}, {"email": "Jim@a1designservices.co.uk", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Jim Thomas", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Fax"}], "status": "Active"}, {"email": "Jullian@a1designservices.co.uk", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Jullian Plawsworth", "phone": [{"number": "0151 349 3939", "type": "Landline"}, {"number": "0151 349 3940", "type": "Fax"}], "status": "Active"}], "customerName": "A1 Design Services", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "A1D001", "modifiedDate": "2022-10-14T09:35:53Z", "phone": "01742 876 234", "registrationNumber": "", "sourceModifiedDate": "2022-04-27T15:17:36Z", "status": "Active", "taxNumber": "GB238 3839 38"} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Blackpool", "country": "GB", "line1": "67a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Delivery"}, {"city": "Manchester", "country": "GB", "line1": "23a Union Street", "line2": "", "postalCode": "M2 6JK", "region": "", "type": "Delivery"}, {"city": "Blackpool", "country": "GB", "line1": "67a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Unknown"}], "contactName": "Ian Cairns", "contacts": [], "customerName": "A1 Design Services", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "A1D001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:41Z", "phone": "01742 876 234", "sourceModifiedDate": "2022-11-25T09:43:54Z", "status": "Active", "taxNumber": "GB238 3839 38"} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Aruba City", "country": "Aruba (AW)", "line1": "Aruba Address line 1", "line2": "Aruba Address line 2", "postalCode": "Aruba Post", "region": "Aruba Province", "type": "Billing"}], "contactName": "Main Contact", "contacts": [{"modifiedDate": "2022-10-23T00:00:00Z", "phone": [{"number": "contact mobile number", "type": "Mobile"}, {"number": "contact fax number", "type": "Fax"}], "status": "Unknown"}], "customerName": "100 test name", "defaultCurrency": "GBP", "emailAddress": "email@codat.io", "id": "260f6a3f94a243738f2d5e08496a41a8", "modifiedDate": "2022-10-24T14:52:54Z", "phone": "contact phone number", "sourceModifiedDate": "2021-05-10T16:31:51Z", "status": "Active"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Albuquerque", "country": "United States", "line1": "155 Westend Point", "line2": "", "postalCode": "87140", "region": "NM", "type": "Unknown"}], "contactName": "Yuna Conn", "contacts": [{"address": {"city": "Albuquerque", "country": "United States", "line1": "155 Westend Point", "line2": "", "postalCode": "87140", "region": "NM", "type": "Unknown"}, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Conn, Yuna", "phone": [{"number": "520-393-4468", "type": "Primary"}], "status": "Unknown"}], "customerName": "33Across", "defaultCurrency": "USD", "id": "188", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:21Z", "phone": "520-393-4468", "sourceModifiedDate": "2022-09-06T12:58:27", "status": "Active", "taxNumber": ""} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [], "contactName": "", "contacts": [], "customerName": "ABC Textiles", "defaultCurrency": "USD", "emailAddress": "c.taylor@codat.io", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O0N1c3RvbWVyOjMyMzkzNTA4", "modifiedDate": "2022-11-16T18:15:30Z", "sourceModifiedDate": "2019-10-17T07:59:04Z", "status": "Active"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [], "contacts": [], "customerName": "24 Locks", "defaultCurrency": "USD", "emailAddress": "", "id": "e4c9d0e2-c285-4e85-b579-6d28b180c730", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:35:10Z", "sourceModifiedDate": "2023-02-17T18:03:42", "status": "Active"} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "200": + application/json: {"addresses": [], "contactName": "Contact (First Name) Contact (Last Name)", "contacts": [{"email": "contactperson@whateveryouwantidontcare12345.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Contact (First Name) Contact (Last Name)", "phone": [{"number": "Work Phone", "type": "Landline"}, {"number": "Mobile", "type": "Mobile"}], "status": "Active"}], "customerName": "A B", "defaultCurrency": "GBP", "emailAddress": "contactperson@whateveryouwantidontcare12345.com", "id": "104957000000032105", "modifiedDate": "2022-10-03T08:40:37Z", "phone": "Work Phone", "sourceModifiedDate": "2022-06-09T14:36:47", "status": "Active"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-customer-attachment: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customerId: "" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounting-customers: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Fernandohaven", "country": "United Kingdom", "line1": "Suite 214", "line2": "8439 Lueilwitz Passage", "postalCode": "JG04 7PV", "region": "Northern Ireland", "type": "Delivery"}, {"city": "Juliochester", "country": "United Kingdom", "line1": "Suite 096", "line2": "864 Halie Course", "postalCode": "DZ8 4BF", "region": "England", "type": "Delivery"}, {"city": "Naderborough", "country": "United Kingdom", "line1": "Suite 001", "line2": "416 Stokes Fords", "postalCode": "XG25 0XX", "region": "Wales", "type": "Delivery"}], "contactName": "Werner Langworth", "contacts": [{"address": {"city": "Hortenseville", "country": "United Kingdom", "line1": "Apt. 145", "line2": "317 Williamson Freeway", "postalCode": "CV4 2HR", "region": "Scotland", "type": "Delivery"}, "email": "Werner_Langworth@hotmail.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Werner Langworth", "phone": [], "status": "Active"}, {"address": {"city": "South Ali", "country": "United Kingdom", "line1": "Suite 075", "line2": "9921 Dickens Walk", "postalCode": "TI04 4OO", "region": "Scotland", "type": "Delivery"}, "email": "Belle51@yahoo.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Belle Glover", "phone": [], "status": "Active"}], "customerName": "Arjun Kuvalis", "defaultCurrency": "GBP", "emailAddress": "Arjun34@hotmail.com", "id": "c8180244-74ac-40cf-a5df-6d83661c44d7", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:16Z", "phone": "014605 64820", "registrationNumber": "NI7JEJVM", "sourceModifiedDate": "2022-07-03T01:27:00", "status": "Active", "taxNumber": "7505220209.583549"}, {"addresses": [{"city": "East Khalid", "country": "United Kingdom", "line1": "Apt. 184", "line2": "60578 Louie Springs", "postalCode": "XW89 7NT", "region": "Wales", "type": "Billing"}], "contactName": "Miguel Hahn", "contacts": [{"address": {"city": "Reingerton", "country": "United Kingdom", "line1": "Suite 400", "line2": "21930 Milan Lane", "postalCode": "QG10 2DL", "region": "Wales", "type": "Delivery"}, "email": "Miguel.Hahn@gmail.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Miguel Hahn", "phone": [{"number": "018555 09614", "type": "Landline"}], "status": "Active"}], "customerName": "Breitenberg, Emard and Schiller", "defaultCurrency": "GBP", "emailAddress": "contact@BreitenbergEmardandSchiller.biz", "id": "6d162ee4-47b4-46c6-a2e6-aa9edd0fe6b0", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:16Z", "phone": "0800 445 6957", "registrationNumber": "KME0AMIL", "sourceModifiedDate": "2022-12-03T11:05:01", "status": "Archived", "taxNumber": "8560920952.553111"}], "totalResults": 20} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "", "country": "", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "contactName": "", "contacts": [{"address": {"city": "", "country": "", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}, "email": "", "modifiedDate": "2022-10-23T00:00:00Z", "name": "", "phone": [], "status": "Active"}], "customerName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "0e2f7751-7696-ed11-bff5-6045bd0d2ad6", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "phone": "", "sourceModifiedDate": "2023-01-17T14:50:54Z", "status": "Active", "taxNumber": ""}, {"addresses": [{"city": "", "country": "GB", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "contactName": "", "contacts": [{"address": {"city": "", "country": "GB", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}, "email": "", "modifiedDate": "2022-10-23T00:00:00Z", "name": "", "phone": [], "status": "Active"}], "customerName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "0ef95175-48c4-eb11-9f0a-0022481b4343", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "phone": "", "sourceModifiedDate": "2021-06-03T08:48:36Z", "status": "Active", "taxNumber": ""}], "totalResults": 42} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"country": "NL", "type": "Billing"}], "contacts": [], "customerName": "Ab Netherlands", "defaultCurrency": "EUR", "id": "555f8251-c65a-433a-a813-5dbe04321d1e", "modifiedDate": "2022-10-26T13:32:05Z", "sourceModifiedDate": "2021-06-14T15:26:37Z", "status": "Active"}, {"addresses": [{"country": "NL", "type": "Billing"}], "contacts": [], "customerName": "anna test 2", "defaultCurrency": "EUR", "id": "9fd1f78e-67aa-4af7-8a10-df1fc5fb5841", "modifiedDate": "2022-10-26T13:32:05Z", "sourceModifiedDate": "2022-05-24T11:53:21Z", "status": "Active"}], "totalResults": 71} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "London", "country": "GB", "line1": "Ink Rooms", "postalCode": "WC1X 0BE", "type": "Billing"}], "contacts": [], "customerName": "Abdi 99", "defaultCurrency": "GBP", "emailAddress": "email@codat.io", "id": "5f20075a-a28e-434d-81a6-2db0dc170e87", "modifiedDate": "2022-10-26T13:33:08Z", "registrationNumber": "123456789", "sourceModifiedDate": "2020-02-26T11:23:50Z", "status": "Active", "taxNumber": "GB339 0727 47"}, {"addresses": [{"country": "GB", "type": "Billing"}], "contactName": "abeee", "contacts": [{"address": {"country": "GB ", "line1": "", "type": "Unknown"}, "modifiedDate": "2020-02-24T12:00:51.027Z", "name": "abeee", "phone": [], "status": "Active"}], "customerName": "Abdulbasit Al-haj", "defaultCurrency": "GBP", "emailAddress": "a.alhaj@codat.io", "id": "1d9dc1a7-92d6-441b-93fd-42c9fb321b1c", "modifiedDate": "2022-10-26T13:33:08Z", "sourceModifiedDate": "2020-02-24T12:00:50Z", "status": "Active"}], "totalResults": 53} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Test 1", "contacts": [{"address": {"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Test 1", "phone": [], "status": "Unknown"}], "customerName": "-", "defaultCurrency": "GBP", "id": "11526230", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sourceModifiedDate": "2023-04-17T06:02:46Z", "status": "Active"}, {"addresses": [{"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Test 1", "contacts": [{"address": {"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Test 1", "phone": [], "status": "Unknown"}], "customerName": "-", "defaultCurrency": "GBP", "id": "9677150", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sourceModifiedDate": "2023-04-24T06:19:23Z", "status": "Active"}], "totalResults": 159} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Some city", "country": "Country 1", "line1": "Line 1", "line2": "Line 2", "postalCode": "SW1 2JQ", "region": "A region", "type": "Billing"}], "contactName": "test person name", "contacts": [{"email": "test14A@example.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "test person1", "phone": [{"number": "24681012", "type": "Primary"}, {"number": "121086420", "type": "Unknown"}], "status": "Active"}, {"email": "test14B@example.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "test person2", "phone": [{"number": "1234 56789", "type": "Primary"}, {"number": "9876 54321", "type": "Unknown"}], "status": "Active"}, {"email": "test14@example.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "test person name", "phone": [{"number": "01876 541245", "type": "Unknown"}], "status": "Active"}], "customerName": "A test customer 14 (updated)", "defaultCurrency": "GBP", "emailAddress": "test14@example.com", "id": "634509", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "phone": "01876 541245", "sourceModifiedDate": "2022-05-18T09:23:56", "status": "Active"}, {"addresses": [{"city": "Some city", "country": "Country 1", "line1": "Line 1", "line2": "Line 2", "postalCode": "SW1 2JQ", "region": "A region", "type": "Billing"}], "contactName": "test person name", "contacts": [{"email": "test9@example.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "test person1", "phone": [{"number": "24681012", "type": "Primary"}, {"number": "121086420", "type": "Unknown"}], "status": "Active"}, {"email": "test10@example.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "test person2", "phone": [{"number": "123456789", "type": "Primary"}, {"number": "987654321", "type": "Unknown"}], "status": "Active"}, {"email": "test8@example.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "test person name", "phone": [{"number": "01876 541245", "type": "Unknown"}], "status": "Active"}], "customerName": "A test customer name 2", "defaultCurrency": "GBP", "emailAddress": "test8@example.com", "id": "634486", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "phone": "01876 541245", "sourceModifiedDate": "2022-05-11T11:39:58", "status": "Active"}], "totalResults": 39} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "", "contacts": [{"email": "", "modifiedDate": "2022-10-23T00:00:00Z", "name": "", "phone": [], "status": "Active"}], "customerName": "Chekko Customer Test 01", "defaultCurrency": "GBP", "emailAddress": "", "id": "92227673", "modifiedDate": "2022-09-30T10:29:15Z", "phone": "", "sourceModifiedDate": "0001-01-01T00:00:00", "status": "Active", "taxNumber": ""}, {"addresses": [{"city": "Billing line 4", "country": "United Kingdom", "line1": "Billing Address", "line2": "Billing line 2 Billing line 3", "postalCode": "123321", "type": "Billing"}, {"city": "Delivery line4", "country": "United Kingdom", "line1": "Delivery Address", "line2": "Delivery line2 Delivery line3", "postalCode": "123321", "type": "Delivery"}], "contactName": "Mr Diogo Sousa", "contacts": [{"address": {"city": "Billing line 4", "country": "United Kingdom", "line1": "Billing Address", "line2": "Billing line 2 Billing line 3", "postalCode": "123321", "type": "Billing"}, "email": "diogomail@mail.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Mr Diogo Sousa", "phone": [{"number": "123123123", "type": "Landline"}, {"number": "321321321", "type": "Mobile"}], "status": "Active"}, {"address": {"city": "Delivery line4", "country": "United Kingdom", "line1": "Delivery Address", "line2": "Delivery line2 Delivery line3", "postalCode": "123321", "type": "Delivery"}, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Mr Diogo Sousa", "phone": [], "status": "Active"}], "customerName": "Diogo Sousa", "defaultCurrency": "EUR", "emailAddress": "diogomail@mail.com", "id": "88459410", "modifiedDate": "2022-09-30T10:29:15Z", "phone": "123123123", "sourceModifiedDate": "2021-05-04T13:22:19", "status": "Active", "taxNumber": ""}], "totalResults": 10} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "Mr Test Customer", "contacts": [], "customerName": "119 Test Customer", "defaultCurrency": "GBP", "id": "773", "modifiedDate": "2023-01-30T14:48:02Z", "sourceModifiedDate": "2022-01-11T12:28:49", "status": "Active"}, {"addresses": [], "contactName": "European Company", "contacts": [], "customerName": "1248 European Company", "defaultCurrency": "GBP", "id": "172722", "modifiedDate": "2023-01-30T14:48:02Z", "sourceModifiedDate": "2022-07-27T14:29:16", "status": "Active"}], "totalResults": 4} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Bayshore", "line1": "Kristy Abercrombie", "line2": "5647 Cypress Hill Rd", "postalCode": "94326", "region": "CA", "type": "Delivery"}, {"city": "Bayshore", "line1": "Kristy Abercrombie", "line2": "5647 Cypress Hill Rd", "postalCode": "94326", "region": "CA", "type": "Billing"}], "contactName": "Kristy Abercrombie", "contacts": [{"email": "kristy@samplename.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Abercrombie, Kristy", "phone": [{"number": "415-555-6579", "type": "Primary"}], "status": "Active"}, {"modifiedDate": "2022-10-23T00:00:00Z", "name": "Kristy Abercrombie", "phone": [], "status": "Active"}, {"modifiedDate": "2022-10-23T00:00:00Z", "name": "Steve Darcangelo", "phone": [], "status": "Active"}], "customerName": "Abercrombie, Kristy", "defaultCurrency": "GBP", "emailAddress": "kristy@samplename.com", "id": "150000-933272658", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:07:55Z", "phone": "415-555-6579", "sourceModifiedDate": "2023-12-16T05:06:42", "status": "Active"}, {"addresses": [{"city": "Millbrae", "line1": "Robert Allard", "line2": "92834 Chandler St.", "postalCode": "94030", "region": "CA", "type": "Delivery"}, {"city": "Millbrae", "line1": "Robert Allard", "line2": "92834 Chandler St.", "postalCode": "94030", "region": "CA", "type": "Billing"}], "contactName": "Amanda Roberts", "contacts": [{"email": "rallard@myemail.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Allard, Robert", "phone": [{"number": "650-555-3422", "type": "Primary"}, {"number": "650-555-9804", "type": "Fax"}, {"number": "650-555-8349", "type": "Unknown"}], "status": "Active"}, {"modifiedDate": "2022-10-23T00:00:00Z", "name": "Robert Allard", "phone": [], "status": "Active"}, {"modifiedDate": "2022-10-23T00:00:00Z", "name": "Rachel Fisher", "phone": [], "status": "Active"}], "customerName": "Allard, Robert", "defaultCurrency": "GBP", "emailAddress": "rallard@myemail.com", "id": "800000D0-1182061376", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:07:55Z", "phone": "650-555-3422", "sourceModifiedDate": "2023-12-16T05:06:42", "status": "Active"}], "totalResults": 64} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "Abraham's Company", "contacts": [{"email": "ab@email.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Abe", "phone": [{"number": "01111111111", "type": "Mobile"}], "status": "Active"}], "customerName": "Abe", "defaultCurrency": "GBP", "emailAddress": "ab@email.com", "id": "9", "modifiedDate": "2023-01-18T11:02:35Z", "registrationNumber": "XXXX9900001", "sourceModifiedDate": "2022-12-08T15:42:59Z", "status": "Active", "taxNumber": "XXXX9900001"}, {"addresses": [{"city": "London", "country": "United Kingdom", "line1": "4 Privet Drive", "postalCode": "WD25 7LR", "type": "Billing"}, {"city": "London", "country": "United Kingdom", "line1": "4 Privet Drive", "postalCode": "WD25 7LR", "type": "Delivery"}], "contactName": "Adeel test", "contacts": [{"address": {"city": "London", "country": "United Kingdom", "line1": "4 Privet Drive", "postalCode": "WD25 7LR", "type": "Billing"}, "email": "adeel@adeel.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Adeel test", "phone": [{"number": "123456789", "type": "Primary"}, {"number": "07546543216", "type": "Mobile"}], "status": "Active"}], "customerName": "adeel qbo child test", "defaultCurrency": "GBP", "emailAddress": "adeel@adeel.com", "id": "49", "modifiedDate": "2023-01-18T11:02:35Z", "phone": "123456789", "sourceModifiedDate": "2022-08-22T09:21:09Z", "status": "Active"}], "totalResults": 40} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "New York, NY", "line1": "123 Main St", "type": "Billing"}], "contactName": "Kristy Abercrombie", "contacts": [{"address": {"city": "New York, NY", "line1": "123 Main St", "type": "Billing"}, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Abercrombie International Group (deleted)", "phone": [], "status": "Archived"}], "customerName": "Abercrombie International Group", "defaultCurrency": "GBP", "id": "66", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:56Z", "sourceModifiedDate": "2016-09-12T18:53:19Z", "status": "Archived"}, {"addresses": [{"type": "Billing"}, {"type": "Delivery"}], "contactName": "Natalie Watts", "contacts": [{"address": {"type": "Billing"}, "email": "n.watts@google.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Abercrombie International Group", "phone": [], "status": "Active"}], "customerName": "Abercrombie International Group", "defaultCurrency": "USD", "emailAddress": "n.watts@google.com", "id": "67", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:56Z", "registrationNumber": "XXXXVat123456", "sourceModifiedDate": "2023-03-29T01:12:55Z", "status": "Active", "taxNumber": "XXXXVat123456"}], "totalResults": 243} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Blackpool", "country": "", "line1": "67a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Delivery"}, {"city": "Manchester", "country": "", "line1": "23a Union Street", "line2": "", "postalCode": "M2 6JK", "region": "", "type": "Delivery"}, {"city": "Blackpool", "country": "Great Britain", "line1": "67a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Billing"}], "contactName": "Lee Dalkin", "contacts": [{"email": "newbusinessadvice@sage.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Lee Dalkin", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Landline"}, {"number": "01742 876 236", "type": "Fax"}], "status": "Active"}, {"email": "", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Malcolm Leverret", "phone": [], "status": "Active"}, {"email": "Jim@a1designservices.co.uk", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Jim Thomas", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Fax"}], "status": "Active"}, {"email": "Jullian@a1designservices.co.uk", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Jullian Plawsworth", "phone": [{"number": "0151 349 3939", "type": "Landline"}, {"number": "0151 349 3940", "type": "Fax"}], "status": "Active"}], "customerName": "A1 Design Services", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "A1D001", "modifiedDate": "2022-10-14T09:35:53Z", "phone": "01742 876 234", "registrationNumber": "", "sourceModifiedDate": "2022-04-27T15:17:36Z", "status": "Active", "taxNumber": "GB238 3839 38"}, {"addresses": [{"city": "Blackpool", "country": "Great Britain", "line1": "77a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Billing"}], "contactName": "Lee Dalkin", "contacts": [{"email": "newbusinessadvice@sage.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Lee Dalkin", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Landline"}, {"number": "01742 876 236", "type": "Fax"}], "status": "Active"}, {"email": "", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Malcolm Leverret", "phone": [], "status": "Active"}, {"email": "Jim@a1designservices.co.uk", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Jim Thomas", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Fax"}], "status": "Active"}, {"email": "Jullian@a1designservices.co.uk", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Jullian Plawsworth", "phone": [{"number": "0151 349 3939", "type": "Landline"}, {"number": "0151 349 3940", "type": "Fax"}], "status": "Active"}], "customerName": "A2 Design Services", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "A1D002", "modifiedDate": "2022-10-14T09:35:53Z", "phone": "01742 876 234", "registrationNumber": "", "sourceModifiedDate": "2020-09-23T10:28:58Z", "status": "Active", "taxNumber": "GB238 3839 40"}], "totalResults": 43} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Blackpool", "country": "GB", "line1": "67a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Delivery"}, {"city": "Manchester", "country": "GB", "line1": "23a Union Street", "line2": "", "postalCode": "M2 6JK", "region": "", "type": "Delivery"}, {"city": "Blackpool", "country": "GB", "line1": "67a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Unknown"}], "contactName": "Ian Cairns", "contacts": [], "customerName": "A1 Design Services", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "A1D001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:41Z", "phone": "01742 876 234", "sourceModifiedDate": "2022-11-25T09:43:54Z", "status": "Active", "taxNumber": "GB238 3839 38"}, {"addresses": [{"city": "Whitley Bay", "country": "GB", "line1": "Swanson Industries", "line2": "Dukes Industrial Estate", "postalCode": "NE56 4ER", "region": "North Tyneside", "type": "Delivery"}, {"city": "Hebburn", "country": "GB", "line1": "Unit 34", "line2": "Holystone Ind Estate", "postalCode": "NE31 1VB", "region": "Tyne & Wear", "type": "Delivery"}, {"city": "Hebburn", "country": "GB", "line1": "Unit 34", "line2": "Holystone Ind Estate", "postalCode": "NE31 1VB", "region": "Tyne & Wear", "type": "Unknown"}], "contactName": "Mike Hall", "contacts": [], "customerName": "ABS Garages Ltd", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "ABS001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:41Z", "phone": "0191 254 5909", "sourceModifiedDate": "2022-11-25T09:43:54Z", "status": "Active", "taxNumber": "GB745 4584 68"}], "totalResults": 30} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Aruba City", "country": "Aruba (AW)", "line1": "Aruba Address line 1", "line2": "Aruba Address line 2", "postalCode": "Aruba Post", "region": "Aruba Province", "type": "Billing"}], "contactName": "Main Contact", "contacts": [{"modifiedDate": "2022-10-23T00:00:00Z", "phone": [{"number": "contact mobile number", "type": "Mobile"}, {"number": "contact fax number", "type": "Fax"}], "status": "Unknown"}], "customerName": "100 test name", "defaultCurrency": "GBP", "emailAddress": "email@codat.io", "id": "260f6a3f94a243738f2d5e08496a41a8", "modifiedDate": "2022-10-24T14:52:54Z", "phone": "contact phone number", "sourceModifiedDate": "2021-05-10T16:31:51Z", "status": "Active"}, {"addresses": [{"city": "POST - Aruba City", "country": "Aruba (AW)", "line1": "POST - Aruba Address line 1", "line2": "POST - Aruba Address line 2", "postalCode": "Aruba Post", "region": "Aruba Province", "type": "Billing"}], "contactName": "Main Contact", "contacts": [], "customerName": "100 test name DS", "defaultCurrency": "GBP", "emailAddress": "DCemail@codat.io", "id": "44a5d9461d9e4f6d90a5ace251c5cf35", "modifiedDate": "2022-10-24T14:52:54Z", "phone": "contact phone number", "sourceModifiedDate": "2021-06-10T14:22:46Z", "status": "Active"}], "totalResults": 168} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Albuquerque", "country": "United States", "line1": "155 Westend Point", "line2": "", "postalCode": "87140", "region": "NM", "type": "Unknown"}], "contactName": "Yuna Conn", "contacts": [{"address": {"city": "Albuquerque", "country": "United States", "line1": "155 Westend Point", "line2": "", "postalCode": "87140", "region": "NM", "type": "Unknown"}, "modifiedDate": "2022-10-23T00:00:00Z", "name": "Conn, Yuna", "phone": [{"number": "520-393-4468", "type": "Primary"}], "status": "Unknown"}], "customerName": "33Across", "defaultCurrency": "USD", "id": "188", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:21Z", "phone": "520-393-4468", "sourceModifiedDate": "2022-09-06T12:58:27", "status": "Active", "taxNumber": ""}, {"addresses": [{"city": "Sparwood", "country": "Canada", "line1": "7 Lerdahl Junction", "line2": "", "postalCode": "L4R", "region": "British Columbia", "type": "Unknown"}], "contactName": "Lauri O'Heagertie", "contacts": [{"address": {"city": "Sparwood", "country": "Canada", "line1": "7 Lerdahl Junction", "line2": "", "postalCode": "L4R", "region": "British Columbia", "type": "Unknown"}, "modifiedDate": "2022-10-23T00:00:00Z", "name": "O'Heagertie, Lauri", "phone": [{"number": "410-309-3976", "type": "Primary"}], "status": "Unknown"}], "customerName": "3Way International Logistics", "defaultCurrency": "CAD", "id": "324", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:21Z", "phone": "410-309-3976", "sourceModifiedDate": "2020-10-20T05:01:49", "status": "Active", "taxNumber": ""}], "totalResults": 530} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "", "contacts": [], "customerName": "ABC Textiles", "defaultCurrency": "USD", "emailAddress": "c.taylor@codat.io", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O0N1c3RvbWVyOjMyMzkzNTA4", "modifiedDate": "2022-11-16T18:15:30Z", "sourceModifiedDate": "2019-10-17T07:59:04Z", "status": "Active"}, {"addresses": [{"city": "Coffee City", "country": "United Kingdom", "line1": "11 Coffee Lane", "line2": "Coffee Town", "postalCode": "CC1 1CC", "region": "Hampshire", "type": "Billing"}], "contactName": "Coffee Carl", "contacts": [{"modifiedDate": "2022-10-23T00:00:00Z", "name": "Coffee Carl", "phone": [{"number": "07733", "type": "Mobile"}], "status": "Active"}], "customerName": "Coffee Cart", "defaultCurrency": "GBP", "emailAddress": "coffee.cart@example.com", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O0N1c3RvbWVyOjM3MTUzNDI2", "modifiedDate": "2022-11-16T18:15:30Z", "phone": "0201111", "sourceModifiedDate": "2020-03-17T19:12:39Z", "status": "Active"}], "totalResults": 10} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contacts": [], "customerName": "24 Locks", "defaultCurrency": "USD", "emailAddress": "", "id": "e4c9d0e2-c285-4e85-b579-6d28b180c730", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:35:10Z", "sourceModifiedDate": "2023-02-17T18:03:42", "status": "Active"}, {"addresses": [], "contacts": [], "customerName": "7-Eleven", "defaultCurrency": "GBP", "emailAddress": "", "id": "bab779bc-c5fb-42cb-a888-953e8309711c", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:35:10Z", "sourceModifiedDate": "2023-02-17T18:03:42", "status": "Active"}], "totalResults": 48} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "Contact (First Name) Contact (Last Name)", "contacts": [{"email": "contactperson@whateveryouwantidontcare12345.com", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Contact (First Name) Contact (Last Name)", "phone": [{"number": "Work Phone", "type": "Landline"}, {"number": "Mobile", "type": "Mobile"}], "status": "Active"}], "customerName": "A B", "defaultCurrency": "GBP", "emailAddress": "contactperson@whateveryouwantidontcare12345.com", "id": "104957000000032105", "modifiedDate": "2022-10-03T08:40:37Z", "phone": "Work Phone", "sourceModifiedDate": "2022-06-09T14:36:47", "status": "Active"}, {"addresses": [], "contactName": "John Doe", "contacts": [{"email": "", "modifiedDate": "2022-10-23T00:00:00Z", "name": "John Doe", "phone": [], "status": "Active"}], "customerName": "Doe, John", "defaultCurrency": "GBP", "emailAddress": "", "id": "104957000000054050", "modifiedDate": "2022-10-03T08:40:37Z", "sourceModifiedDate": "2022-09-28T15:09:22", "status": "Active"}], "totalResults": 14} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + list-accounting-customer-attachments: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customerId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + download-accounting-direct-income-attachment: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directIncomeId: "" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-direct-income: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directIncomeId: "" + responses: + "200": + application/json: {"contactRef": {"dataType": "customers", "id": "51f03576-f6b0-40d5-9fba-81a490411c03"}, "currency": "GBP", "currencyRate": 1, "id": "38e8c917-0afc-4583-8ffe-1b53ad601197", "issueDate": "2022-04-19T00:00:00", "lineItems": [{"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Yard Gully", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "00491160-6ee5-4d76-9f34-998f00687481", "name": "Aluminium Silt Bucket"}, "quantity": 1, "subTotal": 171.21, "taxAmount": 17.12, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 188.33, "trackingCategoryRefs": [], "unitAmount": 171.21}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18Z", "note": "Direct Income with 1 line items, totaling 188.33", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-04-19T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -188.33}, "payment": {"accountRef": {"id": "ff8fdc4c-2aad-4ec1-9430-6bd201832eb3", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "id": "38e8c917-0afc-4583-8ffe-1b53ad601197", "note": "Payment for direct income 38e8c917-0afc-4583-8ffe-1b53ad601197", "paidOnDate": "2022-04-19T00:00:00", "reference": "Direct Income 38e8c917-0afc-4583-8ffe-1b53ad601197", "totalAmount": 188.33}}], "reference": "3cb8ced3-3ecb-4974-ada5-8290b0ec3355", "sourceModifiedDate": "2022-05-13T01:06:00", "subTotal": 171.21, "taxAmount": 17.12, "totalAmount": 188.33} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directIncomeId: "" + responses: + "200": + application/json: {"currency": "USD", "currencyRate": 0.648364486, "id": "8be30162-feec-ec11-82f9-000d3a8746a9", "issueDate": "2022-06-18T00:00:00", "lineItems": [{"accountRef": {"id": "221217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Interest Income"}, "description": "Interest Income", "quantity": 1, "subTotal": 7.13, "taxAmount": 1.43, "taxRateRef": {"effectiveTaxRate": 10, "id": "63bc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for DOMESTIC / STANDARD"}, "totalAmount": 8.56, "trackingCategoryRefs": [{"id": "adbc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "ADM-Administration"}], "unitAmount": 7.13}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "4006", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-06-18T00:00:00", "currency": "USD", "currencyRate": 0.6483644859813084, "totalAmount": 8.56}, "payment": {"accountRef": {"id": "8277672c-b8e6-ec11-82f8-0022481a77f0", "name": "B020-BoA"}, "currency": "USD", "currencyRate": 0.6483644859813084, "id": "8be30162-feec-ec11-82f9-000d3a8746a9", "paidOnDate": "2022-06-18T00:00:00", "totalAmount": 8.56}}], "reference": "B1234", "sourceModifiedDate": "2022-06-15T22:56:26Z", "subTotal": 7.13, "taxAmount": 1.43, "totalAmount": 8.56} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directIncomeId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "id": "344673327", "issueDate": "2017-11-01T00:00:00", "lineItems": [{"accountRef": {"id": "001", "name": "Sales"}, "description": "Test Transaction 2", "quantity": 1, "subTotal": 10.5, "taxAmount": 0, "totalAmount": 10.5, "trackingCategoryRefs": [], "unitAmount": 10.5}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:20:36Z", "note": "Test Transaction 2", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2017-11-01T00:00:00", "currency": "GBP", "totalAmount": 10.5}, "payment": {"accountRef": {"id": "750-1", "name": "Bank Account: Business Current Account"}, "currency": "GBP", "id": "344673327", "note": "Test Transaction 2", "paidOnDate": "2017-11-01T00:00:00", "totalAmount": 10.5}}], "sourceModifiedDate": "2022-10-06T10:38:24Z", "subTotal": 10.5, "taxAmount": 0, "totalAmount": 10.5} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directIncomeId: "" + responses: + "200": + application/json: {"contactRef": {"dataType": "customers", "id": "280000-933272658"}, "currency": "GBP", "currencyRate": 1, "id": "9B87-1181931723", "issueDate": "2023-01-15T00:00:00", "lineItems": [{"accountRef": {"id": "80000-933270541", "name": "Undeposited Funds"}, "quantity": 1, "subTotal": 1228.18, "taxAmount": 0, "totalAmount": 1228.18, "trackingCategoryRefs": [], "unitAmount": 1228.18}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:14:12Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2023-01-15T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 1228.18}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "9B87-1181931723", "paidOnDate": "2023-01-15T00:00:00", "totalAmount": 1228.18}}], "reference": "9C08-1181931827", "sourceModifiedDate": "2023-12-16T05:06:23", "subTotal": 1228.18, "taxAmount": 0, "totalAmount": 1228.18} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directIncomeId: "" + responses: + "200": + application/json: {"contactRef": {"dataType": "suppliers", "id": "52"}, "currency": "GBP", "currencyRate": 1, "id": "5-1", "issueDate": "2015-11-24T00:00:00", "lineItems": [{"accountRef": {"id": "61", "name": "Owner's Equity - Contributions"}, "description": "contribution to start business", "discountAmount": 0, "quantity": 1, "subTotal": 10000, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "2_Invoices", "name": "Exempt Invoices"}, "totalAmount": 10000, "trackingCategoryRefs": [], "unitAmount": 10000}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:04Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2015-11-24T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -10000}, "payment": {"accountRef": {"id": "81", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "id": "5-1", "paidOnDate": "2015-11-24T00:00:00", "totalAmount": 10000}}], "sourceModifiedDate": "2016-09-12T15:26:26Z", "subTotal": 10000, "taxAmount": 0, "totalAmount": 10000} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directIncomeId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "id": "1", "issueDate": "2018-09-21T00:00:00", "lineItems": [{"accountRef": {"id": "53", "name": "Retained profit balance forward account"}, "discountAmount": 0, "quantity": 1, "subTotal": 170.23, "taxAmount": 0, "totalAmount": 170.23, "trackingCategoryRefs": [], "unitAmount": 170.23}], "modifiedDate": "2023-01-18T11:02:50Z", "note": "Opening Balance from Bank", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2018-09-21T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -170.23}, "payment": {"accountRef": {"id": "61", "name": "Dave PP Current"}, "currency": "GBP", "currencyRate": 1, "id": "1", "paidOnDate": "2018-09-21T00:00:00", "totalAmount": 170.23}}], "sourceModifiedDate": "2018-12-17T14:56:20Z", "subTotal": 170.23, "taxAmount": 0, "totalAmount": 170.23} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directIncomeId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "id": "4973", "issueDate": "2022-03-15T00:00:00", "lineItems": [{"accountRef": {"id": "151", "name": "Cash"}, "description": "Dt test line1", "quantity": 1, "subTotal": 125, "taxAmount": 25, "taxRateRef": {"effectiveTaxRate": 20, "id": "99", "name": "UK Sale Goods Standard Rate"}, "totalAmount": 150, "trackingCategoryRefs": [{"id": "DEPARTMENT-1", "name": "Sales"}, {"id": "LOCATION-8", "name": "United Kingdom"}], "unitAmount": 125}, {"accountRef": {"id": "152", "name": "Cash Equivalents"}, "description": "dt test line 2", "quantity": 1, "subTotal": 166.67, "taxAmount": 33.33, "taxRateRef": {"effectiveTaxRate": 20, "id": "99", "name": "UK Sale Goods Standard Rate"}, "totalAmount": 200, "trackingCategoryRefs": [{"id": "DEPARTMENT-2", "name": "Services"}, {"id": "LOCATION-8", "name": "United Kingdom"}], "unitAmount": 166.67}], "modifiedDate": "2022-10-28T11:10:26Z", "note": "dt header description", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-03-15T00:00:00", "currency": "GBP", "totalAmount": 350}, "payment": {"accountRef": {"id": "289", "name": "Checking 5 - Bank Of England"}, "currency": "GBP", "id": "4973", "note": "dt header description", "paidOnDate": "2022-03-15T00:00:00", "totalAmount": 350}}], "reference": "dt test contact", "sourceModifiedDate": "2022-03-15T12:45:58Z", "subTotal": 291.67, "taxAmount": 58.33, "totalAmount": 350} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directIncomeId: "" + responses: + "200": + application/json: {"contactRef": {"dataType": "customers", "id": "bc446de5-971e-48b5-8efd-1745149844ef"}, "currency": "GBP", "currencyRate": 1, "id": "3a1be853-5964-4afe-ad6a-fb89cbaf6606", "issueDate": "2023-02-14T00:00:00", "lineItems": [{"accountRef": {"id": "a40f43e2-c7b0-4187-919a-04ccdc14a630", "name": "Subscriptions"}, "description": "Long-term subscriber discount - refund on sub", "quantity": 1, "subTotal": 35, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "EXEMPTINPUT", "name": "Exempt Expenses"}, "totalAmount": 35, "trackingCategoryRefs": [], "unitAmount": 35}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2023-02-14T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 35}, "payment": {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "3a1be853-5964-4afe-ad6a-fb89cbaf6606", "paidOnDate": "2023-02-14T00:00:00", "totalAmount": 35}}], "reference": "Sub 098801", "sourceModifiedDate": "2011-04-11T00:45:38", "subTotal": 35, "taxAmount": 0, "totalAmount": 35} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directIncomeId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-direct-income-attachment: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directIncomeId: "" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: {} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounting-direct-incomes: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/connections/57b731ba-1d45-4386-ba58-2a1ca0234624/data/directIncomes?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/connections/57b731ba-1d45-4386-ba58-2a1ca0234624/data/directIncomes?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/connections/57b731ba-1d45-4386-ba58-2a1ca0234624/data/directIncomes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"contactRef": {"dataType": "customers", "id": "51f03576-f6b0-40d5-9fba-81a490411c03"}, "currency": "GBP", "currencyRate": 1, "id": "38e8c917-0afc-4583-8ffe-1b53ad601197", "issueDate": "2022-04-19T00:00:00", "lineItems": [{"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Yard Gully", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "00491160-6ee5-4d76-9f34-998f00687481", "name": "Aluminium Silt Bucket"}, "quantity": 1, "subTotal": 171.21, "taxAmount": 17.12, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 188.33, "trackingCategoryRefs": [], "unitAmount": 171.21}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18Z", "note": "Direct Income with 1 line items, totaling 188.33", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-04-19T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -188.33}, "payment": {"accountRef": {"id": "ff8fdc4c-2aad-4ec1-9430-6bd201832eb3", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "id": "38e8c917-0afc-4583-8ffe-1b53ad601197", "note": "Payment for direct income 38e8c917-0afc-4583-8ffe-1b53ad601197", "paidOnDate": "2022-04-19T00:00:00", "reference": "Direct Income 38e8c917-0afc-4583-8ffe-1b53ad601197", "totalAmount": 188.33}}], "reference": "3cb8ced3-3ecb-4974-ada5-8290b0ec3355", "sourceModifiedDate": "2022-05-13T01:06:00", "subTotal": 171.21, "taxAmount": 17.12, "totalAmount": 188.33}, {"contactRef": {"dataType": "customers", "id": "453ddfc0-49ce-4f66-a815-dae734be885c"}, "currency": "GBP", "currencyRate": 1, "id": "c31a3778-e3ea-4d01-9281-dd2f291c8cb8", "issueDate": "2022-04-19T00:00:00", "lineItems": [{"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Bottle Gullies 90 degree Rectangular", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "6", "name": "Back Inlet Roddable Gully 90� Outlet Rectangular Grid"}, "quantity": 2, "subTotal": 190.16, "taxAmount": 19.02, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 209.18, "trackingCategoryRefs": [{"id": "costcode_9", "name": "PandaConstruction"}, {"id": "department_3", "name": "MarshallBrotherContracting"}], "unitAmount": 95.08}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 778.93, "discountPercentage": 10.37, "itemRef": {"id": "51077072-d5c3-463b-9cb4-7da2e11886f9", "name": "150 Litre Grease Trap"}, "quantity": 6, "subTotal": 6732.41, "taxAmount": 673.24, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 7405.66, "trackingCategoryRefs": [], "unitAmount": 1251.89}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "22aee6bd-4767-48c4-8a13-fdf85b91fc80", "name": "600 Litre Grease Trap"}, "quantity": 2, "subTotal": 5563.88, "taxAmount": 556.39, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 6120.27, "trackingCategoryRefs": [], "unitAmount": 2781.94}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "22aee6bd-4767-48c4-8a13-fdf85b91fc80", "name": "600 Litre Grease Trap"}, "quantity": 6, "subTotal": 16691.64, "taxAmount": 1669.16, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 18360.8, "trackingCategoryRefs": [], "unitAmount": 2781.94}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18Z", "note": "Direct Income with 4 line items, totaling 32095.91", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-04-19T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -32095.91}, "payment": {"accountRef": {"id": "ff8fdc4c-2aad-4ec1-9430-6bd201832eb3", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "id": "c31a3778-e3ea-4d01-9281-dd2f291c8cb8", "note": "Payment for direct income c31a3778-e3ea-4d01-9281-dd2f291c8cb8", "paidOnDate": "2022-04-19T00:00:00", "reference": "Direct Income c31a3778-e3ea-4d01-9281-dd2f291c8cb8", "totalAmount": 32095.91}}], "reference": "ee4ea56f-8806-494d-9c69-7ec22e68dc5e", "sourceModifiedDate": "2023-02-13T00:34:00", "subTotal": 29178.09, "taxAmount": 2917.81, "totalAmount": 32095.91}], "totalResults": 518} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/directIncomes?page=1&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/directIncomes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "USD", "currencyRate": 0.648364486, "id": "8be30162-feec-ec11-82f9-000d3a8746a9", "issueDate": "2022-06-18T00:00:00", "lineItems": [{"accountRef": {"id": "221217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Interest Income"}, "description": "Interest Income", "quantity": 1, "subTotal": 7.13, "taxAmount": 1.43, "taxRateRef": {"effectiveTaxRate": 10, "id": "63bc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for DOMESTIC / STANDARD"}, "totalAmount": 8.56, "trackingCategoryRefs": [{"id": "adbc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "ADM-Administration"}], "unitAmount": 7.13}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "4006", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-06-18T00:00:00", "currency": "USD", "currencyRate": 0.6483644859813084, "totalAmount": 8.56}, "payment": {"accountRef": {"id": "8277672c-b8e6-ec11-82f8-0022481a77f0", "name": "B020-BoA"}, "currency": "USD", "currencyRate": 0.6483644859813084, "id": "8be30162-feec-ec11-82f9-000d3a8746a9", "paidOnDate": "2022-06-18T00:00:00", "totalAmount": 8.56}}], "reference": "B1234", "sourceModifiedDate": "2022-06-15T22:56:26Z", "subTotal": 7.13, "taxAmount": 1.43, "totalAmount": 8.56}, {"currency": "GBP", "currencyRate": 1, "id": "f68e56e0-b8bd-ed11-9a88-6045bd0f9361", "issueDate": "2023-03-07T00:00:00", "lineItems": [{"accountRef": {"id": "641217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Accounts Receivable"}, "description": "Accounts Receivable", "quantity": -1, "subTotal": -649.4, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "cc81fea8-2917-ed11-90eb-002248009df3", "name": ""}, "totalAmount": -649.4, "trackingCategoryRefs": [], "unitAmount": 649.4}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "4990", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2023-03-07T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -649.4}, "payment": {"accountRef": {"id": "b6545a08-a9bd-ed11-9a88-0022484358c7", "name": "HOLDING_LENDING"}, "currency": "GBP", "currencyRate": 1, "id": "f68e56e0-b8bd-ed11-9a88-6045bd0f9361", "paidOnDate": "2023-03-07T00:00:00", "totalAmount": -649.4}}], "reference": "B110", "sourceModifiedDate": "2023-03-08T13:55:34Z", "subTotal": -649.4, "taxAmount": 0, "totalAmount": -649.4}], "totalResults": 2} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/directIncomes?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/directIncomes?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/directIncomes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "id": "344673327", "issueDate": "2017-11-01T00:00:00", "lineItems": [{"accountRef": {"id": "001", "name": "Sales"}, "description": "Test Transaction 2", "quantity": 1, "subTotal": 10.5, "taxAmount": 0, "totalAmount": 10.5, "trackingCategoryRefs": [], "unitAmount": 10.5}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:20:36Z", "note": "Test Transaction 2", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2017-11-01T00:00:00", "currency": "GBP", "totalAmount": 10.5}, "payment": {"accountRef": {"id": "750-1", "name": "Bank Account: Business Current Account"}, "currency": "GBP", "id": "344673327", "note": "Test Transaction 2", "paidOnDate": "2017-11-01T00:00:00", "totalAmount": 10.5}}], "sourceModifiedDate": "2022-10-06T10:38:24Z", "subTotal": 10.5, "taxAmount": 0, "totalAmount": 10.5}, {"currency": "GBP", "currencyRate": 1, "id": "348104863", "issueDate": "2017-11-23T00:00:00", "lineItems": [{"accountRef": {"id": "001", "name": "Sales"}, "description": "Codat Ltd Ref: Nov Topup", "quantity": 1, "subTotal": 100, "taxAmount": 0, "totalAmount": 100, "trackingCategoryRefs": [], "unitAmount": 100}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:20:36Z", "note": "Codat Ltd Ref: Nov Topup", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2017-11-23T00:00:00", "currency": "GBP", "totalAmount": 100}, "payment": {"accountRef": {"id": "750-1", "name": "Bank Account: Business Current Account"}, "currency": "GBP", "id": "348104863", "note": "Codat Ltd Ref: Nov Topup", "paidOnDate": "2017-11-23T00:00:00", "totalAmount": 100}}], "sourceModifiedDate": "2022-10-24T12:13:27Z", "subTotal": 100, "taxAmount": 0, "totalAmount": 100}], "totalResults": 211} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/directIncomes?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/directIncomes?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/directIncomes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"contactRef": {"dataType": "customers", "id": "280000-933272658"}, "currency": "GBP", "currencyRate": 1, "id": "9B87-1181931723", "issueDate": "2023-01-15T00:00:00", "lineItems": [{"accountRef": {"id": "80000-933270541", "name": "Undeposited Funds"}, "quantity": 1, "subTotal": 1228.18, "taxAmount": 0, "totalAmount": 1228.18, "trackingCategoryRefs": [], "unitAmount": 1228.18}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:14:12Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2023-01-15T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 1228.18}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "9B87-1181931723", "paidOnDate": "2023-01-15T00:00:00", "totalAmount": 1228.18}}], "reference": "9C08-1181931827", "sourceModifiedDate": "2023-12-16T05:06:23", "subTotal": 1228.18, "taxAmount": 0, "totalAmount": 1228.18}, {"contactRef": {"dataType": "customers", "id": "800000B5-1197701259"}, "currency": "GBP", "currencyRate": 1, "id": "68E0-1197775239", "issueDate": "2023-01-17T00:00:00", "lineItems": [{"accountRef": {"id": "80000-933270541", "name": "Undeposited Funds"}, "quantity": 1, "subTotal": 361.08, "taxAmount": 0, "totalAmount": 361.08, "trackingCategoryRefs": [], "unitAmount": 361.08}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:14:12Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2023-01-17T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 361.08}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "68E0-1197775239", "paidOnDate": "2023-01-17T00:00:00", "totalAmount": 15281.67}}], "reference": "96F3-1197775718", "sourceModifiedDate": "2023-12-16T05:06:11", "subTotal": 361.08, "taxAmount": 0, "totalAmount": 361.08}], "totalResults": 104} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/directIncomes?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/directIncomes?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/directIncomes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"contactRef": {"dataType": "suppliers", "id": "52"}, "currency": "GBP", "currencyRate": 1, "id": "5-1", "issueDate": "2015-11-24T00:00:00", "lineItems": [{"accountRef": {"id": "61", "name": "Owner's Equity - Contributions"}, "description": "contribution to start business", "discountAmount": 0, "quantity": 1, "subTotal": 10000, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "2_Invoices", "name": "Exempt Invoices"}, "totalAmount": 10000, "trackingCategoryRefs": [], "unitAmount": 10000}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:04Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2015-11-24T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -10000}, "payment": {"accountRef": {"id": "81", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "id": "5-1", "paidOnDate": "2015-11-24T00:00:00", "totalAmount": 10000}}], "sourceModifiedDate": "2016-09-12T15:26:26Z", "subTotal": 10000, "taxAmount": 0, "totalAmount": 10000}, {"contactRef": {"dataType": "suppliers", "id": "53"}, "currency": "GBP", "currencyRate": 1, "id": "5-2", "issueDate": "2015-11-24T00:00:00", "lineItems": [{"accountRef": {"id": "63", "name": "Note Payable"}, "description": "funds borrowed to start business", "discountAmount": 0, "quantity": 1, "subTotal": 25000, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "2_Invoices", "name": "Exempt Invoices"}, "totalAmount": 25000, "trackingCategoryRefs": [], "unitAmount": 25000}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:04Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2015-11-24T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -25000}, "payment": {"accountRef": {"id": "81", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "id": "5-2", "paidOnDate": "2015-11-24T00:00:00", "totalAmount": 25000}}], "sourceModifiedDate": "2016-09-12T15:26:26Z", "subTotal": 25000, "taxAmount": 0, "totalAmount": 25000}], "totalResults": 741} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/directIncomes?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/directIncomes?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/directIncomes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "id": "1", "issueDate": "2018-09-21T00:00:00", "lineItems": [{"accountRef": {"id": "53", "name": "Retained profit balance forward account"}, "discountAmount": 0, "quantity": 1, "subTotal": 170.23, "taxAmount": 0, "totalAmount": 170.23, "trackingCategoryRefs": [], "unitAmount": 170.23}], "modifiedDate": "2023-01-18T11:02:50Z", "note": "Opening Balance from Bank", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2018-09-21T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -170.23}, "payment": {"accountRef": {"id": "61", "name": "Dave PP Current"}, "currency": "GBP", "currencyRate": 1, "id": "1", "paidOnDate": "2018-09-21T00:00:00", "totalAmount": 170.23}}], "sourceModifiedDate": "2018-12-17T14:56:20Z", "subTotal": 170.23, "taxAmount": 0, "totalAmount": 170.23}, {"currency": "GBP", "currencyRate": 1, "id": "11", "issueDate": "2018-10-15T00:00:00", "lineItems": [{"accountRef": {"id": "57", "name": "Sales of Product Income"}, "description": "Payment from CD Baby, a division of Audio and Video Labs Inc", "discountAmount": 0, "quantity": 1, "subTotal": 8.12, "taxAmount": 0, "totalAmount": 8.12, "trackingCategoryRefs": [], "unitAmount": 8.12}], "modifiedDate": "2023-01-18T11:02:50Z", "note": "Payment from CD Baby, a division of Audio and Video Labs Inc", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2018-10-15T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -8.12}, "payment": {"accountRef": {"id": "61", "name": "Dave PP Current"}, "currency": "GBP", "currencyRate": 1, "id": "11", "paidOnDate": "2018-10-15T00:00:00", "totalAmount": 8.12}}], "sourceModifiedDate": "2018-12-17T14:56:44Z", "subTotal": 8.12, "taxAmount": 0, "totalAmount": 8.12}], "totalResults": 1171} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/71ca2b28-8e86-41e7-8c55-f681042b11a0/connections/be80adfc-1157-4db4-9170-f8bcbbc051ba/data/directIncomes?page=1&pageSize=2"}, "next": {"href": "/companies/71ca2b28-8e86-41e7-8c55-f681042b11a0/connections/be80adfc-1157-4db4-9170-f8bcbbc051ba/data/directIncomes?page=2&pageSize=2"}, "self": {"href": "/companies/71ca2b28-8e86-41e7-8c55-f681042b11a0/connections/be80adfc-1157-4db4-9170-f8bcbbc051ba/data/directIncomes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "id": "4973", "issueDate": "2022-03-15T00:00:00", "lineItems": [{"accountRef": {"id": "151", "name": "Cash"}, "description": "Dt test line1", "quantity": 1, "subTotal": 125, "taxAmount": 25, "taxRateRef": {"effectiveTaxRate": 20, "id": "99", "name": "UK Sale Goods Standard Rate"}, "totalAmount": 150, "trackingCategoryRefs": [{"id": "DEPARTMENT-1", "name": "Sales"}, {"id": "LOCATION-8", "name": "United Kingdom"}], "unitAmount": 125}, {"accountRef": {"id": "152", "name": "Cash Equivalents"}, "description": "dt test line 2", "quantity": 1, "subTotal": 166.67, "taxAmount": 33.33, "taxRateRef": {"effectiveTaxRate": 20, "id": "99", "name": "UK Sale Goods Standard Rate"}, "totalAmount": 200, "trackingCategoryRefs": [{"id": "DEPARTMENT-2", "name": "Services"}, {"id": "LOCATION-8", "name": "United Kingdom"}], "unitAmount": 166.67}], "modifiedDate": "2022-10-28T11:10:26Z", "note": "dt header description", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-03-15T00:00:00", "currency": "GBP", "totalAmount": 350}, "payment": {"accountRef": {"id": "289", "name": "Checking 5 - Bank Of England"}, "currency": "GBP", "id": "4973", "note": "dt header description", "paidOnDate": "2022-03-15T00:00:00", "totalAmount": 350}}], "reference": "dt test contact", "sourceModifiedDate": "2022-03-15T12:45:58Z", "subTotal": 291.67, "taxAmount": 58.33, "totalAmount": 350}, {"currency": "GBP", "currencyRate": 1, "id": "5314", "issueDate": "2022-03-24T00:00:00", "lineItems": [{"accountRef": {"id": "5", "name": "Other Income"}, "description": "Interest earned", "quantity": 1, "subTotal": 300, "totalAmount": 300, "trackingCategoryRefs": [{"id": "DEPARTMENT-1", "name": "Sales"}, {"id": "LOCATION-8", "name": "United Kingdom"}], "unitAmount": 300}], "modifiedDate": "2022-10-28T11:10:26Z", "note": "Test Description", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-03-24T00:00:00", "currency": "GBP", "totalAmount": 300}, "payment": {"accountRef": {"id": "289", "name": "Checking 5 - Bank Of England"}, "currency": "GBP", "id": "5314", "note": "Test Description", "paidOnDate": "2022-03-24T00:00:00", "reference": "Test Int Income", "totalAmount": 300}}], "reference": "Test Int Income", "sourceModifiedDate": "2022-10-23T00:00:00Z", "subTotal": 300, "taxAmount": 0, "totalAmount": 300}], "totalResults": 43} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/directIncomes?page=1&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/directIncomes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"contactRef": {"dataType": "customers", "id": "bc446de5-971e-48b5-8efd-1745149844ef"}, "currency": "GBP", "currencyRate": 1, "id": "3a1be853-5964-4afe-ad6a-fb89cbaf6606", "issueDate": "2023-02-14T00:00:00", "lineItems": [{"accountRef": {"id": "a40f43e2-c7b0-4187-919a-04ccdc14a630", "name": "Subscriptions"}, "description": "Long-term subscriber discount - refund on sub", "quantity": 1, "subTotal": 35, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "EXEMPTINPUT", "name": "Exempt Expenses"}, "totalAmount": 35, "trackingCategoryRefs": [], "unitAmount": 35}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2023-02-14T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 35}, "payment": {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "3a1be853-5964-4afe-ad6a-fb89cbaf6606", "paidOnDate": "2023-02-14T00:00:00", "totalAmount": 35}}], "reference": "Sub 098801", "sourceModifiedDate": "2011-04-11T00:45:38", "subTotal": 35, "taxAmount": 0, "totalAmount": 35}], "totalResults": 1} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + list-accounting-direct-income-attachments: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + directIncomeId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + download-accounting-invoice-attachment: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + invoiceId: "" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + download-accounting-invoice-pdf: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-invoice: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Jensen Steuber", "id": "d65ac505-072c-49ec-be3c-3cb74228966d"}, "discountPercentage": 0, "dueDate": "2022-04-25T13:04:02", "id": "2518ca08-5e2a-4630-8cee-a6bcd1625660", "invoiceNumber": "TKj7oD38", "issueDate": "2022-04-25T13:04:02", "lineItems": [{"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "description": "Heavy Duty Hinged Gully Grating x4.00", "isDirectIncome": true, "itemRef": {"id": "3abf0883-03f7-44c6-bc15-1372522d25e1", "name": "Heavy Duty Hinged Gully Grating"}, "quantity": 4, "subTotal": 1611.56, "taxAmount": 161.16, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 1772.72, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "costcode_9", "name": "PandaConstruction"}], "unitAmount": 402.89}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "paidOnDate": "2022-04-25T13:04:02", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-04-25T13:04:02", "currency": "GBP", "currencyRate": 1, "totalAmount": -1772.72}, "payment": {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "9407d5ee-893a-4547-bd89-bc7b795ee774", "note": "Payment against invoice 2518ca08-5e2a-4630-8cee-a6bcd1625660", "paidOnDate": "2022-04-25T13:04:02", "reference": "2518ca08-5e2a-4630-8cee-a6bcd1625660", "totalAmount": 1772.72}}], "salesOrderRefs": [], "sourceModifiedDate": "2023-01-28T14:41:02", "status": "Paid", "subTotal": 1611.56, "totalAmount": 1772.72, "totalDiscount": 0, "totalTaxAmount": 161.16, "withholdingTax": []} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "customerRef": {"companyName": "Trey Researches", "id": "b61217b3-89d1-ea11-bbaa-000d3a2b9185"}, "discountPercentage": 0, "dueDate": "2019-01-15T00:00:00", "id": "18c906bf-89d1-ea11-bbaa-000d3a2b9185", "invoiceNumber": "103001", "issueDate": "2019-01-15T00:00:00", "lineItems": [{"accountRef": {"id": "181217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Income, Product Sales"}, "description": "AMSTERDAM Lamp", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "itemRef": {"id": "ITEM-d41217b3-89d1-ea11-bbaa-000d3a2b9185-DOMESTIC-DOMESTIC", "name": "AMSTERDAM Lamp / General Business Posting Group: 'DOMESTIC' / VAT Business Posting Group: 'DOMESTIC'"}, "quantity": 3, "subTotal": 106.8, "taxAmount": 21.36, "taxRateRef": {"effectiveTaxRate": 10, "id": "63bc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for DOMESTIC / STANDARD"}, "totalAmount": 128.16, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 35.6}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "", "paidOnDate": "2019-01-15T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2019-01-15T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -128.16}, "payment": {"accountRef": {"id": "621217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Petty Cash"}, "currency": "GBP", "currencyRate": 1, "id": "e0299ced-89d1-ea11-bbaa-000d3a2b9185", "note": "Invoice 102001", "paidOnDate": "2019-01-15T00:00:00", "reference": "Document No: 103001", "totalAmount": 128.16}}], "salesOrderRefs": [], "sourceModifiedDate": "2022-05-17T16:29:00Z", "status": "Paid", "subTotal": 106.8, "totalAmount": 128.16, "totalDiscount": 0, "totalTaxAmount": 21.36, "withholdingTax": []} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 599, "currency": "EUR", "currencyRate": 1, "customerRef": {"companyName": "Mr Abe", "id": "c3bf08a3-4d51-4859-acbb-5075f9484f87"}, "discountPercentage": 0, "dueDate": "2019-11-29T00:00:00Z", "id": "91dccc63-b1af-4363-bee0-2aec6bab1bef", "invoiceNumber": "19700002", "issueDate": "2019-11-08T00:00:00Z", "lineItems": [{"accountRef": {"id": "2421e8a0-5355-4ec0-af11-021fe4f39fcd", "name": "Omzet binnenland hoog tarief"}, "description": "Consultancy per uur - Consultancy per uur", "discountAmount": 0, "isDirectIncome": false, "quantity": 8, "subTotal": 600, "taxAmount": 0, "totalAmount": 600, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 75}], "modifiedDate": "2022-10-26T13:57:52Z", "paidOnDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2019-11-08T11:56:22Z", "status": "PartiallyPaid", "subTotal": 600, "totalAmount": 600, "totalTaxAmount": 0, "withholdingTax": []} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Some customer", "id": "570321bb-8b0c-49f1-a1f5-6fb1d6d94a62"}, "discountPercentage": 0, "dueDate": "2017-09-01T00:00:00Z", "id": "a05d1256-f253-46bd-aa13-c6f6a992aa47", "invoiceNumber": "17700002", "issueDate": "2017-08-02T00:00:00Z", "lineItems": [{"accountRef": {"id": "43acd218-6a95-445f-994c-660273e0ced9", "name": "Sales"}, "description": "A bunch of stuff - A bunch of stuff", "discountAmount": 0, "isDirectIncome": false, "quantity": 1000, "subTotal": 100000, "taxAmount": 0, "totalAmount": 100000, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 100}], "modifiedDate": "2022-10-26T13:39:08Z", "paidOnDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2017-08-02T18:23:43Z", "status": "Paid", "subTotal": 100000, "totalAmount": 100000, "totalTaxAmount": 0, "withholdingTax": []} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "_Test 1", "id": "10123537"}, "dueDate": "2016-12-30T00:00:00", "id": "50541736", "invoiceNumber": "2348", "issueDate": "2016-12-30T00:00:00", "lineItems": [{"accountRef": {"id": "001", "name": "Sales"}, "description": "3.0 items with VatPercentage of 0.0", "discountAmount": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 25.26, "taxAmount": 0, "totalAmount": 25.26, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 25.26}, {"accountRef": {"id": "001", "name": "Sales"}, "description": "3 service charges with 0.0% vat", "discountAmount": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 8.85, "taxAmount": 0, "totalAmount": 8.85, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 8.85}, {"description": "Tax", "discountAmount": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 0, "taxAmount": 0, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:19Z", "paidOnDate": "2020-11-05T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -34.11}, "payment": {"currency": "GBP", "id": "262466203", "note": "E2E Test transaction 2 CREDIT �250.00 - Invoice receipt against 2348", "paidOnDate": "2020-11-05T00:00:00", "totalAmount": 250}}], "salesOrderRefs": [], "sourceModifiedDate": "2022-10-20T14:28:00Z", "status": "Paid", "subTotal": 34.11, "totalAmount": 34.11, "totalTaxAmount": 0, "withholdingTax": []} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 222.71, "currency": "USD", "customerRef": {"companyName": "ab1", "id": "602174"}, "dueDate": "1987-10-01T00:00:00", "id": "2596455", "invoiceNumber": "test-AL", "issueDate": "1987-10-01T00:00:00", "lineItems": [{"description": "Editing creative writing for a client", "discountAmount": 0, "isDirectIncome": false, "itemRef": {"id": "639579", "name": "Creative Writing Editorial"}, "quantity": 1, "subTotal": 222.88, "taxAmount": 0, "totalAmount": 222.88, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 222.88}, {"description": "", "discountAmount": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 0, "taxAmount": 0, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "note": "", "paidOnDate": "2023-03-03T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "USD", "currencyRate": 1, "totalAmount": -0.17}, "payment": {"currency": "USD", "id": "2570292", "note": "", "paidOnDate": "2023-03-03T00:00:00", "totalAmount": 0.17}}], "salesOrderRefs": [], "sourceModifiedDate": "2023-03-03T09:27:42", "status": "Submitted", "subTotal": 222.88, "totalAmount": 222.88, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "EUR", "currencyRate": 0.844737287, "customerRef": {"companyName": "Mr French Person", "id": "86832299"}, "dueDate": "2006-01-12T00:00:00", "id": "143008521", "invoiceNumber": "40", "issueDate": "2005-12-15T00:00:00", "lineItems": [{"accountRef": {"id": "0"}, "isDirectIncome": false, "quantity": 0, "subTotal": 0, "taxAmount": 0, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-09-30T10:29:15Z", "paidOnDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 0, "totalAmount": 0, "totalTaxAmount": 0, "withholdingTax": []} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "10 Breww Ltd", "id": "417"}, "dueDate": "2021-04-30T00:00:00", "id": "416", "invoiceNumber": "INV01", "issueDate": "2021-04-09T00:00:00", "lineItems": [{"accountRef": {"id": "54", "name": "Sales"}, "description": "Non-Recurring Services - EC", "isDirectIncome": false, "itemRef": {"id": "28", "name": "Non-Recurring Services - EC"}, "quantity": 1, "subTotal": 100, "totalAmount": 100, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "location-1"}], "unitAmount": 100}], "modifiedDate": "2022-09-20T08:16:10Z", "paidOnDate": "2021-04-20T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -90}, "payment": {"accountRef": {"id": "122", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "id": "428", "paidOnDate": "2021-04-20T00:00:00", "reference": "Payment #PYMT01", "totalAmount": 90}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10}, "payment": {"accountRef": {"id": "122", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "id": "428", "paidOnDate": "2021-04-20T00:00:00", "reference": "Payment #PYMT01", "totalAmount": 90}}], "salesOrderRefs": [], "sourceModifiedDate": "2021-08-25T15:55:36", "status": "Paid", "subTotal": 100, "totalAmount": 100, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Prentice, Adelaide", "id": "420000-1071522044"}, "discountPercentage": 0, "dueDate": "2023-12-28T00:00:00", "id": "2453-1071526256", "invoiceNumber": "975", "issueDate": "2022-11-28T00:00:00", "lineItems": [{"description": "Foundation slab - prep and pouring", "isDirectIncome": false, "itemRef": {"id": "320000-1071525597", "name": "Concrete Slab"}, "quantity": 1, "subTotal": 167.5, "taxAmount": 0, "taxRateRef": {"id": "20000-999022286", "name": "Non-Taxable Sales"}, "totalAmount": 167.5, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 167.5}, {"isDirectIncome": false, "quantity": 1, "subTotal": 0, "taxAmount": 0, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Rough lumber", "isDirectIncome": false, "itemRef": {"id": "1C0000-933272656", "name": "Lumber:Rough"}, "quantity": 1, "subTotal": 48, "taxAmount": 0, "taxRateRef": {"id": "10000-999022286", "name": "Taxable Sales"}, "totalAmount": 48, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 48}, {"description": "Trim lumber", "isDirectIncome": false, "itemRef": {"id": "1D0000-933272656", "name": "Lumber:Trim"}, "quantity": 1, "subTotal": 38, "taxAmount": 0, "taxRateRef": {"id": "10000-999022286", "name": "Taxable Sales"}, "totalAmount": 38, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 38}, {"description": "Window", "isDirectIncome": false, "itemRef": {"id": "1F0000-933272656", "name": "Window"}, "quantity": 2, "subTotal": 50, "taxAmount": 0, "taxRateRef": {"id": "10000-999022286", "name": "Taxable Sales"}, "totalAmount": 50, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 25}, {"description": "Flooring", "isDirectIncome": false, "itemRef": {"id": "310000-1071509547", "name": "Flooring"}, "quantity": 1, "subTotal": 50, "taxAmount": 0, "taxRateRef": {"id": "10000-999022286", "name": "Taxable Sales"}, "totalAmount": 50, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 50}, {"description": "Window", "isDirectIncome": false, "itemRef": {"id": "1F0000-933272656", "name": "Window"}, "quantity": 2, "subTotal": 60, "taxAmount": 0, "taxRateRef": {"id": "10000-999022286", "name": "Taxable Sales"}, "totalAmount": 60, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 30}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:08:12Z", "paidOnDate": "2023-01-15T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -431.95}, "payment": {"accountRef": {"id": "80000-933270541", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "id": "6973-1197775625", "note": "Check - 80000-933270541", "paidOnDate": "2023-01-15T00:00:00", "reference": "983409", "totalAmount": 431.95}}], "salesOrderRefs": [], "sourceModifiedDate": "2023-12-16T05:06:11", "status": "Paid", "subTotal": 413.5, "totalAmount": 431.95, "totalDiscount": 0, "totalTaxAmount": 18.45, "withholdingTax": []} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 3296.44, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Information Sharing Technology", "id": "3"}, "dueDate": "2019-03-20T00:00:00", "id": "16", "invoiceNumber": "1001", "issueDate": "2019-02-18T00:00:00", "lineItems": [{"accountRef": {"id": "1", "name": "Sales"}, "description": "Service", "isDirectIncome": false, "itemRef": {"id": "1", "name": "Sales"}, "quantity": 10, "subTotal": 5000, "taxAmount": 0, "totalAmount": 5000, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 500}], "modifiedDate": "2023-01-18T11:03:02Z", "note": "Invoice for service", "paidOnDate": "2020-06-01T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -23.86}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "116", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-10T00:00:00", "reference": "114213", "totalAmount": 65.77}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -16.31}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "122", "note": "Payments of type Cash", "paidOnDate": "2020-01-10T00:00:00", "reference": "121197", "totalAmount": 771.61}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -34.45}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "123", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-10T00:00:00", "reference": "121293", "totalAmount": 34.45}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -42.36}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "132", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-10T00:00:00", "reference": "13022", "totalAmount": 47.38}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -13.71}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "140", "note": "Payments of type Cash", "paidOnDate": "2020-01-13T00:00:00", "reference": "139163", "totalAmount": 1078.72}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -27.88}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "141", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-13T00:00:00", "reference": "139288", "totalAmount": 27.88}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -22.26}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "149", "note": "Payments of type Cash", "paidOnDate": "2020-01-13T00:00:00", "reference": "148151", "totalAmount": 643.97}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -11.57}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "150", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-13T00:00:00", "reference": "148217", "totalAmount": 11.57}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -4.87}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "157", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-15T00:00:00", "reference": "155266", "totalAmount": 14.32}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -18.99}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "165", "note": "Payments of type Cash", "paidOnDate": "2020-01-15T00:00:00", "reference": "164142", "totalAmount": 913.09}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -39.98}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "166", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-15T00:00:00", "reference": "164260", "totalAmount": 39.98}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -26.29}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "173", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-15T00:00:00", "reference": "171213", "totalAmount": 35.36}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10.04}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "181", "note": "Payments of type Cash", "paidOnDate": "2020-01-17T00:00:00", "reference": "180197", "totalAmount": 1087.13}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -47.91}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "182", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-17T00:00:00", "reference": "180274", "totalAmount": 47.91}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -13.34}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "190", "note": "Payments of type Cash", "paidOnDate": "2020-01-17T00:00:00", "reference": "189174", "totalAmount": 607.48}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -16.44}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "191", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-17T00:00:00", "reference": "18922", "totalAmount": 16.44}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -20.22}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "199", "note": "Payments of type Cash", "paidOnDate": "2020-01-20T00:00:00", "reference": "198128", "totalAmount": 1209.15}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -18.35}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "200", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-20T00:00:00", "reference": "198234", "totalAmount": 18.35}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -7.86}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "208", "note": "Payments of type Cash", "paidOnDate": "2020-01-21T00:00:00", "reference": "207189", "totalAmount": 914.33}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -27.62}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "209", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-21T00:00:00", "reference": "207254", "totalAmount": 27.62}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -1.66}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "217", "note": "Payments of type Cash", "paidOnDate": "2020-01-22T00:00:00", "reference": "216161", "totalAmount": 565.24}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -19.67}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "218", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-22T00:00:00", "reference": "216237", "totalAmount": 19.67}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -30.52}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "231", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-23T00:00:00", "reference": "229276", "totalAmount": 38.7}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -31.98}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "240", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-23T00:00:00", "reference": "238213", "totalAmount": 47.7}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10.84}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "249", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-23T00:00:00", "reference": "247245", "totalAmount": 22.03}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -16.6}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "256", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-23T00:00:00", "reference": "254258", "totalAmount": 37.68}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -15.02}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "262", "note": "Payments of type Cash", "paidOnDate": "2020-01-24T00:00:00", "reference": "261162", "totalAmount": 425.69}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -7.24}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "263", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-24T00:00:00", "reference": "261215", "totalAmount": 7.24}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -48.58}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "269", "note": "Payments of type Cash", "paidOnDate": "2020-01-24T00:00:00", "reference": "268154", "totalAmount": 968.21}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -11.69}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "270", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-24T00:00:00", "reference": "268269", "totalAmount": 11.69}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -37.08}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "278", "note": "Payments of type Cash", "paidOnDate": "2020-01-25T00:00:00", "reference": "277153", "totalAmount": 1063.48}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -30.58}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "279", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-25T00:00:00", "reference": "277281", "totalAmount": 30.58}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -6.97}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "287", "note": "Payments of type Cash", "paidOnDate": "2020-01-26T00:00:00", "reference": "286188", "totalAmount": 539.55}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -12.73}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "288", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-26T00:00:00", "reference": "286250", "totalAmount": 12.73}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -4.18}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "296", "note": "Payments of type Cash", "paidOnDate": "2020-01-27T00:00:00", "reference": "295176", "totalAmount": 687.33}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -14.92}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "297", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-27T00:00:00", "reference": "295264", "totalAmount": 14.92}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -6.66}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "303", "note": "Payments of type Cash", "paidOnDate": "2020-01-28T00:00:00", "reference": "302128", "totalAmount": 837.68}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -17.04}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "304", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-28T00:00:00", "reference": "302284", "totalAmount": 17.04}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -41.47}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "313", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-29T00:00:00", "reference": "311211", "totalAmount": 45.06}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -27.08}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "321", "note": "Payments of type Cash", "paidOnDate": "2020-01-29T00:00:00", "reference": "320186", "totalAmount": 798.79}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -14.33}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "322", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-29T00:00:00", "reference": "320256", "totalAmount": 14.33}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -17.58}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "333", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-30T00:00:00", "reference": "331236", "totalAmount": 17.94}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -29.21}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "341", "note": "Payments of type Cash", "paidOnDate": "2020-01-30T00:00:00", "reference": "340128", "totalAmount": 859.44}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -26.59}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "342", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-30T00:00:00", "reference": "340292", "totalAmount": 26.59}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -7.07}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "348", "note": "Payments of type Cash", "paidOnDate": "2020-01-31T00:00:00", "reference": "34710", "totalAmount": 949.74}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -25.32}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "349", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-31T00:00:00", "reference": "347216", "totalAmount": 25.32}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -40.61}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "361", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-01T00:00:00", "reference": "359220", "totalAmount": 54.12}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -25.4}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "367", "note": "Payments of type Cash", "paidOnDate": "2020-02-02T00:00:00", "reference": "366195", "totalAmount": 827.2}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -12.15}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "368", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-02T00:00:00", "reference": "366288", "totalAmount": 12.15}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -11.54}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "376", "note": "Payments of type Cash", "paidOnDate": "2020-02-03T00:00:00", "reference": "375123", "totalAmount": 802.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -39.06}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "377", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-03T00:00:00", "reference": "375298", "totalAmount": 39.06}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -13.4}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "385", "note": "Payments of type Cash", "paidOnDate": "2020-02-04T00:00:00", "reference": "38418", "totalAmount": 858.41}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -9.99}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "386", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-04T00:00:00", "reference": "384213", "totalAmount": 9.99}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -47.35}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "392", "note": "Payments of type Cash", "paidOnDate": "2020-02-05T00:00:00", "reference": "391115", "totalAmount": 1094.8}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -16.73}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "393", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-05T00:00:00", "reference": "391247", "totalAmount": 16.73}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -29.29}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "402", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-06T00:00:00", "reference": "400275", "totalAmount": 32.88}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -33.79}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "410", "note": "Payments of type Cash", "paidOnDate": "2020-02-07T00:00:00", "reference": "409145", "totalAmount": 725.48}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -6.22}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "411", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-07T00:00:00", "reference": "409292", "totalAmount": 6.22}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -2.55}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "419", "note": "Payments of type Cash", "paidOnDate": "2020-02-08T00:00:00", "reference": "418157", "totalAmount": 407.2}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -8.92}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "420", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-08T00:00:00", "reference": "418258", "totalAmount": 8.92}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -28.75}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "429", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-09T00:00:00", "reference": "427270", "totalAmount": 56.75}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -31.48}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "437", "note": "Payments of type Cash", "paidOnDate": "2020-02-10T00:00:00", "reference": "436168", "totalAmount": 760.05}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -6.03}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "438", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-10T00:00:00", "reference": "436234", "totalAmount": 6.03}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -17.96}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "446", "note": "Payments of type Cash", "paidOnDate": "2020-02-11T00:00:00", "reference": "44518", "totalAmount": 904.82}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -24.95}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "447", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-11T00:00:00", "reference": "445278", "totalAmount": 24.95}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -33.72}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "456", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-11T00:00:00", "reference": "454252", "totalAmount": 70.44}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -34.76}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "462", "note": "Payments of type Cash", "paidOnDate": "2020-02-13T00:00:00", "reference": "461144", "totalAmount": 914.05}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -7.47}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "463", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-13T00:00:00", "reference": "461243", "totalAmount": 7.47}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -41.38}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "470", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-13T00:00:00", "reference": "468248", "totalAmount": 67.83}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10.21}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "481", "note": "Payments of type Cash", "paidOnDate": "2020-02-17T00:00:00", "reference": "480129", "totalAmount": 965.85}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -33.9}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "482", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-17T00:00:00", "reference": "480242", "totalAmount": 33.9}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -7.74}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "490", "note": "Payments of type Cash", "paidOnDate": "2020-02-18T00:00:00", "reference": "489120", "totalAmount": 1112.76}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -48.74}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "491", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-18T00:00:00", "reference": "489239", "totalAmount": 48.74}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5.08}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "499", "note": "Payments of type Cash", "paidOnDate": "2020-02-20T00:00:00", "reference": "498147", "totalAmount": 1017}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -37.77}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "500", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-20T00:00:00", "reference": "498254", "totalAmount": 37.77}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -54.62}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "507", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-20T00:00:00", "reference": "505288", "totalAmount": 62.82}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "521", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-20T00:00:00", "reference": "519243", "totalAmount": 14.74}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "647", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-03-20T00:00:00", "reference": "645263", "totalAmount": 40.43}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -25}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "705", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-04-03T00:00:00", "reference": "703246", "totalAmount": 25}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "772", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-04-24T00:00:00", "reference": "770263", "totalAmount": 10.35}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "779", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-04-24T00:00:00", "reference": "777217", "totalAmount": 39.55}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "792", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-04-29T00:00:00", "reference": "790262", "totalAmount": 12.46}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "843", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-05-07T00:00:00", "reference": "841264", "totalAmount": 25.64}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "850", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-05-14T00:00:00", "reference": "848254", "totalAmount": 53.68}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "877", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-06-01T00:00:00", "reference": "875210", "totalAmount": 12.7}}], "salesOrderRefs": [], "sourceModifiedDate": "2022-09-20T10:12:08Z", "status": "PartiallyPaid", "subTotal": 5000, "totalAmount": 5000, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Ecker Holiday event", "id": "59"}, "dueDate": "2016-02-05T00:00:00", "id": "30", "invoiceNumber": "1002", "issueDate": "2016-01-06T00:00:00", "lineItems": [{"accountRef": {"id": "44", "name": "Sales"}, "description": "Holiday party - gold level test v1", "isDirectIncome": false, "itemRef": {"id": "7", "name": "Gold party"}, "quantity": 1, "subTotal": 2000, "taxAmount": 400, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Invoices", "name": "20.0% S Invoices"}, "totalAmount": 2400, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 2000}, {"accountRef": {"id": "68", "name": "Billable Expenses Income"}, "description": "Venue rental", "isDirectIncome": false, "itemRef": {"id": "20", "name": "Venue Rental"}, "quantity": 1, "subTotal": 10000, "taxAmount": 2000, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Invoices", "name": "20.0% S Invoices"}, "totalAmount": 12000, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 10000}, {"accountRef": {"id": "68", "name": "Billable Expenses Income"}, "description": "promotional items -- misc engraved items", "isDirectIncome": false, "itemRef": {"id": "12", "name": "Misc"}, "quantity": 75, "subTotal": 1012.5, "taxAmount": 202.5, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Invoices", "name": "20.0% S Invoices"}, "totalAmount": 1215, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 13.5}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:12Z", "paidOnDate": "2016-02-12T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -15615}, "payment": {"accountRef": {"id": "81", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "id": "31", "note": "", "paidOnDate": "2016-02-12T00:00:00", "totalAmount": 15615}}], "salesOrderRefs": [], "sourceModifiedDate": "2023-01-25T13:49:52Z", "status": "Paid", "subTotal": 13012.5, "totalAmount": 15615, "totalDiscount": 0, "totalTaxAmount": 2602.5, "withholdingTax": []} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 52.01, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "A1 Design Services", "id": "A1D001"}, "discountPercentage": 2.49, "dueDate": "2020-08-12T00:00:00Z", "id": "82322", "invoiceNumber": "0000000110", "issueDate": "2020-07-13T00:00:00Z", "lineItems": [{"description": "Tax Summary - Standard rate", "discountAmount": 0.22, "isDirectIncome": false, "quantity": 0, "subTotal": 0, "taxAmount": 8.67, "taxRateRef": {"effectiveTaxRate": 20, "id": "1729", "name": "Standard rate"}, "totalAmount": 8.67, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Project", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 1.08, "isDirectIncome": false, "quantity": 0, "subTotal": 43.34, "taxAmount": 0, "totalAmount": 43.34, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:36:12Z", "note": "0000000114", "paidOnDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2020-07-13T11:06:40Z", "status": "Submitted", "subTotal": 43.34, "totalAmount": 52.01, "totalDiscount": 1.3, "totalTaxAmount": 8.67, "withholdingTax": []} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "A1 Design Services", "id": "A1D001"}, "dueDate": "2022-10-23T00:00:00Z", "id": "INV-1", "invoiceNumber": "1", "issueDate": "2021-01-02T00:00:00", "lineItems": [{"accountRef": {"id": "4000", "name": "Sales North"}, "description": "AT Mini Tower Case", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 14.25, "taxAmount": 2.43, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 16.68, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 14.25}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Whiteboard - Drywipe (900 x 1200)", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 4, "subTotal": 76, "taxAmount": 12.97, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 88.97, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Project", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 19}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "A4 Ledger Book - 5 Column", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 8, "subTotal": 60.72, "taxAmount": 10.36, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 71.08, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Project", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 7.59}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Shorthand Notebook - 80 Sheets", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 20, "subTotal": 85.4, "taxAmount": 14.57, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 99.97, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 4.27}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Calculator - Desktop", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 9.5, "taxAmount": 1.62, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 11.12, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 9.5}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Calculator - Desktop (Printing)", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 16.15, "taxAmount": 2.76, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 18.91, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 16.15}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Calculator - Printing Rolls", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 15, "subTotal": 85.5, "taxAmount": 14.59, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 100.09, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 5.7}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Correction Fluid - White", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 7, "subTotal": 16.59, "taxAmount": 2.83, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 19.42, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 2.37}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Envelope - White (110 x 220) Plain", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 20, "subTotal": 170.8, "taxAmount": 29.14, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 199.94, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 8.54}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Flip Chart - A1 Pad", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 10, "subTotal": 152, "taxAmount": 25.94, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 177.94, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 15.2}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Laminator Pouches - A4", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 5, "subTotal": 57, "taxAmount": 9.73, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 66.73, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 11.4}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Mouse Mat - (241 x 203) Blue", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 5, "subTotal": 7.1, "taxAmount": 1.21, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 8.31, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 1.42}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Copy Paper - Economy Grade", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 80, "subTotal": 196.8, "taxAmount": 33.58, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 230.38, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Project", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 2.46}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Coloured Paper - Pastel Blue", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 5, "subTotal": 18.05, "taxAmount": 3.08, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 21.13, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 3.61}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Ball Point Pen - Black", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 8, "subTotal": 15.2, "taxAmount": 2.59, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 17.79, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 1.9}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Pencil - HB", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 3, "subTotal": 7.11, "taxAmount": 1.21, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 8.32, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 2.37}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Remember-Me Sticky Notes (Recycled)", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 6, "subTotal": 19.92, "taxAmount": 3.4, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 23.32, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 3.32}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Scissors - Economy", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 2.85, "taxAmount": 0.49, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 3.34, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 2.85}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Adhesive Tape - Brown (50mm x 66m)", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 5, "subTotal": 13.3, "taxAmount": 2.27, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 15.57, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 2.66}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "JP010 Jet Printer Cartridge", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 5, "subTotal": 85.5, "taxAmount": 14.59, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 100.09, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 17.1}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Letter Trays - 3 pack (Red)", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 2, "subTotal": 13.3, "taxAmount": 2.27, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 15.57, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 6.65}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:42Z", "note": "", "paidOnDate": "2022-01-29T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -8.32}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -11.12}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -8.31}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -19.42}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -15.57}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -21.13}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -99.97}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -23.32}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -18.91}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -16.68}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -100.09}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -199.94}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -3.34}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -15.57}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -100.09}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -66.73}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -117.5}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -177.94}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -230.38}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -17.79}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -71.08}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -88.97}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}], "salesOrderRefs": [], "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Paid", "subTotal": 1223.04, "totalAmount": 1432.17, "totalDiscount": 0, "totalTaxAmount": 209.13, "withholdingTax": []} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 1240, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Widgets Limited", "id": "f4ff85ba33dd11e797950a57719b2edb"}, "dueDate": "2017-06-07T00:00:00", "id": "b039b0a733de11e797950a57719b2edb", "invoiceNumber": "SI-1", "issueDate": "2017-05-08T00:00:00", "lineItems": [{"accountRef": {"id": "9a994b92267a11e797950a57719b2edb", "name": "Sales Type A"}, "description": "Consulting services", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "itemRef": {"id": "a87b922b33de11e797950a57719b2edb", "name": "Consulting services"}, "quantity": 8, "subTotal": 7200, "taxAmount": 1440, "taxRateRef": {"effectiveTaxRate": 20, "id": "GB_STANDARD", "name": "Standard 20.00%"}, "totalAmount": 8640, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 900}], "modifiedDate": "2022-10-24T15:03:37Z", "paidOnDate": "2021-07-23T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -4000}, "payment": {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "id": "52237e4e215911e8b45c025132dab352", "note": "Customer receipt using credit/debit card", "paidOnDate": "2018-01-02T00:00:00", "totalAmount": 4000}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -1400}, "payment": {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "id": "579388a0215911e8b45c025132dab352", "note": "Customer receipt using credit/debit card", "paidOnDate": "2018-01-02T00:00:00", "totalAmount": 1400}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -1000}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "e1c2bd659a6111e8bad90617b3da4b8a", "note": "Sales credit note", "paidOnDate": "2018-08-07T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -1000}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "e1c2bd659a6111e8bad90617b3da4b8a", "note": "Sales credit note", "paidOnDate": "2018-08-07T00:00:00", "totalAmount": 0}}], "salesOrderRefs": [], "sourceModifiedDate": "2021-07-23T13:42:59Z", "status": "PartiallyPaid", "subTotal": 7200, "totalAmount": 8640, "totalDiscount": 0, "totalTaxAmount": 1440, "withholdingTax": []} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "MK Manufacturing", "id": "12"}, "dueDate": "2021-05-22T00:00:00", "id": "2916", "invoiceNumber": "IN0480", "issueDate": "2021-04-22T00:00:00", "lineItems": [{"accountRef": {"id": "176", "name": "Revenue - Services"}, "isDirectIncome": false, "quantity": 1, "subTotal": 100, "taxAmount": 20, "taxRateRef": {"effectiveTaxRate": 20, "id": "105", "name": "UK Sale Services Standard Rate"}, "totalAmount": 120, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Project", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "CUSTOMER-12", "name": "MK Manufacturing"}, {"id": "DEPARTMENT-2", "name": "Services"}, {"id": "LOCATION-11", "name": "Codat Test Entity"}], "unitAmount": 100}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:54Z", "paidOnDate": "2021-04-22T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -120}, "payment": {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "id": "2918", "note": "", "paidOnDate": "2021-04-22T00:00:00", "totalAmount": 120}}], "salesOrderRefs": [], "sourceModifiedDate": "2021-04-22T11:01:11Z", "status": "Paid", "subTotal": 100, "totalAmount": 120, "totalDiscount": 0, "totalTaxAmount": 20, "withholdingTax": []} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "USD", "currencyRate": 0.784736781, "customerRef": {"companyName": "ABC Textiles", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O0N1c3RvbWVyOjMyMzkzNTA4"}, "dueDate": "2019-10-17T00:00:00", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O0ludm9pY2U6NzgyNDQ4OTg1Nzc1MzE5MTYw", "invoiceNumber": "1", "issueDate": "2019-10-17T00:00:00", "lineItems": [{"accountRef": {"id": "QWNjb3VudDo3OTE3NTA2MDA0MjQ0NTExMTU7QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2", "name": "Sales"}, "description": "", "isDirectIncome": false, "itemRef": {"id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1Byb2R1Y3Q6MzU2NjcyNTI=", "name": "Golf balls"}, "quantity": 5, "subTotal": 50, "taxAmount": 2.5, "totalAmount": 52.5, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-11-16T18:15:23Z", "paidOnDate": "2019-12-05T23:20:36Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2019-12-05T23:20:36Z", "status": "Paid", "subTotal": 50, "totalAmount": 52.5, "totalTaxAmount": 2.5, "withholdingTax": []} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Maddox Publishing Group", "id": "afd4093b-c655-4847-8ee2-10a4f2c3eae3"}, "dueDate": "2022-01-17T00:00:00", "id": "321bfed3-2da2-4969-9358-4de97821181b", "invoiceNumber": "INV-001-0", "issueDate": "2021-12-20T00:00:00", "lineItems": [{"accountRef": {"id": "a969500a-377c-4cea-8f2b-a4e385607fd0", "name": "Other Revenue"}, "description": "Project management - onsite daily rate - your CRM integration project", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "itemRef": {"id": "aa1c5f84-4453-42fa-9c92-69d4085607c9", "name": "Project management - daily rate"}, "quantity": 6, "subTotal": 3500, "taxAmount": 700, "taxRateRef": {"effectiveTaxRate": 20, "id": "OUTPUT2", "name": "20% (VAT on Income)"}, "totalAmount": 4200, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "34b9b859-07a9-451a-b4d3-effc9946634a", "name": "North"}], "unitAmount": 583.3333333333}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:38:11Z", "paidOnDate": "2022-02-17T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -4200}, "payment": {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "65b746c8-9a5d-4a95-8096-d2316fcff592", "paidOnDate": "2022-02-17T00:00:00", "totalAmount": 4200}}], "salesOrderRefs": [], "sourceModifiedDate": "2021-01-02T20:34:51", "status": "Paid", "subTotal": 3500, "totalAmount": 4200, "totalDiscount": 0, "totalTaxAmount": 700, "withholdingTax": []} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Test Company", "id": "104957000000037097"}, "dueDate": "2020-02-17T00:00:00", "id": "104957000000038034", "invoiceNumber": "INV-102", "issueDate": "2020-02-06T10:54:03", "lineItems": [], "modifiedDate": "2022-10-03T08:40:37Z", "paidOnDate": "2020-05-19T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -9000}, "payment": {"accountRef": {"id": "104957000000000349", "name": "Petty Cash"}, "currency": "GBP", "currencyRate": 1, "id": "104957000000129048", "note": "", "paidOnDate": "2020-04-29T00:00:00", "reference": "9", "totalAmount": 9000}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -1}, "payment": {"accountRef": {"id": "104957000000060010", "name": "Abdi Test"}, "currency": "GBP", "currencyRate": 1, "id": "104957000000137017", "note": "", "paidOnDate": "2020-05-19T00:00:00", "reference": "11", "totalAmount": 9000}}], "salesOrderRefs": [], "sourceModifiedDate": "2020-05-19T15:36:26", "status": "Paid", "totalAmount": 9001, "totalTaxAmount": 0, "withholdingTax": []} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + invoiceId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-invoice-attachment: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + invoiceId: "" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounting-invoices: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Jensen Steuber", "id": "d65ac505-072c-49ec-be3c-3cb74228966d"}, "discountPercentage": 0, "dueDate": "2022-04-25T13:04:02", "id": "2518ca08-5e2a-4630-8cee-a6bcd1625660", "invoiceNumber": "TKj7oD38", "issueDate": "2022-04-25T13:04:02", "lineItems": [{"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "description": "Heavy Duty Hinged Gully Grating x4.00", "isDirectIncome": true, "itemRef": {"id": "3abf0883-03f7-44c6-bc15-1372522d25e1", "name": "Heavy Duty Hinged Gully Grating"}, "quantity": 4, "subTotal": 1611.56, "taxAmount": 161.16, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 1772.72, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "costcode_9", "name": "PandaConstruction"}], "unitAmount": 402.89}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "paidOnDate": "2022-04-25T13:04:02", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-04-25T13:04:02", "currency": "GBP", "currencyRate": 1, "totalAmount": -1772.72}, "payment": {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "9407d5ee-893a-4547-bd89-bc7b795ee774", "note": "Payment against invoice 2518ca08-5e2a-4630-8cee-a6bcd1625660", "paidOnDate": "2022-04-25T13:04:02", "reference": "2518ca08-5e2a-4630-8cee-a6bcd1625660", "totalAmount": 1772.72}}], "salesOrderRefs": [], "sourceModifiedDate": "2023-01-28T14:41:02", "status": "Paid", "subTotal": 1611.56, "totalAmount": 1772.72, "totalDiscount": 0, "totalTaxAmount": 161.16, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Keara Leffler", "id": "a82042f1-a005-4ca5-bfd3-5bc237123aa5"}, "discountPercentage": 0, "dueDate": "2022-04-25T13:04:02", "id": "ac3ac4dd-defe-4f9c-b7bb-2c3fe726a9d1", "invoiceNumber": "4F6ONfFP", "issueDate": "2022-04-25T13:04:02", "lineItems": [{"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Heavy Duty Hinged Gully Grating x8.28", "isDirectIncome": false, "itemRef": {"id": "3abf0883-03f7-44c6-bc15-1372522d25e1", "name": "Heavy Duty Hinged Gully Grating"}, "quantity": 8.28, "subTotal": 3335.93, "taxAmount": 333.59, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 3669.52, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 402.89}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "paidOnDate": "2022-04-25T13:04:02", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-04-25T13:04:02", "currency": "GBP", "currencyRate": 1, "totalAmount": -3669.52}, "payment": {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "7ba4fc1b-e248-49ba-8bf8-0813d7f203a8", "note": "Payment against invoice ac3ac4dd-defe-4f9c-b7bb-2c3fe726a9d1", "paidOnDate": "2022-04-25T13:04:02", "reference": "ac3ac4dd-defe-4f9c-b7bb-2c3fe726a9d1", "totalAmount": 3669.52}}], "salesOrderRefs": [], "sourceModifiedDate": "2022-08-22T07:43:02", "status": "Paid", "subTotal": 3335.93, "totalAmount": 3669.52, "totalDiscount": 0, "totalTaxAmount": 333.59, "withholdingTax": []}], "totalResults": 142} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "customerRef": {"companyName": "Trey Researches", "id": "b61217b3-89d1-ea11-bbaa-000d3a2b9185"}, "discountPercentage": 0, "dueDate": "2019-01-15T00:00:00", "id": "18c906bf-89d1-ea11-bbaa-000d3a2b9185", "invoiceNumber": "103001", "issueDate": "2019-01-15T00:00:00", "lineItems": [{"accountRef": {"id": "181217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Income, Product Sales"}, "description": "AMSTERDAM Lamp", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "itemRef": {"id": "ITEM-d41217b3-89d1-ea11-bbaa-000d3a2b9185-DOMESTIC-DOMESTIC", "name": "AMSTERDAM Lamp / General Business Posting Group: 'DOMESTIC' / VAT Business Posting Group: 'DOMESTIC'"}, "quantity": 3, "subTotal": 106.8, "taxAmount": 21.36, "taxRateRef": {"effectiveTaxRate": 10, "id": "63bc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for DOMESTIC / STANDARD"}, "totalAmount": 128.16, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 35.6}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "", "paidOnDate": "2019-01-15T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2019-01-15T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -128.16}, "payment": {"accountRef": {"id": "621217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Petty Cash"}, "currency": "GBP", "currencyRate": 1, "id": "e0299ced-89d1-ea11-bbaa-000d3a2b9185", "note": "Invoice 102001", "paidOnDate": "2019-01-15T00:00:00", "reference": "Document No: 103001", "totalAmount": 128.16}}], "salesOrderRefs": [], "sourceModifiedDate": "2022-05-17T16:29:00Z", "status": "Paid", "subTotal": 106.8, "totalAmount": 128.16, "totalDiscount": 0, "totalTaxAmount": 21.36, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "USD", "customerRef": {"companyName": "", "id": "0ef95175-48c4-eb11-9f0a-0022481b4343"}, "discountPercentage": 0, "dueDate": "2019-01-15T00:00:00", "id": "31e97827-bb18-ed11-90eb-000d3a8747a0", "invoiceNumber": "102287", "issueDate": "2019-01-15T00:00:00", "lineItems": [], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "", "paidOnDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2022-08-10T14:46:08Z", "status": "Draft", "subTotal": 0, "totalAmount": 0, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 368} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 599, "currency": "EUR", "currencyRate": 1, "customerRef": {"companyName": "Mr Abe", "id": "c3bf08a3-4d51-4859-acbb-5075f9484f87"}, "discountPercentage": 0, "dueDate": "2019-11-29T00:00:00Z", "id": "91dccc63-b1af-4363-bee0-2aec6bab1bef", "invoiceNumber": "19700002", "issueDate": "2019-11-08T00:00:00Z", "lineItems": [{"accountRef": {"id": "2421e8a0-5355-4ec0-af11-021fe4f39fcd", "name": "Omzet binnenland hoog tarief"}, "description": "Consultancy per uur - Consultancy per uur", "discountAmount": 0, "isDirectIncome": false, "quantity": 8, "subTotal": 600, "taxAmount": 0, "totalAmount": 600, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 75}], "modifiedDate": "2022-10-26T13:57:52Z", "paidOnDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2019-11-08T11:56:22Z", "status": "PartiallyPaid", "subTotal": 600, "totalAmount": 600, "totalTaxAmount": 0, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 30.25, "currency": "EUR", "currencyRate": 1, "customerRef": {"companyName": "Cust 03", "id": "46951dc4-a170-42ce-bb38-9a80b776404f"}, "discountPercentage": 0, "dueDate": "2019-12-04T00:00:00Z", "id": "0078bc15-10a4-433d-86fa-b1bb235fc0ab", "invoiceNumber": "19700004", "issueDate": "2019-11-13T00:00:00Z", "lineItems": [{"accountRef": {"id": "2421e8a0-5355-4ec0-af11-021fe4f39fcd", "name": "Omzet binnenland hoog tarief"}, "description": "Standaard artikel - Standaard artikel", "discountAmount": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 25, "taxAmount": 5.25, "totalAmount": 30.25, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 25}], "modifiedDate": "2022-10-26T13:57:52Z", "paidOnDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2019-11-13T11:47:51Z", "status": "Submitted", "subTotal": 25, "totalAmount": 30.25, "totalTaxAmount": 5.25, "withholdingTax": []}], "totalResults": 5844} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Some customer", "id": "570321bb-8b0c-49f1-a1f5-6fb1d6d94a62"}, "discountPercentage": 0, "dueDate": "2017-09-01T00:00:00Z", "id": "a05d1256-f253-46bd-aa13-c6f6a992aa47", "invoiceNumber": "17700002", "issueDate": "2017-08-02T00:00:00Z", "lineItems": [{"accountRef": {"id": "43acd218-6a95-445f-994c-660273e0ced9", "name": "Sales"}, "description": "A bunch of stuff - A bunch of stuff", "discountAmount": 0, "isDirectIncome": false, "quantity": 1000, "subTotal": 100000, "taxAmount": 0, "totalAmount": 100000, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 100}], "modifiedDate": "2022-10-26T13:39:08Z", "paidOnDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2017-08-02T18:23:43Z", "status": "Paid", "subTotal": 100000, "totalAmount": 100000, "totalTaxAmount": 0, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Some customer", "id": "570321bb-8b0c-49f1-a1f5-6fb1d6d94a62"}, "discountPercentage": 0, "dueDate": "2017-09-02T00:00:00Z", "id": "0981b5d1-a817-40be-a101-4848f7b1a258", "invoiceNumber": "17700004", "issueDate": "2017-08-03T00:00:00Z", "lineItems": [{"accountRef": {"id": "43acd218-6a95-445f-994c-660273e0ced9", "name": "Sales"}, "description": "A bunch of stuff - A bunch of stuff", "discountAmount": 0, "isDirectIncome": false, "quantity": 150, "subTotal": 15000, "taxAmount": 0, "totalAmount": 15000, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 100}], "modifiedDate": "2022-10-26T13:39:08Z", "paidOnDate": "2017-08-03T00:00:00Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2017-08-03T12:22:27Z", "status": "Paid", "subTotal": 15000, "totalAmount": 15000, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 4214} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "_Test 1", "id": "10123537"}, "dueDate": "2016-12-30T00:00:00", "id": "50541736", "invoiceNumber": "2348", "issueDate": "2016-12-30T00:00:00", "lineItems": [{"accountRef": {"id": "001", "name": "Sales"}, "description": "3.0 items with VatPercentage of 0.0", "discountAmount": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 25.26, "taxAmount": 0, "totalAmount": 25.26, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 25.26}, {"accountRef": {"id": "001", "name": "Sales"}, "description": "3 service charges with 0.0% vat", "discountAmount": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 8.85, "taxAmount": 0, "totalAmount": 8.85, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 8.85}, {"description": "Tax", "discountAmount": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 0, "taxAmount": 0, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:19Z", "paidOnDate": "2020-11-05T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -34.11}, "payment": {"currency": "GBP", "id": "262466203", "note": "E2E Test transaction 2 CREDIT �250.00 - Invoice receipt against 2348", "paidOnDate": "2020-11-05T00:00:00", "totalAmount": 250}}], "salesOrderRefs": [], "sourceModifiedDate": "2022-10-20T14:28:00Z", "status": "Paid", "subTotal": 34.11, "totalAmount": 34.11, "totalTaxAmount": 0, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 10766.74, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Alderley plc", "id": "6162023"}, "dueDate": "2017-02-08T00:00:00", "id": "21974783", "invoiceNumber": "023", "issueDate": "2017-01-09T00:00:00", "lineItems": [{"accountRef": {"id": "001", "name": "Sales"}, "description": "Laptop", "discountAmount": 0, "isDirectIncome": false, "quantity": 22, "subTotal": 11000, "taxAmount": 0, "totalAmount": 11000, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 500}, {"description": "Tax", "discountAmount": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 0, "taxAmount": 0, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:19Z", "paidOnDate": "2023-02-06T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -2}, "payment": {"currency": "GBP", "id": "154350605", "note": "Test Push Transaction OTHER �123.46 - Invoice receipt against 023 - Invoice receipt against 023", "paidOnDate": "2018-08-26T00:00:00", "totalAmount": 123.46}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"currency": "GBP", "id": "154350605", "note": "Test Push Transaction OTHER �123.46 - Invoice receipt against 023 - Invoice receipt against 023", "paidOnDate": "2018-08-26T00:00:00", "totalAmount": 123.46}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "214509356", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "214338075", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "214327399", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "214327371", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "214672049", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-22T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "214671769", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-22T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "214671495", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-22T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "214671482", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-22T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "214671308", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-22T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "216167014", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "215687795", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "216167064", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-12-02T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "256992092", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "256991833", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "256991177", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "256987893", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "256987069", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "256983353", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "256982947", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "256955690", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "256953648", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "216464177", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "216453277", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "216453273", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "216168092", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"currency": "GBP", "id": "216168080", "note": "�0.01 - Invoice receipt against 023", "paidOnDate": "2019-11-18T00:00:00", "totalAmount": 0.01}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -225}, "payment": {"currency": "GBP", "id": "260537850", "note": "E2E Test transaction 19 DEBIT �250.00 - E2 E Test Transaction 19 - E2 E Test Transaction 19 - Invoice receipt against 023", "paidOnDate": "2020-10-23T00:00:00", "totalAmount": 235}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -1}, "payment": {"currency": "GBP", "id": "413909805", "note": "�1.00 - Invoice receipt against 023", "paidOnDate": "2023-02-06T00:00:00", "totalAmount": 1}}], "salesOrderRefs": [], "sourceModifiedDate": "2023-02-06T15:31:38Z", "status": "PartiallyPaid", "subTotal": 11000, "totalAmount": 11000, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 1449} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 222.71, "currency": "USD", "customerRef": {"companyName": "ab1", "id": "602174"}, "dueDate": "1987-10-01T00:00:00", "id": "2596455", "invoiceNumber": "test-AL", "issueDate": "1987-10-01T00:00:00", "lineItems": [{"description": "Editing creative writing for a client", "discountAmount": 0, "isDirectIncome": false, "itemRef": {"id": "639579", "name": "Creative Writing Editorial"}, "quantity": 1, "subTotal": 222.88, "taxAmount": 0, "totalAmount": 222.88, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 222.88}, {"description": "", "discountAmount": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 0, "taxAmount": 0, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "note": "", "paidOnDate": "2023-03-03T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "USD", "currencyRate": 1, "totalAmount": -0.17}, "payment": {"currency": "USD", "id": "2570292", "note": "", "paidOnDate": "2023-03-03T00:00:00", "totalAmount": 0.17}}], "salesOrderRefs": [], "sourceModifiedDate": "2023-03-03T09:27:42", "status": "Submitted", "subTotal": 222.88, "totalAmount": 222.88, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "customerRef": {"companyName": "Wood Turnerss", "id": "512927"}, "dueDate": "2016-04-04T00:00:00", "id": "2396753", "invoiceNumber": "0000062", "issueDate": "2016-04-04T00:00:00", "lineItems": [], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "note": "", "paidOnDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2021-02-24T07:34:31", "status": "Submitted", "subTotal": 0, "totalAmount": 0, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 172} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "EUR", "currencyRate": 0.844737287, "customerRef": {"companyName": "Mr French Person", "id": "86832299"}, "dueDate": "2006-01-12T00:00:00", "id": "143008521", "invoiceNumber": "40", "issueDate": "2005-12-15T00:00:00", "lineItems": [{"accountRef": {"id": "0"}, "isDirectIncome": false, "quantity": 0, "subTotal": 0, "taxAmount": 0, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-09-30T10:29:15Z", "paidOnDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 0, "totalAmount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "EUR", "currencyRate": 0.844737287, "customerRef": {"companyName": "Mr French Person", "id": "86832299"}, "dueDate": "2010-01-29T00:00:00", "id": "143008597", "invoiceNumber": "41", "issueDate": "2010-01-01T00:00:00", "lineItems": [{"accountRef": {"id": "0"}, "isDirectIncome": false, "quantity": 0, "subTotal": 0, "taxAmount": 0, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-09-30T10:29:15Z", "paidOnDate": "2020-11-03T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR", "currencyRate": 1, "totalAmount": 0}, "payment": {"currency": "EUR", "id": "146438947", "note": "", "paidOnDate": "2020-11-03T00:00:00", "totalAmount": 0}}], "salesOrderRefs": [], "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 0, "totalAmount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 37} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "10 Breww Ltd", "id": "417"}, "dueDate": "2021-04-30T00:00:00", "id": "416", "invoiceNumber": "INV01", "issueDate": "2021-04-09T00:00:00", "lineItems": [{"accountRef": {"id": "54", "name": "Sales"}, "description": "Non-Recurring Services - EC", "isDirectIncome": false, "itemRef": {"id": "28", "name": "Non-Recurring Services - EC"}, "quantity": 1, "subTotal": 100, "totalAmount": 100, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "location-1"}], "unitAmount": 100}], "modifiedDate": "2022-09-20T08:16:10Z", "paidOnDate": "2021-04-20T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10}, "payment": {"accountRef": {"id": "122", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "id": "428", "paidOnDate": "2021-04-20T00:00:00", "reference": "Payment #PYMT01", "totalAmount": 90}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -90}, "payment": {"accountRef": {"id": "122", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "id": "428", "paidOnDate": "2021-04-20T00:00:00", "reference": "Payment #PYMT01", "totalAmount": 90}}], "salesOrderRefs": [], "sourceModifiedDate": "2021-08-25T15:55:36", "status": "Paid", "subTotal": 100, "totalAmount": 100, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 5.8, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "10 Breww Ltd", "id": "417"}, "dueDate": "2021-04-30T00:00:00", "id": "8529", "invoiceNumber": "INV63", "issueDate": "2021-04-09T00:00:00", "lineItems": [{"accountRef": {"id": "54", "name": "Sales"}, "description": "Andy Test Item", "isDirectIncome": false, "itemRef": {"id": "143", "name": "Andy Test Item"}, "quantity": 3, "subTotal": 6, "totalAmount": 6, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "classification-2"}, {"id": "department-1"}, {"id": "location-1"}], "unitAmount": 2}, {"accountRef": {"id": "54", "name": "Sales"}, "description": "Non-Recurring Services - EC", "isDirectIncome": false, "itemRef": {"id": "28", "name": "Non-Recurring Services - EC"}, "quantity": 5, "subTotal": 20, "totalAmount": 20, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "classification-2"}, {"id": "department-1"}, {"id": "location-1"}], "unitAmount": 4}], "modifiedDate": "2022-09-20T08:16:10Z", "paidOnDate": "2022-09-12T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10}, "payment": {"accountRef": {"id": "1", "name": "Cheque Account"}, "currency": "GBP", "currencyRate": 1, "id": "17588", "note": "Payment Example - Invoice allocation", "paidOnDate": "2022-06-01T00:00:00", "reference": "Payment #PYMT90", "totalAmount": 10}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10}, "payment": {"accountRef": {"id": "1", "name": "Cheque Account"}, "currency": "GBP", "currencyRate": 1, "id": "17589", "note": "Example - Payment of an invoice", "paidOnDate": "2022-06-01T00:00:00", "reference": "Payment #PYMT91", "totalAmount": 20}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.1}, "payment": {"accountRef": {"id": "1", "name": "Cheque Account"}, "currency": "GBP", "currencyRate": 1, "id": "24558", "note": "Test Push Payments - 1 test", "paidOnDate": "2022-09-12T00:00:00", "reference": "Payment #PYMT109", "totalAmount": 0.1}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.1}, "payment": {"accountRef": {"id": "1", "name": "Cheque Account"}, "currency": "GBP", "currencyRate": 1, "id": "24659", "note": "Test Push Payments - 1 test", "paidOnDate": "2022-09-12T00:00:00", "reference": "Payment #PYMT111", "totalAmount": 0.1}}], "salesOrderRefs": [], "sourceModifiedDate": "2022-02-24T13:51:58", "status": "PartiallyPaid", "subTotal": 26, "totalAmount": 26, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 107} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Prentice, Adelaide", "id": "420000-1071522044"}, "discountPercentage": 0, "dueDate": "2023-12-28T00:00:00", "id": "2453-1071526256", "invoiceNumber": "975", "issueDate": "2022-11-28T00:00:00", "lineItems": [{"description": "Foundation slab - prep and pouring", "isDirectIncome": false, "itemRef": {"id": "320000-1071525597", "name": "Concrete Slab"}, "quantity": 1, "subTotal": 167.5, "taxAmount": 0, "taxRateRef": {"id": "20000-999022286", "name": "Non-Taxable Sales"}, "totalAmount": 167.5, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 167.5}, {"isDirectIncome": false, "quantity": 1, "subTotal": 0, "taxAmount": 0, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Rough lumber", "isDirectIncome": false, "itemRef": {"id": "1C0000-933272656", "name": "Lumber:Rough"}, "quantity": 1, "subTotal": 48, "taxAmount": 0, "taxRateRef": {"id": "10000-999022286", "name": "Taxable Sales"}, "totalAmount": 48, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 48}, {"description": "Trim lumber", "isDirectIncome": false, "itemRef": {"id": "1D0000-933272656", "name": "Lumber:Trim"}, "quantity": 1, "subTotal": 38, "taxAmount": 0, "taxRateRef": {"id": "10000-999022286", "name": "Taxable Sales"}, "totalAmount": 38, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Project", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 38}, {"description": "Window", "isDirectIncome": false, "itemRef": {"id": "1F0000-933272656", "name": "Window"}, "quantity": 2, "subTotal": 50, "taxAmount": 0, "taxRateRef": {"id": "10000-999022286", "name": "Taxable Sales"}, "totalAmount": 50, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 25}, {"description": "Flooring", "isDirectIncome": false, "itemRef": {"id": "310000-1071509547", "name": "Flooring"}, "quantity": 1, "subTotal": 50, "taxAmount": 0, "taxRateRef": {"id": "10000-999022286", "name": "Taxable Sales"}, "totalAmount": 50, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 50}, {"description": "Window", "isDirectIncome": false, "itemRef": {"id": "1F0000-933272656", "name": "Window"}, "quantity": 2, "subTotal": 60, "taxAmount": 0, "taxRateRef": {"id": "10000-999022286", "name": "Taxable Sales"}, "totalAmount": 60, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 30}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:08:12Z", "paidOnDate": "2023-01-15T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -431.95}, "payment": {"accountRef": {"id": "80000-933270541", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "id": "6973-1197775625", "note": "Check - 80000-933270541", "paidOnDate": "2023-01-15T00:00:00", "reference": "983409", "totalAmount": 431.95}}], "salesOrderRefs": [], "sourceModifiedDate": "2023-12-16T05:06:11", "status": "Paid", "subTotal": 413.5, "totalAmount": 431.95, "totalDiscount": 0, "totalTaxAmount": 18.45, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Melton, Johnny", "id": "220000-933272658"}, "discountPercentage": 0, "dueDate": "2023-12-30T00:00:00", "id": "469E-1071530054", "invoiceNumber": "978", "issueDate": "2022-11-30T00:00:00", "lineItems": [{"description": "See attached specification for details on work below.", "isDirectIncome": false, "quantity": 1, "subTotal": 0, "taxAmount": 0, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": 0}, {"isDirectIncome": false, "quantity": 1, "subTotal": 0, "taxAmount": 0, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": 0}, {"description": "Installation labor", "isDirectIncome": false, "itemRef": {"id": "20000-933272655", "name": "Installation"}, "quantity": 1, "subTotal": 45.5, "taxAmount": 0, "taxRateRef": {"id": "20000-999022286", "name": "Non-Taxable Sales"}, "totalAmount": 45.5, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": 45.5}, {"description": "Install drywall", "isDirectIncome": false, "itemRef": {"id": "70000-933272656", "name": "Subs:Drywall"}, "quantity": 1, "subTotal": 1320, "taxAmount": 0, "taxRateRef": {"id": "20000-999022286", "name": "Non-Taxable Sales"}, "totalAmount": 1320, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": 1320}, {"description": "Electrical work", "isDirectIncome": false, "itemRef": {"id": "80000-933272656", "name": "Subs:Electrical"}, "quantity": 1, "subTotal": 1650, "taxAmount": 0, "taxRateRef": {"id": "20000-999022286", "name": "Non-Taxable Sales"}, "totalAmount": 1650, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": 1650}, {"description": "Metal Work", "isDirectIncome": false, "itemRef": {"id": "A0000-933272656", "name": "Subs:Metal Wrk"}, "quantity": 1, "subTotal": 660, "taxAmount": 0, "taxRateRef": {"id": "20000-999022286", "name": "Non-Taxable Sales"}, "totalAmount": 660, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": 660}, {"description": "Install insulation", "isDirectIncome": false, "itemRef": {"id": "90000-933272656", "name": "Subs:Insulating"}, "quantity": 1, "subTotal": 1100, "taxAmount": 0, "taxRateRef": {"id": "20000-999022286", "name": "Non-Taxable Sales"}, "totalAmount": 1100, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": 1100}, {"description": "Plumbing", "isDirectIncome": false, "itemRef": {"id": "C0000-933272656", "name": "Subs:Plumbing"}, "quantity": 1, "subTotal": 1650, "taxAmount": 0, "taxRateRef": {"id": "20000-999022286", "name": "Non-Taxable Sales"}, "totalAmount": 1650, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": 1650}, {"description": "Painting", "isDirectIncome": false, "itemRef": {"id": "B0000-933272656", "name": "Subs:Painting"}, "quantity": 1, "subTotal": 2420, "taxAmount": 0, "taxRateRef": {"id": "20000-999022286", "name": "Non-Taxable Sales"}, "totalAmount": 2420, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": 2420}, {"description": "Install carpeting", "isDirectIncome": false, "itemRef": {"id": "60000-933272656", "name": "Subs:Carpet"}, "quantity": 1, "subTotal": 3300, "taxAmount": 0, "taxRateRef": {"id": "20000-999022286", "name": "Non-Taxable Sales"}, "totalAmount": 3300, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": 3300}, {"description": "Custom Bay Window", "isDirectIncome": false, "itemRef": {"id": "1F0000-933272656", "name": "Window"}, "quantity": 1, "subTotal": 1925, "taxAmount": 0, "taxRateRef": {"id": "10000-999022286", "name": "Taxable Sales"}, "totalAmount": 1925, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": 1925}, {"description": "Window", "isDirectIncome": false, "itemRef": {"id": "1F0000-933272656", "name": "Window"}, "quantity": 1, "subTotal": 115.5, "taxAmount": 0, "taxRateRef": {"id": "10000-999022286", "name": "Taxable Sales"}, "totalAmount": 115.5, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": 115.5}, {"description": "Equipment Rental", "isDirectIncome": false, "itemRef": {"id": "230000-933272656", "name": "Equip Rental"}, "quantity": 1, "subTotal": 700, "taxAmount": 0, "taxRateRef": {"id": "20000-999022286", "name": "Non-Taxable Sales"}, "totalAmount": 700, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": 700}, {"description": "10% retainage to be billed after job is complete and approved.", "isDirectIncome": false, "itemRef": {"id": "260000-933272656", "name": "Retainage 1"}, "quantity": 1, "subTotal": -555.5, "taxAmount": 0, "taxRateRef": {"id": "20000-999022286", "name": "Non-Taxable Sales"}, "totalAmount": -555.5, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": -555.5}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:08:12Z", "paidOnDate": "2023-01-10T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -14488.64}, "payment": {"accountRef": {"id": "80000-933270541", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "id": "6915-1197775450", "note": "Check - 80000-933270541", "paidOnDate": "2023-01-10T00:00:00", "reference": "19650", "totalAmount": 14488.64}}], "salesOrderRefs": [], "sourceModifiedDate": "2023-12-16T05:06:09", "status": "Paid", "subTotal": 14330.5, "totalAmount": 14488.64, "totalDiscount": 0, "totalTaxAmount": 158.14, "withholdingTax": []}], "totalResults": 113} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 3296.44, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Information Sharing Technology", "id": "3"}, "dueDate": "2019-03-20T00:00:00", "id": "16", "invoiceNumber": "1001", "issueDate": "2019-02-18T00:00:00", "lineItems": [{"accountRef": {"id": "1", "name": "Sales"}, "description": "Service", "isDirectIncome": false, "itemRef": {"id": "1", "name": "Sales"}, "quantity": 10, "subTotal": 5000, "taxAmount": 0, "totalAmount": 5000, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 500}], "modifiedDate": "2023-01-18T11:03:02Z", "note": "Invoice for service", "paidOnDate": "2020-06-01T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -37.77}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "500", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-20T00:00:00", "reference": "498254", "totalAmount": 37.77}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -54.62}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "507", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-20T00:00:00", "reference": "505288", "totalAmount": 62.82}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5.08}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "499", "note": "Payments of type Cash", "paidOnDate": "2020-02-20T00:00:00", "reference": "498147", "totalAmount": 1017}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -48.74}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "491", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-18T00:00:00", "reference": "489239", "totalAmount": 48.74}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -7.74}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "490", "note": "Payments of type Cash", "paidOnDate": "2020-02-18T00:00:00", "reference": "489120", "totalAmount": 1112.76}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -33.9}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "482", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-17T00:00:00", "reference": "480242", "totalAmount": 33.9}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10.21}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "481", "note": "Payments of type Cash", "paidOnDate": "2020-02-17T00:00:00", "reference": "480129", "totalAmount": 965.85}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -41.38}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "470", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-13T00:00:00", "reference": "468248", "totalAmount": 67.83}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -7.47}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "463", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-13T00:00:00", "reference": "461243", "totalAmount": 7.47}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -34.76}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "462", "note": "Payments of type Cash", "paidOnDate": "2020-02-13T00:00:00", "reference": "461144", "totalAmount": 914.05}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -33.72}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "456", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-11T00:00:00", "reference": "454252", "totalAmount": 70.44}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -24.95}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "447", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-11T00:00:00", "reference": "445278", "totalAmount": 24.95}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -17.96}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "446", "note": "Payments of type Cash", "paidOnDate": "2020-02-11T00:00:00", "reference": "44518", "totalAmount": 904.82}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -6.03}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "438", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-10T00:00:00", "reference": "436234", "totalAmount": 6.03}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -31.48}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "437", "note": "Payments of type Cash", "paidOnDate": "2020-02-10T00:00:00", "reference": "436168", "totalAmount": 760.05}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "647", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-03-20T00:00:00", "reference": "645263", "totalAmount": 40.43}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -28.75}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "429", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-09T00:00:00", "reference": "427270", "totalAmount": 56.75}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -8.92}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "420", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-08T00:00:00", "reference": "418258", "totalAmount": 8.92}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -2.55}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "419", "note": "Payments of type Cash", "paidOnDate": "2020-02-08T00:00:00", "reference": "418157", "totalAmount": 407.2}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -25}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "705", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-04-03T00:00:00", "reference": "703246", "totalAmount": 25}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -6.22}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "411", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-07T00:00:00", "reference": "409292", "totalAmount": 6.22}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -33.79}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "410", "note": "Payments of type Cash", "paidOnDate": "2020-02-07T00:00:00", "reference": "409145", "totalAmount": 725.48}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "772", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-04-24T00:00:00", "reference": "770263", "totalAmount": 10.35}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "779", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-04-24T00:00:00", "reference": "777217", "totalAmount": 39.55}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "792", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-04-29T00:00:00", "reference": "790262", "totalAmount": 12.46}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -29.29}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "402", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-06T00:00:00", "reference": "400275", "totalAmount": 32.88}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -16.73}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "393", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-05T00:00:00", "reference": "391247", "totalAmount": 16.73}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -47.35}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "392", "note": "Payments of type Cash", "paidOnDate": "2020-02-05T00:00:00", "reference": "391115", "totalAmount": 1094.8}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -9.99}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "386", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-04T00:00:00", "reference": "384213", "totalAmount": 9.99}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -13.4}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "385", "note": "Payments of type Cash", "paidOnDate": "2020-02-04T00:00:00", "reference": "38418", "totalAmount": 858.41}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -39.06}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "377", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-03T00:00:00", "reference": "375298", "totalAmount": 39.06}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -11.54}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "376", "note": "Payments of type Cash", "paidOnDate": "2020-02-03T00:00:00", "reference": "375123", "totalAmount": 802.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -12.15}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "368", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-02T00:00:00", "reference": "366288", "totalAmount": 12.15}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -25.4}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "367", "note": "Payments of type Cash", "paidOnDate": "2020-02-02T00:00:00", "reference": "366195", "totalAmount": 827.2}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -40.61}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "361", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-01T00:00:00", "reference": "359220", "totalAmount": 54.12}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -25.32}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "349", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-31T00:00:00", "reference": "347216", "totalAmount": 25.32}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -7.07}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "348", "note": "Payments of type Cash", "paidOnDate": "2020-01-31T00:00:00", "reference": "34710", "totalAmount": 949.74}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -26.59}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "342", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-30T00:00:00", "reference": "340292", "totalAmount": 26.59}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -29.21}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "341", "note": "Payments of type Cash", "paidOnDate": "2020-01-30T00:00:00", "reference": "340128", "totalAmount": 859.44}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -17.58}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "333", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-30T00:00:00", "reference": "331236", "totalAmount": 17.94}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -14.33}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "322", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-29T00:00:00", "reference": "320256", "totalAmount": 14.33}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -27.08}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "321", "note": "Payments of type Cash", "paidOnDate": "2020-01-29T00:00:00", "reference": "320186", "totalAmount": 798.79}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -41.47}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "313", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-29T00:00:00", "reference": "311211", "totalAmount": 45.06}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -17.04}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "304", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-28T00:00:00", "reference": "302284", "totalAmount": 17.04}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -6.66}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "303", "note": "Payments of type Cash", "paidOnDate": "2020-01-28T00:00:00", "reference": "302128", "totalAmount": 837.68}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -14.92}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "297", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-27T00:00:00", "reference": "295264", "totalAmount": 14.92}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -4.18}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "296", "note": "Payments of type Cash", "paidOnDate": "2020-01-27T00:00:00", "reference": "295176", "totalAmount": 687.33}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -12.73}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "288", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-26T00:00:00", "reference": "286250", "totalAmount": 12.73}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -6.97}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "287", "note": "Payments of type Cash", "paidOnDate": "2020-01-26T00:00:00", "reference": "286188", "totalAmount": 539.55}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -30.58}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "279", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-25T00:00:00", "reference": "277281", "totalAmount": 30.58}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -37.08}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "278", "note": "Payments of type Cash", "paidOnDate": "2020-01-25T00:00:00", "reference": "277153", "totalAmount": 1063.48}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -11.69}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "270", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-24T00:00:00", "reference": "268269", "totalAmount": 11.69}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -48.58}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "269", "note": "Payments of type Cash", "paidOnDate": "2020-01-24T00:00:00", "reference": "268154", "totalAmount": 968.21}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -7.24}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "263", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-24T00:00:00", "reference": "261215", "totalAmount": 7.24}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -15.02}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "262", "note": "Payments of type Cash", "paidOnDate": "2020-01-24T00:00:00", "reference": "261162", "totalAmount": 425.69}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -16.6}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "256", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-23T00:00:00", "reference": "254258", "totalAmount": 37.68}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10.84}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "249", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-23T00:00:00", "reference": "247245", "totalAmount": 22.03}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -31.98}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "240", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-01-23T00:00:00", "reference": "238213", "totalAmount": 47.7}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -30.52}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "231", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-23T00:00:00", "reference": "229276", "totalAmount": 38.7}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -19.67}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "218", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-22T00:00:00", "reference": "216237", "totalAmount": 19.67}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -1.66}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "217", "note": "Payments of type Cash", "paidOnDate": "2020-01-22T00:00:00", "reference": "216161", "totalAmount": 565.24}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -27.62}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "209", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-21T00:00:00", "reference": "207254", "totalAmount": 27.62}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -7.86}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "208", "note": "Payments of type Cash", "paidOnDate": "2020-01-21T00:00:00", "reference": "207189", "totalAmount": 914.33}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -18.35}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "200", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-20T00:00:00", "reference": "198234", "totalAmount": 18.35}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -20.22}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "199", "note": "Payments of type Cash", "paidOnDate": "2020-01-20T00:00:00", "reference": "198128", "totalAmount": 1209.15}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -16.44}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "191", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-17T00:00:00", "reference": "18922", "totalAmount": 16.44}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -13.34}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "190", "note": "Payments of type Cash", "paidOnDate": "2020-01-17T00:00:00", "reference": "189174", "totalAmount": 607.48}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -47.91}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "182", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-17T00:00:00", "reference": "180274", "totalAmount": 47.91}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10.04}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "181", "note": "Payments of type Cash", "paidOnDate": "2020-01-17T00:00:00", "reference": "180197", "totalAmount": 1087.13}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -26.29}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "173", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-15T00:00:00", "reference": "171213", "totalAmount": 35.36}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -39.98}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "166", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-15T00:00:00", "reference": "164260", "totalAmount": 39.98}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -18.99}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "165", "note": "Payments of type Cash", "paidOnDate": "2020-01-15T00:00:00", "reference": "164142", "totalAmount": 913.09}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -4.87}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "157", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-15T00:00:00", "reference": "155266", "totalAmount": 14.32}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -11.57}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "150", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-13T00:00:00", "reference": "148217", "totalAmount": 11.57}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -22.26}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "149", "note": "Payments of type Cash", "paidOnDate": "2020-01-13T00:00:00", "reference": "148151", "totalAmount": 643.97}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -27.88}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "141", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-13T00:00:00", "reference": "139288", "totalAmount": 27.88}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -13.71}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "140", "note": "Payments of type Cash", "paidOnDate": "2020-01-13T00:00:00", "reference": "139163", "totalAmount": 1078.72}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -42.36}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "132", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-10T00:00:00", "reference": "13022", "totalAmount": 47.38}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -34.45}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "123", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-10T00:00:00", "reference": "121293", "totalAmount": 34.45}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -16.31}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "122", "note": "Payments of type Cash", "paidOnDate": "2020-01-10T00:00:00", "reference": "121197", "totalAmount": 771.61}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -23.86}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "116", "note": "Payments of type Prepaid", "paidOnDate": "2020-01-10T00:00:00", "reference": "114213", "totalAmount": 65.77}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "521", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-02-20T00:00:00", "reference": "519243", "totalAmount": 14.74}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "843", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-05-07T00:00:00", "reference": "841264", "totalAmount": 25.64}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "850", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-05-14T00:00:00", "reference": "848254", "totalAmount": 53.68}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -0.01}, "payment": {"accountRef": {"id": "60", "name": "Money (oney)"}, "currency": "GBP", "currencyRate": 1, "id": "877", "note": "Payments of type PrepaidPayment", "paidOnDate": "2020-06-01T00:00:00", "reference": "875210", "totalAmount": 12.7}}], "salesOrderRefs": [], "sourceModifiedDate": "2022-09-20T10:12:08Z", "status": "PartiallyPaid", "subTotal": 5000, "totalAmount": 5000, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 3200, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Software Coperation", "id": "2"}, "dueDate": "2019-03-20T00:00:00", "id": "17", "invoiceNumber": "1002", "issueDate": "2019-02-18T00:00:00", "lineItems": [{"accountRef": {"id": "1", "name": "Sales"}, "description": "IT Support", "isDirectIncome": false, "itemRef": {"id": "2", "name": "Hours"}, "quantity": 40, "subTotal": 3200, "taxAmount": 0, "totalAmount": 3200, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 80}], "modifiedDate": "2023-01-18T11:03:02Z", "paidOnDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2019-02-21T17:51:49Z", "status": "Submitted", "subTotal": 3200, "totalAmount": 3200, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 1326} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Ecker Holiday event", "id": "59"}, "dueDate": "2016-02-05T00:00:00", "id": "30", "invoiceNumber": "1002", "issueDate": "2016-01-06T00:00:00", "lineItems": [{"accountRef": {"id": "44", "name": "Sales"}, "description": "Holiday party - gold level test v1", "isDirectIncome": false, "itemRef": {"id": "7", "name": "Gold party"}, "quantity": 1, "subTotal": 2000, "taxAmount": 400, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Invoices", "name": "20.0% S Invoices"}, "totalAmount": 2400, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 2000}, {"accountRef": {"id": "68", "name": "Billable Expenses Income"}, "description": "Venue rental", "isDirectIncome": false, "itemRef": {"id": "20", "name": "Venue Rental"}, "quantity": 1, "subTotal": 10000, "taxAmount": 2000, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Invoices", "name": "20.0% S Invoices"}, "totalAmount": 12000, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 10000}, {"accountRef": {"id": "68", "name": "Billable Expenses Income"}, "description": "promotional items -- misc engraved items", "isDirectIncome": false, "itemRef": {"id": "12", "name": "Misc"}, "quantity": 75, "subTotal": 1012.5, "taxAmount": 202.5, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Invoices", "name": "20.0% S Invoices"}, "totalAmount": 1215, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 13.5}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:12Z", "paidOnDate": "2016-02-12T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -15615}, "payment": {"accountRef": {"id": "81", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "id": "31", "note": "", "paidOnDate": "2016-02-12T00:00:00", "totalAmount": 15615}}], "salesOrderRefs": [], "sourceModifiedDate": "2023-01-25T13:49:52Z", "status": "Paid", "subTotal": 13012.5, "totalAmount": 15615, "totalDiscount": 0, "totalTaxAmount": 2602.5, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 15615, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Ecker Holiday event", "id": "59"}, "dueDate": "2016-02-05T00:00:00", "id": "3793", "invoiceNumber": "276e29c1", "issueDate": "2016-01-06T00:00:00", "lineItems": [{"accountRef": {"id": "44", "name": "Sales"}, "description": "Holiday party - gold level test v1", "isDirectIncome": false, "itemRef": {"id": "7", "name": "Gold party"}, "quantity": 1, "subTotal": 2000, "taxAmount": 400, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Invoices", "name": "20.0% S Invoices"}, "totalAmount": 2400, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 2000}, {"accountRef": {"id": "68", "name": "Billable Expenses Income"}, "description": "Venue rental", "isDirectIncome": false, "itemRef": {"id": "20", "name": "Venue Rental"}, "quantity": 1, "subTotal": 10000, "taxAmount": 2000, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Invoices", "name": "20.0% S Invoices"}, "totalAmount": 12000, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 10000}, {"accountRef": {"id": "68", "name": "Billable Expenses Income"}, "description": "promotional items -- misc engraved items", "isDirectIncome": false, "itemRef": {"id": "12", "name": "Misc"}, "quantity": 75, "subTotal": 1012.5, "taxAmount": 202.5, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Invoices", "name": "20.0% S Invoices"}, "totalAmount": 1215, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 13.5}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:12Z", "paidOnDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2022-08-22T13:04:50Z", "status": "Submitted", "subTotal": 13012.5, "totalAmount": 15615, "totalDiscount": 0, "totalTaxAmount": 2602.5, "withholdingTax": []}], "totalResults": 1077} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 52.01, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "A1 Design Services", "id": "A1D001"}, "discountPercentage": 2.49, "dueDate": "2020-08-12T00:00:00Z", "id": "82322", "invoiceNumber": "0000000110", "issueDate": "2020-07-13T00:00:00Z", "lineItems": [{"description": "Tax Summary - Standard rate", "discountAmount": 0.22, "isDirectIncome": false, "quantity": 0, "subTotal": 0, "taxAmount": 8.67, "taxRateRef": {"effectiveTaxRate": 20, "id": "1729", "name": "Standard rate"}, "totalAmount": 8.67, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 1.08, "isDirectIncome": false, "quantity": 0, "subTotal": 43.34, "taxAmount": 0, "totalAmount": 43.34, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:36:12Z", "note": "0000000114", "paidOnDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2020-07-13T11:06:40Z", "status": "Submitted", "subTotal": 43.34, "totalAmount": 52.01, "totalDiscount": 1.3, "totalTaxAmount": 8.67, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 125, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Bronson Inc", "id": "BRO001"}, "discountPercentage": 2.5, "dueDate": "2020-08-29T00:00:00Z", "id": "83515", "invoiceNumber": "0000000111", "issueDate": "2020-07-15T00:00:00Z", "lineItems": [{"description": "Tax Summary - Zero rated", "discountAmount": 0, "isDirectIncome": false, "quantity": 0, "subTotal": 0, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "1728", "name": "Zero rated"}, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 3.13, "isDirectIncome": false, "quantity": 0, "subTotal": 125, "taxAmount": 0, "totalAmount": 125, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:36:12Z", "note": "0000000111", "paidOnDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2020-07-15T10:45:56Z", "status": "Submitted", "subTotal": 125, "totalAmount": 125, "totalDiscount": 3.13, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 409} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "A1 Design Services", "id": "A1D001"}, "dueDate": "2022-10-23T00:00:00Z", "id": "INV-1", "invoiceNumber": "1", "issueDate": "2021-01-02T00:00:00", "lineItems": [{"accountRef": {"id": "4000", "name": "Sales North"}, "description": "AT Mini Tower Case", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 14.25, "taxAmount": 2.43, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 16.68, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 14.25}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Whiteboard - Drywipe (900 x 1200)", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 4, "subTotal": 76, "taxAmount": 12.97, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 88.97, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 19}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "A4 Ledger Book - 5 Column", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 8, "subTotal": 60.72, "taxAmount": 10.36, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 71.08, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 7.59}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Shorthand Notebook - 80 Sheets", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 20, "subTotal": 85.4, "taxAmount": 14.57, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 99.97, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 4.27}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Calculator - Desktop", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 9.5, "taxAmount": 1.62, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 11.12, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 9.5}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Calculator - Desktop (Printing)", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 16.15, "taxAmount": 2.76, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 18.91, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 16.15}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Calculator - Printing Rolls", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 15, "subTotal": 85.5, "taxAmount": 14.59, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 100.09, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Project", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 5.7}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Correction Fluid - White", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 7, "subTotal": 16.59, "taxAmount": 2.83, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 19.42, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 2.37}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Envelope - White (110 x 220) Plain", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 20, "subTotal": 170.8, "taxAmount": 29.14, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 199.94, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 8.54}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Flip Chart - A1 Pad", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 10, "subTotal": 152, "taxAmount": 25.94, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 177.94, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 15.2}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Laminator Pouches - A4", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 5, "subTotal": 57, "taxAmount": 9.73, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 66.73, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 11.4}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Mouse Mat - (241 x 203) Blue", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 5, "subTotal": 7.1, "taxAmount": 1.21, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 8.31, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 1.42}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Copy Paper - Economy Grade", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 80, "subTotal": 196.8, "taxAmount": 33.58, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 230.38, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 2.46}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Coloured Paper - Pastel Blue", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 5, "subTotal": 18.05, "taxAmount": 3.08, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 21.13, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 3.61}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Ball Point Pen - Black", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 8, "subTotal": 15.2, "taxAmount": 2.59, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 17.79, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 1.9}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Pencil - HB", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 3, "subTotal": 7.11, "taxAmount": 1.21, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 8.32, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 2.37}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Remember-Me Sticky Notes (Recycled)", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 6, "subTotal": 19.92, "taxAmount": 3.4, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 23.32, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 3.32}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Scissors - Economy", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 2.85, "taxAmount": 0.49, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 3.34, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 2.85}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Adhesive Tape - Brown (50mm x 66m)", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 5, "subTotal": 13.3, "taxAmount": 2.27, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 15.57, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 2.66}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "JP010 Jet Printer Cartridge", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 5, "subTotal": 85.5, "taxAmount": 14.59, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 100.09, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 17.1}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Letter Trays - 3 pack (Red)", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 2, "subTotal": 13.3, "taxAmount": 2.27, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 15.57, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 6.65}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:42Z", "note": "", "paidOnDate": "2022-01-29T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -100.09}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -66.73}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -117.5}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -177.94}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -230.38}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -17.79}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -71.08}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -88.97}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -15.57}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -3.34}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -199.94}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -100.09}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -16.68}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -18.91}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -23.32}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -99.97}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -21.13}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -15.57}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -19.42}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -8.31}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -11.12}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -8.32}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "265", "note": "Sales receipt 265 linked to sales invoice inv-1.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 1432.17}}], "salesOrderRefs": [], "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Paid", "subTotal": 1223.04, "totalAmount": 1432.17, "totalDiscount": 0, "totalTaxAmount": 209.13, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Kinghorn & French", "id": "KIN001"}, "dueDate": "2022-10-23T00:00:00Z", "id": "INV-9", "invoiceNumber": "9", "issueDate": "2021-01-04T00:00:00", "lineItems": [{"accountRef": {"id": "4000", "name": "Sales North"}, "description": "PC Combo Pack 4", "discountAmount": 765, "discountPercentage": 20, "isDirectIncome": false, "quantity": 5, "subTotal": 3060, "taxAmount": 522.11, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 3582.11, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 765}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "PC Combo Pack 5", "discountAmount": 864, "discountPercentage": 20, "isDirectIncome": false, "quantity": 4, "subTotal": 3456, "taxAmount": 589.68, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 4045.68, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 1080}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "PC Combo Pack 6", "discountAmount": 540, "discountPercentage": 20, "isDirectIncome": false, "quantity": 2, "subTotal": 2160, "taxAmount": 368.55, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 2528.55, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 1350}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "FX030 Multifunctional Fax", "discountAmount": 165.6, "discountPercentage": 20, "isDirectIncome": false, "quantity": 2, "subTotal": 662.4, "taxAmount": 113.02, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 775.42, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 414}, {"accountRef": {"id": "4000", "name": "Sales North"}, "description": "Copy Paper - Premium Grade", "discountAmount": 61.2, "discountPercentage": 20, "isDirectIncome": false, "quantity": 100, "subTotal": 244.8, "taxAmount": 41.77, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 286.57, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 3.06}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:42Z", "note": "", "paidOnDate": "2022-01-29T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -276.57}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "271", "note": "Sales receipt 271 linked to sales invoice inv-9.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 11123.33}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -765.42}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "271", "note": "Sales receipt 271 linked to sales invoice inv-9.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 11123.33}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -4035.68}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "271", "note": "Sales receipt 271 linked to sales invoice inv-9.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 11123.33}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -2518.55}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "271", "note": "Sales receipt 271 linked to sales invoice inv-9.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 11123.33}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -3527.11}, "payment": {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "271", "note": "Sales receipt 271 linked to sales invoice inv-9.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 11123.33}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "272", "note": "Sales discount 272 linked to sales invoice inv-9.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "272", "note": "Sales discount 272 linked to sales invoice inv-9.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "272", "note": "Sales discount 272 linked to sales invoice inv-9.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "272", "note": "Sales discount 272 linked to sales invoice inv-9.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "272", "note": "Sales discount 272 linked to sales invoice inv-9.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -45}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "9", "note": "Sales credit tx-9 linked to sales invoice inv-9.", "paidOnDate": "2021-12-31T00:00:00", "totalAmount": 0}}], "salesOrderRefs": [], "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Paid", "subTotal": 9583.2, "totalAmount": 11218.33, "totalDiscount": 2395.8, "totalTaxAmount": 1635.13, "withholdingTax": []}], "totalResults": 86} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 1240, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Widgets Limited", "id": "f4ff85ba33dd11e797950a57719b2edb"}, "dueDate": "2017-06-07T00:00:00", "id": "b039b0a733de11e797950a57719b2edb", "invoiceNumber": "SI-1", "issueDate": "2017-05-08T00:00:00", "lineItems": [{"accountRef": {"id": "9a994b92267a11e797950a57719b2edb", "name": "Sales Type A"}, "description": "Consulting services", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "itemRef": {"id": "a87b922b33de11e797950a57719b2edb", "name": "Consulting services"}, "quantity": 8, "subTotal": 7200, "taxAmount": 1440, "taxRateRef": {"effectiveTaxRate": 20, "id": "GB_STANDARD", "name": "Standard 20.00%"}, "totalAmount": 8640, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 900}], "modifiedDate": "2022-10-24T15:03:37Z", "paidOnDate": "2021-07-23T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -1000}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "e1c2bd659a6111e8bad90617b3da4b8a", "note": "Sales credit note", "paidOnDate": "2018-08-07T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -1000}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "e1c2bd659a6111e8bad90617b3da4b8a", "note": "Sales credit note", "paidOnDate": "2018-08-07T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -1400}, "payment": {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "id": "579388a0215911e8b45c025132dab352", "note": "Customer receipt using credit/debit card", "paidOnDate": "2018-01-02T00:00:00", "totalAmount": 1400}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -4000}, "payment": {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "id": "52237e4e215911e8b45c025132dab352", "note": "Customer receipt using credit/debit card", "paidOnDate": "2018-01-02T00:00:00", "totalAmount": 4000}}], "salesOrderRefs": [], "sourceModifiedDate": "2021-07-23T13:42:59Z", "status": "PartiallyPaid", "subTotal": 7200, "totalAmount": 8640, "totalDiscount": 0, "totalTaxAmount": 1440, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Widgets Limited", "id": "f4ff85ba33dd11e797950a57719b2edb"}, "dueDate": "2018-04-04T00:00:00", "id": "6420b3f8209611e8b45c025132dab352", "invoiceNumber": "SI-2", "issueDate": "2018-03-05T00:00:00", "lineItems": [{"accountRef": {"id": "9a994b92267a11e797950a57719b2edb", "name": "Sales Type A"}, "description": "Consulting services", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "itemRef": {"id": "a87b922b33de11e797950a57719b2edb", "name": "Consulting services"}, "quantity": 5, "subTotal": 4500, "taxAmount": 900, "taxRateRef": {"effectiveTaxRate": 20, "id": "GB_STANDARD", "name": "Standard 20.00%"}, "totalAmount": 5400, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 900}], "modifiedDate": "2022-10-24T15:03:37Z", "paidOnDate": "2018-03-05T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5400}, "payment": {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "id": "73a0490d209611e8b45c025132dab352", "note": "Customer receipt using cash - PAYMENT-CASH-001", "paidOnDate": "2018-03-05T00:00:00", "totalAmount": 5400}}], "salesOrderRefs": [], "sourceModifiedDate": "2018-03-05T16:58:39Z", "status": "Paid", "subTotal": 4500, "totalAmount": 5400, "totalDiscount": 0, "totalTaxAmount": 900, "withholdingTax": []}], "totalResults": 10759} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/invoices?page=1&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "MK Manufacturing", "id": "12"}, "dueDate": "2021-05-22T00:00:00", "id": "2916", "invoiceNumber": "IN0480", "issueDate": "2021-04-22T00:00:00", "lineItems": [{"accountRef": {"id": "176", "name": "Revenue - Services"}, "isDirectIncome": false, "quantity": 1, "subTotal": 100, "taxAmount": 20, "taxRateRef": {"effectiveTaxRate": 20, "id": "105", "name": "UK Sale Services Standard Rate"}, "totalAmount": 120, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "CUSTOMER-12", "name": "MK Manufacturing"}, {"id": "DEPARTMENT-2", "name": "Services"}, {"id": "LOCATION-11", "name": "Codat Test Entity"}], "unitAmount": 100}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:54Z", "paidOnDate": "2021-04-22T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -120}, "payment": {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "id": "2918", "note": "", "paidOnDate": "2021-04-22T00:00:00", "totalAmount": 120}}], "salesOrderRefs": [], "sourceModifiedDate": "2021-04-22T11:01:11Z", "status": "Paid", "subTotal": 100, "totalAmount": 120, "totalDiscount": 0, "totalTaxAmount": 20, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 180, "currency": "USD", "currencyRate": 0.9294, "customerRef": {"companyName": "AG Insurance", "id": "6"}, "dueDate": "2022-10-28T00:00:00", "id": "18827", "invoiceNumber": "IN1515", "issueDate": "2022-09-28T00:00:00", "lineItems": [{"accountRef": {"id": "2", "name": "Accounts Receivable"}, "description": "test desc Test05102022-1", "isDirectIncome": false, "quantity": 1, "subTotal": 180, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "58", "name": "EC Sale Goods Standard Rate"}, "totalAmount": 180, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "CUSTOMER-6", "name": "AG Insurance"}, {"id": "DEPARTMENT-1", "name": "Sales"}, {"id": "LOCATION-11", "name": "Codat Test Entity"}], "unitAmount": 180}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:54Z", "note": "test desc Test05102022-1", "paidOnDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2022-10-05T11:02:22Z", "status": "Submitted", "subTotal": 180, "totalAmount": 180, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 2} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "USD", "currencyRate": 0.784736781, "customerRef": {"companyName": "ABC Textiles", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O0N1c3RvbWVyOjMyMzkzNTA4"}, "dueDate": "2019-10-17T00:00:00", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O0ludm9pY2U6NzgyNDQ4OTg1Nzc1MzE5MTYw", "invoiceNumber": "1", "issueDate": "2019-10-17T00:00:00", "lineItems": [{"accountRef": {"id": "QWNjb3VudDo3OTE3NTA2MDA0MjQ0NTExMTU7QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2", "name": "Sales"}, "description": "", "isDirectIncome": false, "itemRef": {"id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1Byb2R1Y3Q6MzU2NjcyNTI=", "name": "Golf balls"}, "quantity": 5, "subTotal": 50, "taxAmount": 2.5, "totalAmount": 52.5, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-11-16T18:15:23Z", "paidOnDate": "2019-12-05T23:20:36Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2019-12-05T23:20:36Z", "status": "Paid", "subTotal": 50, "totalAmount": 52.5, "totalTaxAmount": 2.5, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "NIC Cookies", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O0N1c3RvbWVyOjM2OTkxOTYw"}, "dueDate": "2020-03-05T00:00:00", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O0ludm9pY2U6ODgzOTc4MDA2NDIxMzUwODIx", "invoiceNumber": "2", "issueDate": "2020-03-05T00:00:00", "lineItems": [{"accountRef": {"id": "QWNjb3VudDo3OTE3NTA2MDA0MjQ0NTExMTU7QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2", "name": "Sales"}, "description": "Decorated cookies", "isDirectIncome": false, "itemRef": {"id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1Byb2R1Y3Q6NDEzNzEwOTU=", "name": "Cookies"}, "quantity": 50, "subTotal": 200, "taxAmount": 40, "totalAmount": 240, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 4}], "modifiedDate": "2022-11-16T18:15:23Z", "paidOnDate": "2020-03-30T14:10:21Z", "paymentAllocations": [], "salesOrderRefs": [], "sourceModifiedDate": "2020-03-30T14:10:21Z", "status": "Paid", "subTotal": 200, "totalAmount": 240, "totalTaxAmount": 40, "withholdingTax": []}], "totalResults": 19} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Maddox Publishing Group", "id": "afd4093b-c655-4847-8ee2-10a4f2c3eae3"}, "dueDate": "2022-01-17T00:00:00", "id": "321bfed3-2da2-4969-9358-4de97821181b", "invoiceNumber": "INV-001-0", "issueDate": "2021-12-20T00:00:00", "lineItems": [{"accountRef": {"id": "a969500a-377c-4cea-8f2b-a4e385607fd0", "name": "Other Revenue"}, "description": "Project management - onsite daily rate - your CRM integration project", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "itemRef": {"id": "aa1c5f84-4453-42fa-9c92-69d4085607c9", "name": "Project management - daily rate"}, "quantity": 6, "subTotal": 3500, "taxAmount": 700, "taxRateRef": {"effectiveTaxRate": 20, "id": "OUTPUT2", "name": "20% (VAT on Income)"}, "totalAmount": 4200, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "34b9b859-07a9-451a-b4d3-effc9946634a", "name": "North"}], "unitAmount": 583.3333333333}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:38:11Z", "paidOnDate": "2022-02-17T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -4200}, "payment": {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "65b746c8-9a5d-4a95-8096-d2316fcff592", "paidOnDate": "2022-02-17T00:00:00", "totalAmount": 4200}}], "salesOrderRefs": [], "sourceModifiedDate": "2021-01-02T20:34:51", "status": "Paid", "subTotal": 3500, "totalAmount": 4200, "totalDiscount": 0, "totalTaxAmount": 700, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Ridgeway University", "id": "a871a956-05b5-4e2a-9419-7aeb478ca647"}, "dueDate": "2022-02-17T00:00:00", "id": "4b6d0c8f-10fa-42cd-a6e5-53b175e90005", "invoiceNumber": "INV-0001", "issueDate": "2022-02-07T00:00:00", "lineItems": [{"accountRef": {"id": "c563b607-fb0e-4d06-9ddb-76fdeef20ae3", "name": "Sales"}, "description": "Retainer for consulting work", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 416.67, "taxAmount": 83.33, "taxRateRef": {"effectiveTaxRate": 20, "id": "OUTPUT2", "name": "20% (VAT on Income)"}, "totalAmount": 500, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 416.67}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:38:11Z", "paidOnDate": "2022-02-17T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -500}, "payment": {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "8c481b70-b5d7-4de4-a7f7-9e161be2c472", "paidOnDate": "2022-02-17T00:00:00", "reference": "", "totalAmount": 500}}], "salesOrderRefs": [], "sourceModifiedDate": "2021-01-02T22:51:43", "status": "Paid", "subTotal": 416.67, "totalAmount": 500, "totalDiscount": 0, "totalTaxAmount": 83.33, "withholdingTax": []}], "totalResults": 44} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/invoices?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/invoices?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/invoices"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Test Company", "id": "104957000000037097"}, "dueDate": "2020-02-17T00:00:00", "id": "104957000000038034", "invoiceNumber": "INV-102", "issueDate": "2020-02-06T10:54:03", "lineItems": [], "modifiedDate": "2022-10-03T08:40:37Z", "paidOnDate": "2020-05-19T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -9000}, "payment": {"accountRef": {"id": "104957000000000349", "name": "Petty Cash"}, "currency": "GBP", "currencyRate": 1, "id": "104957000000129048", "note": "", "paidOnDate": "2020-04-29T00:00:00", "reference": "9", "totalAmount": 9000}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -1}, "payment": {"accountRef": {"id": "104957000000060010", "name": "Abdi Test"}, "currency": "GBP", "currencyRate": 1, "id": "104957000000137017", "note": "", "paidOnDate": "2020-05-19T00:00:00", "reference": "11", "totalAmount": 9000}}], "salesOrderRefs": [], "sourceModifiedDate": "2020-05-19T15:36:26", "status": "Paid", "totalAmount": 9001, "totalTaxAmount": 0, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "amountDue": 0, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Test Company", "id": "104957000000037097"}, "dueDate": "2020-02-17T00:00:00", "id": "104957000000038052", "invoiceNumber": "INV-104", "issueDate": "2020-02-06T10:54:04", "lineItems": [], "modifiedDate": "2022-10-03T08:40:37Z", "paidOnDate": "2020-02-06T00:00:00", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -9001}, "payment": {"accountRef": {"id": "104957000000060010", "name": "Abdi Test"}, "currency": "GBP", "currencyRate": 1, "id": "104957000000070175", "note": "Cheque deposit", "paidOnDate": "2020-02-06T00:00:00", "reference": "4", "totalAmount": 9001}}], "salesOrderRefs": [], "sourceModifiedDate": "2020-02-17T14:21:05", "status": "Paid", "totalAmount": 9001, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 48} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + list-accounting-invoice-attachments: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + invoiceId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-reconciled-invoices: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + responses: + "200": + application/json: {"reportInfo": {"companyName": "Small Sandbox", "generatedDate": "2023-05-10T10:50:23.9437977Z", "pageNumber": 1, "pageSize": 10, "reportName": "Invoices report", "totalResults": 101}, "reportItems": [{"amountDue": 0, "currency": "GBP", "customerRef": {"customerName": "Serena Keeling", "id": "ee4d0eee-063d-4c9f-8226-2c9a6a816249"}, "dueDate": "2021-04-06T09:44:00", "id": "15221fa4-e91a-4f64-a2bb-caeab4db85a4", "invoiceNumber": "UDs5KlfE", "issueDate": "2021-04-06T09:44:00", "modifiedDate": "2022-04-11T13:49:37Z", "paidOnDate": "2021-04-06T09:44:00", "payments": [], "sourceModifiedDate": "2022-02-27T18:28:00", "status": "Paid", "totalAmount": 7044.83}, {"amountDue": 0, "currency": "GBP", "customerRef": {"customerName": "Quinton Kovacek", "id": "81e9c0df-3e5e-4180-b20c-c8e58100cdf3"}, "dueDate": "2021-04-06T09:44:00", "id": "58aea1cb-5b31-4eed-ba16-489dfa67a831", "invoiceNumber": "1IU1PMoT", "issueDate": "2021-04-06T09:44:00", "modifiedDate": "2022-04-11T13:49:37Z", "paidOnDate": "2021-04-06T09:44:00", "payments": [], "sourceModifiedDate": "2021-06-23T22:47:00", "status": "Paid", "totalAmount": 3567.59}, {"amountDue": 0, "currency": "GBP", "customerRef": {"customerName": "Antwon Dach", "id": "c7326084-cd56-48e6-bcfa-be8919e024e1"}, "dueDate": "2021-04-18T01:27:00", "id": "9ecd07bc-9cab-4516-bad0-a0cd565cdbaf", "invoiceNumber": "eEIWyPN4", "issueDate": "2021-04-08T01:27:00", "modifiedDate": "2022-08-01T09:44:59Z", "paidOnDate": "2021-04-10T12:31:00", "payments": [{"amount": 153233.36, "bankingTransactionRefs": [], "currency": "GBP", "currencyRate": 1, "date": "2021-04-10T12:31:00", "id": "0878e8be-6746-4347-80ba-5491328c8411", "paymentType": "payments"}], "sourceModifiedDate": "2021-11-11T12:10:00", "status": "Paid", "totalAmount": 153233.36}, {"amountDue": 0, "currency": "GBP", "customerRef": {"customerName": "Dolores Rath", "id": "44e8516d-bcb0-459f-9e5d-7beaa56d57d0"}, "dueDate": "2021-04-23T17:30:00", "id": "7cea078a-5c9a-4788-ae72-9bb60c5cc184", "invoiceNumber": "BXb8mYQW", "issueDate": "2021-04-16T17:30:00", "modifiedDate": "2022-04-11T13:49:37Z", "paidOnDate": "2021-04-23T17:30:00", "payments": [{"amount": 12657.69, "bankingTransactionRefs": [], "currency": "GBP", "currencyRate": 1, "date": "2021-04-23T17:30:00", "id": "17b42934-13f6-4738-a506-2e253b1a606f", "paymentType": "payments"}], "sourceModifiedDate": "2021-12-08T11:32:00", "status": "Paid", "totalAmount": 12657.69}, {"amountDue": 381.09, "currency": "GBP", "customerRef": {"customerName": "Bryana Douglas", "id": "5cbaf1af-4f02-4206-85ab-c525bd9b4f99"}, "dueDate": "2021-04-27T06:46:00", "id": "aa4503d7-fe01-49fe-ba42-259b421ac640", "invoiceNumber": "wdjwiL5B", "issueDate": "2021-04-20T06:46:00", "modifiedDate": "2022-04-11T13:49:37Z", "paidOnDate": "2022-10-23T00:00:00Z", "payments": [{"amount": 12554.3, "bankingTransactionRefs": [], "currency": "GBP", "currencyRate": 1, "date": "2021-04-23T14:59:00", "id": "1c03986b-9b6c-4220-bde6-4e3eba6cef9f", "paymentType": "payments"}], "sourceModifiedDate": "2022-03-11T20:03:00", "status": "PartiallyPaid", "totalAmount": 12935.39}, {"amountDue": 0, "currency": "GBP", "customerRef": {"customerName": "Brady Wilderman", "id": "6f5290e5-70aa-4d0c-816e-9d2312cf217f"}, "dueDate": "2021-05-03T09:32:00", "id": "d8a0e26e-4ec8-4fb5-887d-8b7531e3bedf", "invoiceNumber": "cTjJcu8x", "issueDate": "2021-04-23T09:32:00", "modifiedDate": "2022-04-11T13:49:37Z", "paidOnDate": "2021-05-03T09:32:00", "payments": [{"amount": 21506.72, "bankingTransactionRefs": [], "currency": "GBP", "currencyRate": 1, "date": "2021-05-03T09:32:00", "id": "93c9c11b-3ec0-4314-85f6-0751763e752a", "paymentType": "payments"}], "sourceModifiedDate": "2021-03-12T22:37:00", "status": "Paid", "totalAmount": 21526.72}, {"amountDue": 1225.06, "currency": "GBP", "customerRef": {"customerName": "Dolores Rath", "id": "44e8516d-bcb0-459f-9e5d-7beaa56d57d0"}, "dueDate": "2021-05-11T23:23:00", "id": "06890e67-35fb-4276-9857-95db40cfd15d", "invoiceNumber": "htXJuUDb", "issueDate": "2021-05-01T23:23:00", "modifiedDate": "2022-08-01T09:44:59Z", "paidOnDate": "2022-10-23T00:00:00Z", "payments": [{"amount": 5926.35, "bankingTransactionRefs": [], "currency": "GBP", "currencyRate": 1, "date": "2021-05-04T17:57:00", "id": "82865077-0857-46db-b9a1-6d21da43b6aa", "paymentType": "payments"}], "sourceModifiedDate": "2022-02-24T23:02:00", "status": "PartiallyPaid", "totalAmount": 7151.41}, {"amountDue": 14408.54, "currency": "GBP", "customerRef": {"customerName": "Dolores Rath", "id": "44e8516d-bcb0-459f-9e5d-7beaa56d57d0"}, "dueDate": "2021-05-25T08:53:00", "id": "160e8b51-1fa0-46b9-98fe-1ff5399ce99b", "invoiceNumber": "9wegEXpG", "issueDate": "2021-05-18T08:53:00", "modifiedDate": "2022-04-11T13:49:37Z", "paidOnDate": "2022-10-23T00:00:00Z", "payments": [{"amount": 8113.8, "bankingTransactionRefs": [], "currency": "GBP", "currencyRate": 1, "date": "2021-05-23T04:04:00", "id": "75bd7205-bc12-4517-9964-aae159fdfaee", "paymentType": "payments"}], "sourceModifiedDate": "2022-01-13T07:52:00", "status": "PartiallyPaid", "totalAmount": 22522.34}, {"amountDue": 0, "currency": "GBP", "customerRef": {"customerName": "Ignacio Moore", "id": "cc96af36-e2f5-49f7-bf40-271503f45071"}, "dueDate": "2021-06-04T19:51:00", "id": "5a934955-561d-436a-a564-fd624a79f54c", "invoiceNumber": "l7YwGxG7", "issueDate": "2021-05-25T19:51:00", "modifiedDate": "2022-04-11T13:49:37Z", "paidOnDate": "2021-05-28T07:31:00", "payments": [{"amount": 11047.08, "bankingTransactionRefs": [], "currency": "GBP", "currencyRate": 1, "date": "2021-05-28T07:31:00", "id": "608fd022-f7d0-44a9-90c4-bebe0573f206", "paymentType": "payments"}], "sourceModifiedDate": "2021-08-06T05:50:00", "status": "Paid", "totalAmount": 11047.08}, {"amountDue": 5036.83, "currency": "GBP", "customerRef": {"customerName": "Freida Ebert", "id": "e1ecc8f2-8a63-4fe9-97c9-c87fd90ca0a6"}, "dueDate": "2021-06-03T19:07:00", "id": "17690788-2936-46b5-ba46-ba6a36a87483", "invoiceNumber": "ntH1cRYz", "issueDate": "2021-05-27T19:07:00", "modifiedDate": "2022-04-11T13:49:37Z", "paidOnDate": "2022-10-23T00:00:00Z", "payments": [{"amount": 2154.49, "bankingTransactionRefs": [], "currency": "GBP", "currencyRate": 1, "date": "2021-06-03T19:07:00", "id": "a343b2a0-d327-41b0-993e-7b6b92fde425", "paymentType": "payments"}], "sourceModifiedDate": "2021-03-27T08:54:00", "status": "PartiallyPaid", "totalAmount": 7191.32}]} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-accounting-credit-note: + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + creditNoteId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "104001", "currency": "GBP", "customerRef": {"companyName": "Abdi Company", "id": "8ddfa6bf-0c60-eb11-89fa-00224800af18"}, "discountPercentage": 0, "id": "e6e5ec0f-1c60-eb11-89fa-00224800a9c7", "issueDate": "2021-01-25T00:00:00", "lineItems": [{"accountRef": {"id": "NullId"}, "description": "Invoice No. 103221:", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 0, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "cc81fea8-2917-ed11-90eb-002248009df3", "name": ""}, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 0}, {"accountRef": {"id": "161217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Income, Services"}, "description": "Linda Martin", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "itemRef": {"id": "RESC-331317b3-89d1-ea11-bbaa-000d3a2b9185-DOMESTIC-DOMESTIC", "name": "Linda Martin / General Business Posting Group: 'DOMESTIC' / VAT Business Posting Group: 'DOMESTIC'"}, "quantity": 1, "subTotal": 100, "taxAmount": 5, "taxRateRef": {"effectiveTaxRate": 5, "id": "61bc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for DOMESTIC / REDUCED"}, "totalAmount": 105, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 100}, {"accountRef": {"id": "NullId"}, "description": "Credit memo for partially paid inv", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 0, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "cc81fea8-2917-ed11-90eb-002248009df3", "name": ""}, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2021-01-25T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 25}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "62e5046d-1c60-eb11-89fa-00224800a9c7", "note": "Credit Memo 1001", "paidOnDate": "2021-01-25T00:00:00", "reference": "Document No: 104001", "totalAmount": 0}}], "remainingCredit": 80, "sourceModifiedDate": "2021-01-26T21:21:18Z", "status": "PartiallyPaid", "subTotal": 100, "totalAmount": 105, "totalDiscount": 0, "totalTaxAmount": 5, "withholdingTax": []} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + creditNoteId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "004", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Alderley plc", "id": "6162023"}, "discountPercentage": 0, "id": "21952211", "issueDate": "2017-10-18T00:00:00", "lineItems": [{"description": "Reverse 6546", "isDirectIncome": false, "quantity": 1.5, "subTotal": 165, "taxAmount": 0, "totalAmount": 165, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 110}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:09Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 165}, "payment": {"currency": "GBP", "id": "270764400", "note": "�165.00 - Credit Note refund against 004", "paidOnDate": "2020-12-23T00:00:00", "totalAmount": -165}}], "remainingCredit": 0, "sourceModifiedDate": "2020-12-23T16:39:23Z", "status": "Paid", "subTotal": 165, "totalAmount": 165, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + creditNoteId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "0000065", "currency": "GBP", "customerRef": {"companyName": "Bob's Stationary", "id": "511657"}, "discountPercentage": 0, "id": "33407", "issueDate": "2020-07-31T00:00:00", "lineItems": [{"description": "Test Di", "isDirectIncome": false, "quantity": 1, "subTotal": 150, "taxAmount": 0, "totalAmount": 150, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 150}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "note": "Free $150 voucher", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 150}, "payment": {"currency": "GBP", "id": "2054019", "note": "Free $150 voucher", "paidOnDate": "2020-07-31T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Submitted", "subTotal": 150, "totalAmount": 150, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + creditNoteId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "4", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Peter Lord", "id": "69946501"}, "discountPercentage": 0, "id": "85322315", "issueDate": "2017-05-09T00:00:00", "lineItems": [{"accountRef": {"id": "21481817", "name": "Sale of goods"}, "description": "youm", "isDirectIncome": false, "itemRef": {"id": "158667064"}, "quantity": -1, "subTotal": -100, "taxAmount": 0, "totalAmount": 100, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 100}], "modifiedDate": "2022-09-30T10:29:16Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 100}, "payment": {"currency": "GBP", "id": "86870120", "note": "Applying Credit Note", "paidOnDate": "2017-05-09T00:00:00", "totalAmount": -100}}], "remainingCredit": 0, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 0, "totalAmount": 100, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + creditNoteId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "CM27", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "10 Breww Ltd", "id": "417"}, "discountPercentage": 0, "id": "8827", "issueDate": "2021-04-09T00:00:00", "lineItems": [{"accountRef": {"id": "54", "name": "Sales"}, "description": "Andy Test Item", "isDirectIncome": false, "itemRef": {"id": "143", "name": "Andy Test Item"}, "quantity": 3, "subTotal": 6, "totalAmount": 6, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "classification-2"}, {"id": "department-1"}, {"id": "location-1"}], "unitAmount": 2}, {"accountRef": {"id": "54", "name": "Sales"}, "description": "Non-Recurring Services - EC", "isDirectIncome": false, "itemRef": {"id": "28", "name": "Non-Recurring Services - EC"}, "quantity": 5, "subTotal": 20, "totalAmount": 20, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "classification-2"}, {"id": "department-1"}, {"id": "location-1"}], "unitAmount": 4}], "modifiedDate": "2022-09-20T08:15:31Z", "paymentAllocations": [], "remainingCredit": 26, "sourceModifiedDate": "2022-02-25T10:58:10", "status": "Submitted", "subTotal": 26, "totalAmount": 26, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + creditNoteId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "4002", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Abercrombie, Kristy", "id": "150000-933272658"}, "discountPercentage": 0, "id": "96C-933372931", "issueDate": "2024-12-01T00:00:00", "lineItems": [{"accountRef": {"id": "40000-933270541", "name": "Accounts Receivable"}, "description": "Whirlpool tub\nBilled and paid for 2 tubs, should have been for only 1 tub", "isDirectIncome": false, "itemRef": {"id": "1E0000-933272656", "name": "Plumb Fixtrs"}, "quantity": 1, "subTotal": 660, "taxAmount": 0, "taxRateRef": {"id": "10000-999022286", "name": "Taxable Sales"}, "totalAmount": 660, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": 660}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:07:38Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 711.15}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "969-933372844", "paidOnDate": "2024-12-01T00:00:00", "totalAmount": -711.15}}], "remainingCredit": 0, "sourceModifiedDate": "2023-12-16T05:04:05", "status": "Paid", "subTotal": 660, "totalAmount": 711.15, "totalDiscount": 0, "totalTaxAmount": 51.15, "withholdingTax": []} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + creditNoteId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "3122019_6", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Information Sharing Technology", "id": "3"}, "discountPercentage": 0, "id": "85", "issueDate": "2019-12-03T00:00:00", "lineItems": [{"accountRef": {"id": "1", "name": "Sales"}, "description": "Refunds with payment type of Cash", "isDirectIncome": true, "itemRef": {"id": "1", "name": "Sales"}, "quantity": 1, "subTotal": 13.53, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "8_Invoices", "name": "Exempt Invoices"}, "totalAmount": 13.53, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 13.53}], "modifiedDate": "2023-01-18T11:02:55Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2019-12-03T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 13.53}, "payment": {"accountRef": {"id": "63", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "85", "note": "", "paidOnDate": "2019-12-03T00:00:00", "totalAmount": -13.53}}], "remainingCredit": 0, "sourceModifiedDate": "2019-12-10T19:00:36Z", "status": "Paid", "subTotal": 13.53, "totalAmount": 13.53, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + creditNoteId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "1015", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Jordan Burgess", "id": "16"}, "discountPercentage": 0, "id": "185", "issueDate": "2017-02-15T00:00:00", "lineItems": [{"accountRef": {"id": "44", "name": "Sales"}, "description": "Employee training off site", "isDirectIncome": false, "itemRef": {"id": "5", "name": "Employee Training"}, "quantity": 1, "subTotal": 1500, "taxAmount": 300, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Invoices", "name": "20.0% S Invoices"}, "totalAmount": 1800, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "DEPARTMENT_1", "name": "London"}], "unitAmount": 1500}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:03Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 1800}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "192", "note": "Created by QB Online to link credits to charges.", "paidOnDate": "2017-09-08T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2017-09-08T12:52:27Z", "status": "Paid", "subTotal": 1500, "totalAmount": 1800, "totalDiscount": 0, "totalTaxAmount": 300, "withholdingTax": []} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + creditNoteId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "return 1a", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "A1 Design Services", "id": "A1D001"}, "discountPercentage": 2.5, "id": "45891", "issueDate": "2020-07-22T00:00:00Z", "lineItems": [{"description": "Tax Summary - Standard rate", "discountAmount": 1.58, "isDirectIncome": false, "quantity": 0, "subTotal": 0, "taxAmount": 63, "taxRateRef": {"id": "1"}, "totalAmount": 63, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 9.46, "isDirectIncome": false, "quantity": 0, "subTotal": 315, "taxAmount": 0, "totalAmount": 315, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:35:55Z", "note": "black", "paymentAllocations": [], "remainingCredit": 378, "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Submitted", "subTotal": 315, "totalAmount": 378, "totalDiscount": 9.46, "totalTaxAmount": 63, "withholdingTax": []} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + creditNoteId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "17", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Kinghorn & French", "id": "KIN001"}, "discountPercentage": 0, "id": "INV-17", "issueDate": "2021-02-02T00:00:00", "lineItems": [{"accountRef": {"id": "4000", "name": "Sales North"}, "description": "PC Combo Pack 4", "isDirectIncome": false, "quantity": 1, "subTotal": 711.45, "taxAmount": 121.39, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 832.84, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 832.84}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:43Z", "note": "PC Combo Pack 4", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 35.27}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "336", "note": "Sales credit inv-17 linked to sales invoice inv-45.", "paidOnDate": "2022-02-02T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 344.89}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "336", "note": "Sales credit inv-17 linked to sales invoice inv-45.", "paidOnDate": "2022-02-02T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 158.25}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "336", "note": "Sales credit inv-17 linked to sales invoice inv-45.", "paidOnDate": "2022-02-02T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 157.25}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "336", "note": "Sales credit inv-17 linked to sales invoice inv-45.", "paidOnDate": "2022-02-02T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 73.49}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "336", "note": "Sales credit inv-17 linked to sales invoice inv-45.", "paidOnDate": "2022-02-02T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 63.69}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "336", "note": "Sales credit inv-17 linked to sales invoice inv-45.", "paidOnDate": "2022-02-02T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Paid", "subTotal": 711.45, "totalAmount": 832.84, "totalDiscount": 0, "totalTaxAmount": 121.39, "withholdingTax": []} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + creditNoteId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "SCN-1", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Widgets Limited", "id": "f4ff85ba33dd11e797950a57719b2edb"}, "discountPercentage": 0, "id": "c1a0176c33de11e797950a57719b2edb", "issueDate": "2017-05-08T00:00:00", "lineItems": [{"accountRef": {"id": "9a994b92267a11e797950a57719b2edb", "name": "Sales Type A"}, "description": "Consulting services", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "itemRef": {"id": "a87b922b33de11e797950a57719b2edb", "name": "Consulting services"}, "quantity": 1, "subTotal": 900, "taxAmount": 180, "taxRateRef": {"effectiveTaxRate": 20, "id": "GB_STANDARD", "name": "Standard 20.00%"}, "totalAmount": 1080, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 900}], "modifiedDate": "2022-10-24T14:55:35Z", "note": "", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 1080}, "payment": {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "id": "d39f7a5733de11e797950a57719b2edb", "note": "Customer refund using credit/debit card", "paidOnDate": "2017-05-08T00:00:00", "totalAmount": -1080}}], "remainingCredit": 0, "sourceModifiedDate": "2017-05-08T11:09:38Z", "status": "Paid", "subTotal": 900, "totalAmount": 1080, "totalDiscount": 0, "totalTaxAmount": 180, "withholdingTax": []} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + creditNoteId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-03-16T00:00:00", "creditNoteNumber": "IN0545", "currency": "ZAR", "customerRef": {"companyName": "Pacificorp", "id": "53"}, "discountPercentage": 0, "id": "5018", "issueDate": "2022-03-16T00:00:00", "lineItems": [{"accountRef": {"id": "2", "name": "Accounts Receivable"}, "description": "No Description Provided", "isDirectIncome": false, "quantity": 1, "subTotal": 500, "taxAmount": 75, "taxRateRef": {"effectiveTaxRate": 15, "id": "27", "name": "Standard Rate Output"}, "totalAmount": 575, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "DEPARTMENT-2", "name": "Services"}, {"id": "CUSTOMER-53", "name": "Pacificorp"}, {"id": "LOCATION-10", "name": "South Africa"}], "unitAmount": 500}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-02-23T14:21:40Z", "note": "", "paymentAllocations": [], "remainingCredit": 0, "sourceModifiedDate": "2022-03-16T12:27:43Z", "status": "Paid", "subTotal": 500, "totalAmount": 575, "totalDiscount": 0, "totalTaxAmount": 75, "withholdingTax": []} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + creditNoteId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "CN-0025", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Hamilton Smith Ltd", "id": "af0091a9-82ef-4cac-9fd6-22c095ac6a58"}, "discountPercentage": 0, "id": "47fb825b-3c43-4284-905f-c6d97acc6b37", "issueDate": "2022-11-20T00:00:00", "lineItems": [{"description": "FULL CREDIT of INV-0016 due to duplication of invoice INV-0012. Please accept our apologies.", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 0, "subTotal": 0, "taxAmount": 0, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 0}, {"accountRef": {"id": "c563b607-fb0e-4d06-9ddb-76fdeef20ae3", "name": "Sales"}, "description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "itemRef": {"id": "f8fb7e00-5e5d-466c-aef0-15861f73d04f", "name": "Desktop/network support via email & phone"}, "quantity": 1, "subTotal": 451.04, "taxAmount": 90.21, "taxRateRef": {"effectiveTaxRate": 20, "id": "OUTPUT2", "name": "20% (VAT on Income)"}, "totalAmount": 541.25, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "34b9b859-07a9-451a-b4d3-effc9946634a", "name": "North"}], "unitAmount": 451.04}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:35:09Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-11-20T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 541.25}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "47fb825b-3c43-4284-905f-c6d97acc6b37", "paidOnDate": "2022-11-20T00:00:00", "reference": "Monthly Support", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2011-04-07T00:34:38", "status": "Paid", "subTotal": 451.04, "totalAmount": 541.25, "totalDiscount": 0, "totalTaxAmount": 90.21, "withholdingTax": []} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + creditNoteId: "" + responses: + "200": + application/json: {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "CN-00001", "currency": "GBP", "customerRef": {"companyName": "Test Company", "id": "104957000000037097"}, "discountPercentage": 0, "id": "104957000000129002", "issueDate": "2020-04-28T18:16:22", "lineItems": [], "modifiedDate": "2022-10-03T08:40:43Z", "paymentAllocations": [], "remainingCredit": 9001, "sourceModifiedDate": "2020-04-28T18:16:22", "status": "Draft", "subTotal": 0, "totalAmount": 9001, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + creditNoteId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounting-credit-notes: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "discountPercentage": "5472.72", "issueDate": "2022-10-23T00:00:00Z", "lineItems": [], "modifiedDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "remainingCredit": "2975.48", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": "2297.16", "totalAmount": "531.5", "totalDiscount": "1528.37", "totalTaxAmount": "9174.16"}], "totalResults": 1} + "400": {} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/creditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/creditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/creditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "104001", "currency": "GBP", "customerRef": {"companyName": "Abdi Company", "id": "8ddfa6bf-0c60-eb11-89fa-00224800af18"}, "discountPercentage": 0, "id": "e6e5ec0f-1c60-eb11-89fa-00224800a9c7", "issueDate": "2021-01-25T00:00:00", "lineItems": [{"accountRef": {"id": "NullId"}, "description": "Invoice No. 103221:", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 0, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "cc81fea8-2917-ed11-90eb-002248009df3", "name": ""}, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 0}, {"accountRef": {"id": "161217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Income, Services"}, "description": "Linda Martin", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "itemRef": {"id": "RESC-331317b3-89d1-ea11-bbaa-000d3a2b9185-DOMESTIC-DOMESTIC", "name": "Linda Martin / General Business Posting Group: 'DOMESTIC' / VAT Business Posting Group: 'DOMESTIC'"}, "quantity": 1, "subTotal": 100, "taxAmount": 5, "taxRateRef": {"effectiveTaxRate": 5, "id": "61bc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for DOMESTIC / REDUCED"}, "totalAmount": 105, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Project", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 100}, {"accountRef": {"id": "NullId"}, "description": "Credit memo for partially paid inv", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 0, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "cc81fea8-2917-ed11-90eb-002248009df3", "name": ""}, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2021-01-25T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 25}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "62e5046d-1c60-eb11-89fa-00224800a9c7", "note": "Credit Memo 1001", "paidOnDate": "2021-01-25T00:00:00", "reference": "Document No: 104001", "totalAmount": 0}}], "remainingCredit": 80, "sourceModifiedDate": "2021-01-26T21:21:18Z", "status": "PartiallyPaid", "subTotal": 100, "totalAmount": 105, "totalDiscount": 0, "totalTaxAmount": 5, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "104002", "currency": "GBP", "customerRef": {"companyName": "Abdi Company", "id": "8ddfa6bf-0c60-eb11-89fa-00224800af18"}, "discountPercentage": 0, "id": "d0d9b378-1d60-eb11-89fa-00224800a9c7", "issueDate": "2021-01-26T00:00:00", "lineItems": [{"accountRef": {"id": "NullId"}, "description": "Invoice No. 103222:", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 0, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "cc81fea8-2917-ed11-90eb-002248009df3", "name": ""}, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 0}, {"accountRef": {"id": "NullId"}, "description": "Inv. No. 103222 - Shpt. No. 102222:", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 0, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "cc81fea8-2917-ed11-90eb-002248009df3", "name": ""}, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 0}, {"accountRef": {"id": "181217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Income, Product Sales"}, "description": "ATHENS Desk -pay with CR", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "itemRef": {"id": "ITEM-c81217b3-89d1-ea11-bbaa-000d3a2b9185-DOMESTIC-DOMESTIC", "name": "ATHENS Desk / General Business Posting Group: 'DOMESTIC' / VAT Business Posting Group: 'DOMESTIC'"}, "quantity": 1, "subTotal": 649.4, "taxAmount": 129.88, "taxRateRef": {"effectiveTaxRate": 10, "id": "63bc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for DOMESTIC / STANDARD"}, "totalAmount": 779.28, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 649.4}, {"accountRef": {"id": "NullId"}, "description": "", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 1, "subTotal": 0, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "cc81fea8-2917-ed11-90eb-002248009df3", "name": ""}, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2021-01-26T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 779.28}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "c2942210-1e60-eb11-89fa-00224800a9c7", "note": "Credit Memo 1002", "paidOnDate": "2021-01-26T00:00:00", "reference": "Document No: 104002", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2021-01-26T21:33:01Z", "status": "Paid", "subTotal": 649.4, "totalAmount": 779.28, "totalDiscount": 0, "totalTaxAmount": 129.88, "withholdingTax": []}], "totalResults": 13} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/creditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/creditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/creditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "004", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Alderley plc", "id": "6162023"}, "discountPercentage": 0, "id": "21952211", "issueDate": "2017-10-18T00:00:00", "lineItems": [{"description": "Reverse 6546", "isDirectIncome": false, "quantity": 1.5, "subTotal": 165, "taxAmount": 0, "totalAmount": 165, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 110}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:09Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 165}, "payment": {"currency": "GBP", "id": "270764400", "note": "�165.00 - Credit Note refund against 004", "paidOnDate": "2020-12-23T00:00:00", "totalAmount": -165}}], "remainingCredit": 0, "sourceModifiedDate": "2020-12-23T16:39:23Z", "status": "Paid", "subTotal": 165, "totalAmount": 165, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "2367", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Alderley plc", "id": "6162023"}, "discountPercentage": 0, "id": "53604300", "issueDate": "2017-10-18T00:00:00", "lineItems": [{"description": "Reverse 6546", "isDirectIncome": false, "quantity": 1.5, "subTotal": 165, "taxAmount": 0, "totalAmount": 165, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 110}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:09Z", "paymentAllocations": [], "remainingCredit": 165, "sourceModifiedDate": "2022-09-29T13:00:09Z", "status": "Draft", "subTotal": 165, "totalAmount": 165, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 281} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/creditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/creditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/creditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "0000065", "currency": "GBP", "customerRef": {"companyName": "Bob's Stationary", "id": "511657"}, "discountPercentage": 0, "id": "33407", "issueDate": "2020-07-31T00:00:00", "lineItems": [{"description": "Test Di", "isDirectIncome": false, "quantity": 1, "subTotal": 150, "taxAmount": 0, "totalAmount": 150, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 150}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "note": "Free $150 voucher", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 150}, "payment": {"currency": "GBP", "id": "2054019", "note": "Free $150 voucher", "paidOnDate": "2020-07-31T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Submitted", "subTotal": 150, "totalAmount": 150, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "0000066", "currency": "GBP", "customerRef": {"companyName": "Bob's Stationary", "id": "511657"}, "discountPercentage": 0, "id": "33409", "issueDate": "2020-07-31T00:00:00", "lineItems": [{"description": "Test Di", "isDirectIncome": false, "quantity": 2, "subTotal": 300, "taxAmount": 0, "totalAmount": 300, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Project", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 150}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "note": "Free $150 voucher", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 300}, "payment": {"currency": "GBP", "id": "2054021", "note": "Free $150 voucher", "paidOnDate": "2020-07-31T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Draft", "subTotal": 300, "totalAmount": 300, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 53} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/creditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/creditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/creditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "4", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Peter Lord", "id": "69946501"}, "discountPercentage": 0, "id": "85322315", "issueDate": "2017-05-09T00:00:00", "lineItems": [{"accountRef": {"id": "21481817", "name": "Sale of goods"}, "description": "youm", "isDirectIncome": false, "itemRef": {"id": "158667064"}, "quantity": -1, "subTotal": -100, "taxAmount": 0, "totalAmount": 100, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [], "unitAmount": 100}], "modifiedDate": "2022-09-30T10:29:16Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 100}, "payment": {"currency": "GBP", "id": "86870120", "note": "Applying Credit Note", "paidOnDate": "2017-05-09T00:00:00", "totalAmount": -100}}], "remainingCredit": 0, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 0, "totalAmount": 100, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "5", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Things Limited", "id": "69952389"}, "discountPercentage": 0, "id": "85326016", "issueDate": "2017-05-09T00:00:00", "lineItems": [{"accountRef": {"id": "21481817", "name": "Sale of goods"}, "description": "158675173", "isDirectIncome": false, "itemRef": {"id": "158675173"}, "quantity": -1000, "subTotal": -1000, "taxAmount": 0, "totalAmount": 1000, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 1}], "modifiedDate": "2022-09-30T10:29:16Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 400}, "payment": {"currency": "GBP", "id": "86873915", "note": "Applying Credit Note", "paidOnDate": "2017-05-09T00:00:00", "totalAmount": -400}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 100}, "payment": {"currency": "GBP", "id": "86874181", "note": "", "paidOnDate": "2017-05-09T00:00:00", "totalAmount": -100}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 50}, "payment": {"currency": "GBP", "id": "86874199", "note": "", "paidOnDate": "2017-05-09T00:00:00", "totalAmount": -50}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 750}, "payment": {"currency": "GBP", "id": "86875655", "note": "Credit Note", "paidOnDate": "2017-05-09T00:00:00", "totalAmount": -750}}], "remainingCredit": 0, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 0, "totalAmount": 1000, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 17} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/data/creditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/data/creditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/data/creditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "CM27", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "10 Breww Ltd", "id": "417"}, "discountPercentage": 0, "id": "8827", "issueDate": "2021-04-09T00:00:00", "lineItems": [{"accountRef": {"id": "54", "name": "Sales"}, "description": "Andy Test Item", "isDirectIncome": false, "itemRef": {"id": "143", "name": "Andy Test Item"}, "quantity": 3, "subTotal": 6, "totalAmount": 6, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "classification-2"}, {"id": "department-1"}, {"id": "location-1"}], "unitAmount": 2}, {"accountRef": {"id": "54", "name": "Sales"}, "description": "Non-Recurring Services - EC", "isDirectIncome": false, "itemRef": {"id": "28", "name": "Non-Recurring Services - EC"}, "quantity": 5, "subTotal": 20, "totalAmount": 20, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "classification-2"}, {"id": "department-1"}, {"id": "location-1"}], "unitAmount": 4}], "modifiedDate": "2022-09-20T08:15:31Z", "paymentAllocations": [], "remainingCredit": 26, "sourceModifiedDate": "2022-02-25T10:58:10", "status": "Submitted", "subTotal": 26, "totalAmount": 26, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "CM28", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "10 Breww Ltd", "id": "417"}, "discountPercentage": 0, "id": "8828", "issueDate": "2021-04-09T00:00:00", "lineItems": [{"accountRef": {"id": "54", "name": "Sales"}, "description": "Andy Test Item", "isDirectIncome": false, "itemRef": {"id": "143", "name": "Andy Test Item"}, "quantity": 3, "subTotal": 6, "totalAmount": 6, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "classification-2"}, {"id": "department-1"}, {"id": "location-1"}], "unitAmount": 2}, {"accountRef": {"id": "54", "name": "Sales"}, "description": "Non-Recurring Services - EC", "isDirectIncome": false, "itemRef": {"id": "28", "name": "Non-Recurring Services - EC"}, "quantity": 5, "subTotal": 20, "totalAmount": 20, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "classification-2"}, {"id": "department-1"}, {"id": "location-1"}], "unitAmount": 4}], "modifiedDate": "2022-09-20T08:15:31Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 16}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "8828", "paidOnDate": "2021-04-09T00:00:00", "reference": "Credit Memo #CM28", "totalAmount": 0}}], "remainingCredit": 10, "sourceModifiedDate": "2022-02-25T10:58:37", "status": "PartiallyPaid", "subTotal": 26, "totalAmount": 26, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 36} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/creditNotes?page=1&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/creditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "4002", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Abercrombie, Kristy", "id": "150000-933272658"}, "discountPercentage": 0, "id": "96C-933372931", "issueDate": "2024-12-01T00:00:00", "lineItems": [{"accountRef": {"id": "40000-933270541", "name": "Accounts Receivable"}, "description": "Whirlpool tub\nBilled and paid for 2 tubs, should have been for only 1 tub", "isDirectIncome": false, "itemRef": {"id": "1E0000-933272656", "name": "Plumb Fixtrs"}, "quantity": 1, "subTotal": 660, "taxAmount": 0, "taxRateRef": {"id": "10000-999022286", "name": "Taxable Sales"}, "totalAmount": 660, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "40000-933272658", "name": "Remodel"}], "unitAmount": 660}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:07:38Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 711.15}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "969-933372844", "paidOnDate": "2024-12-01T00:00:00", "totalAmount": -711.15}}], "remainingCredit": 0, "sourceModifiedDate": "2023-12-16T05:04:05", "status": "Paid", "subTotal": 660, "totalAmount": 711.15, "totalDiscount": 0, "totalTaxAmount": 51.15, "withholdingTax": []}], "totalResults": 1} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/creditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/creditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/creditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "3122019_6", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Information Sharing Technology", "id": "3"}, "discountPercentage": 0, "id": "85", "issueDate": "2019-12-03T00:00:00", "lineItems": [{"accountRef": {"id": "1", "name": "Sales"}, "description": "Refunds with payment type of Cash", "isDirectIncome": true, "itemRef": {"id": "1", "name": "Sales"}, "quantity": 1, "subTotal": 13.53, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "8_Invoices", "name": "Exempt Invoices"}, "totalAmount": 13.53, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 13.53}], "modifiedDate": "2023-01-18T11:02:55Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2019-12-03T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 13.53}, "payment": {"accountRef": {"id": "63", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "85", "note": "", "paidOnDate": "2019-12-03T00:00:00", "totalAmount": -13.53}}], "remainingCredit": 0, "sourceModifiedDate": "2019-12-10T19:00:36Z", "status": "Paid", "subTotal": 13.53, "totalAmount": 13.53, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "3122019_66", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Information Sharing Technology", "id": "3"}, "discountPercentage": 0, "id": "86", "issueDate": "2019-12-03T00:00:00", "lineItems": [{"accountRef": {"id": "1", "name": "Sales"}, "description": "Refunds with payment type of Card", "isDirectIncome": true, "itemRef": {"id": "1", "name": "Sales"}, "quantity": 1, "subTotal": 1, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "8_Invoices", "name": "Exempt Invoices"}, "totalAmount": 1, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 1}], "modifiedDate": "2023-01-18T11:02:55Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2019-12-03T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 1}, "payment": {"accountRef": {"id": "63", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "86", "note": "", "paidOnDate": "2019-12-03T00:00:00", "totalAmount": -1}}], "remainingCredit": 0, "sourceModifiedDate": "2019-12-10T19:00:37Z", "status": "Paid", "subTotal": 1, "totalAmount": 1, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 1253} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/creditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/creditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/creditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "1015", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Jordan Burgess", "id": "16"}, "discountPercentage": 0, "id": "185", "issueDate": "2017-02-15T00:00:00", "lineItems": [{"accountRef": {"id": "44", "name": "Sales"}, "description": "Employee training off site", "isDirectIncome": false, "itemRef": {"id": "5", "name": "Employee Training"}, "quantity": 1, "subTotal": 1500, "taxAmount": 300, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Invoices", "name": "20.0% S Invoices"}, "totalAmount": 1800, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "DEPARTMENT_1", "name": "London"}], "unitAmount": 1500}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:03Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 1800}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "192", "note": "Created by QB Online to link credits to charges.", "paidOnDate": "2017-09-08T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2017-09-08T12:52:27Z", "status": "Paid", "subTotal": 1500, "totalAmount": 1800, "totalDiscount": 0, "totalTaxAmount": 300, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "1030", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Whitehead and Sons", "id": "5"}, "discountPercentage": 0, "id": "213", "issueDate": "2018-12-18T00:00:00", "lineItems": [{"accountRef": {"id": "44", "name": "Sales"}, "description": "Employee celebration -- Anniversary / Retirement", "isDirectIncome": false, "itemRef": {"id": "4", "name": "Employee Celebration"}, "quantity": 1, "subTotal": 500, "taxAmount": 100, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Invoices", "name": "20.0% S Invoices"}, "totalAmount": 600, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "DEPARTMENT_3", "name": "Birmingham"}], "unitAmount": 500}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:03Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 600}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "215", "note": "Created by QB Online to link credits to charges.", "paidOnDate": "2018-12-18T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2018-12-18T10:08:45Z", "status": "Paid", "subTotal": 500, "totalAmount": 600, "totalDiscount": 0, "totalTaxAmount": 100, "withholdingTax": []}], "totalResults": 141} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/creditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/creditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/creditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "return 1a", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "A1 Design Services", "id": "A1D001"}, "discountPercentage": 2.5, "id": "45891", "issueDate": "2020-07-22T00:00:00Z", "lineItems": [{"description": "Tax Summary - Standard rate", "discountAmount": 1.58, "isDirectIncome": false, "quantity": 0, "subTotal": 0, "taxAmount": 63, "taxRateRef": {"id": "1"}, "totalAmount": 63, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 9.46, "isDirectIncome": false, "quantity": 0, "subTotal": 315, "taxAmount": 0, "totalAmount": 315, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Project", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:35:55Z", "note": "black", "paymentAllocations": [], "remainingCredit": 378, "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Submitted", "subTotal": 315, "totalAmount": 378, "totalDiscount": 9.46, "totalTaxAmount": 63, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "return 003", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "ABS Garages Ltd", "id": "ABS001"}, "discountPercentage": 2.5, "id": "45901", "issueDate": "2020-07-22T00:00:00Z", "lineItems": [{"description": "Tax Summary - Standard rate", "discountAmount": 0.73, "isDirectIncome": false, "quantity": 0, "subTotal": 0, "taxAmount": 29.52, "taxRateRef": {"id": "1"}, "totalAmount": 29.52, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 4.42, "isDirectIncome": false, "quantity": 0, "subTotal": 147.62, "taxAmount": 0, "totalAmount": 147.62, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:35:55Z", "note": "cred 003", "paymentAllocations": [], "remainingCredit": 177.14, "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Submitted", "subTotal": 147.62, "totalAmount": 177.14, "totalDiscount": 4.42, "totalTaxAmount": 29.52, "withholdingTax": []}], "totalResults": 26} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/creditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/creditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/creditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "17", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Kinghorn & French", "id": "KIN001"}, "discountPercentage": 0, "id": "INV-17", "issueDate": "2021-02-02T00:00:00", "lineItems": [{"accountRef": {"id": "4000", "name": "Sales North"}, "description": "PC Combo Pack 4", "isDirectIncome": false, "quantity": 1, "subTotal": 711.45, "taxAmount": 121.39, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 832.84, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Project", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 832.84}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:43Z", "note": "PC Combo Pack 4", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 63.69}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "336", "note": "Sales credit inv-17 linked to sales invoice inv-45.", "paidOnDate": "2022-02-02T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 73.49}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "336", "note": "Sales credit inv-17 linked to sales invoice inv-45.", "paidOnDate": "2022-02-02T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 157.25}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "336", "note": "Sales credit inv-17 linked to sales invoice inv-45.", "paidOnDate": "2022-02-02T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 158.25}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "336", "note": "Sales credit inv-17 linked to sales invoice inv-45.", "paidOnDate": "2022-02-02T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 344.89}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "336", "note": "Sales credit inv-17 linked to sales invoice inv-45.", "paidOnDate": "2022-02-02T00:00:00", "totalAmount": 0}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 35.27}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "336", "note": "Sales credit inv-17 linked to sales invoice inv-45.", "paidOnDate": "2022-02-02T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Paid", "subTotal": 711.45, "totalAmount": 832.84, "totalDiscount": 0, "totalTaxAmount": 121.39, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "34", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Mile Road Health Centre", "id": "MIL001"}, "discountPercentage": 0, "id": "INV-34", "issueDate": "2021-02-28T00:00:00", "lineItems": [{"accountRef": {"id": "4000", "name": "Sales North"}, "description": "PC Combo Pack 6", "isDirectIncome": false, "quantity": 1, "subTotal": 1425, "taxAmount": 243.14, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 1668.14, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "Sales"}], "unitAmount": 1668.14}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:43Z", "note": "PC Combo Pack 6", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 1668.14}, "payment": {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "id": "530", "note": "Sales credit inv-34 linked to sales invoice inv-26.", "paidOnDate": "2022-02-28T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Paid", "subTotal": 1425, "totalAmount": 1668.14, "totalDiscount": 0, "totalTaxAmount": 243.14, "withholdingTax": []}], "totalResults": 7} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/creditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/creditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/creditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "SCN-1", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Widgets Limited", "id": "f4ff85ba33dd11e797950a57719b2edb"}, "discountPercentage": 0, "id": "c1a0176c33de11e797950a57719b2edb", "issueDate": "2017-05-08T00:00:00", "lineItems": [{"accountRef": {"id": "9a994b92267a11e797950a57719b2edb", "name": "Sales Type A"}, "description": "Consulting services", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "itemRef": {"id": "a87b922b33de11e797950a57719b2edb", "name": "Consulting services"}, "quantity": 1, "subTotal": 900, "taxAmount": 180, "taxRateRef": {"effectiveTaxRate": 20, "id": "GB_STANDARD", "name": "Standard 20.00%"}, "totalAmount": 1080, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "recordRef": {"dataType": "transfer"}}, "trackingCategoryRefs": [], "unitAmount": 900}], "modifiedDate": "2022-10-24T14:55:35Z", "note": "", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 1080}, "payment": {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "id": "d39f7a5733de11e797950a57719b2edb", "note": "Customer refund using credit/debit card", "paidOnDate": "2017-05-08T00:00:00", "totalAmount": -1080}}], "remainingCredit": 0, "sourceModifiedDate": "2017-05-08T11:09:38Z", "status": "Paid", "subTotal": 900, "totalAmount": 1080, "totalDiscount": 0, "totalTaxAmount": 180, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "SCN-3", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Widgets Limited", "id": "f4ff85ba33dd11e797950a57719b2edb"}, "discountPercentage": 0, "id": "28a459069a6211e8bad90617b3da4b8a", "issueDate": "2018-08-07T00:00:00", "lineItems": [{"accountRef": {"id": "9a994b92267a11e797950a57719b2edb", "name": "Sales Type A"}, "description": "Consulting services", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "itemRef": {"id": "a87b922b33de11e797950a57719b2edb", "name": "Consulting services"}, "quantity": 5, "subTotal": 4500, "taxAmount": 900, "taxRateRef": {"effectiveTaxRate": 20, "id": "GB_STANDARD", "name": "Standard 20.00%"}, "totalAmount": 5400, "tracking": {"categoryRefs": [], "isBilledTo": "Project", "isRebilledTo": "Unknown", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [], "unitAmount": 900}], "modifiedDate": "2022-10-24T14:55:35Z", "note": "", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 5400}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "28a459069a6211e8bad90617b3da4b8a", "note": "Sales credit note", "paidOnDate": "2018-08-07T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2018-08-07T16:51:41Z", "status": "Paid", "subTotal": 4500, "totalAmount": 5400, "totalDiscount": 0, "totalTaxAmount": 900, "withholdingTax": []}], "totalResults": 2972} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b53cfc9f-1a00-4a20-936f-34e8efbe07c5/data/creditNotes?page=1&pageSize=2"}, "self": {"href": "/companies/b53cfc9f-1a00-4a20-936f-34e8efbe07c5/data/creditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-03-16T00:00:00", "creditNoteNumber": "IN0545", "currency": "ZAR", "customerRef": {"companyName": "Pacificorp", "id": "53"}, "discountPercentage": 0, "id": "5018", "issueDate": "2022-03-16T00:00:00", "lineItems": [{"accountRef": {"id": "2", "name": "Accounts Receivable"}, "description": "No Description Provided", "isDirectIncome": false, "quantity": 1, "subTotal": 500, "taxAmount": 75, "taxRateRef": {"effectiveTaxRate": 15, "id": "27", "name": "Standard Rate Output"}, "totalAmount": 575, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "invoice"}}, "trackingCategoryRefs": [{"id": "LOCATION-10", "name": "South Africa"}, {"id": "DEPARTMENT-2", "name": "Services"}, {"id": "CUSTOMER-53", "name": "Pacificorp"}], "unitAmount": 500}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-02-23T14:21:40Z", "note": "", "paymentAllocations": [], "remainingCredit": 0, "sourceModifiedDate": "2022-03-16T12:27:43Z", "status": "Paid", "subTotal": 500, "totalAmount": 575, "totalDiscount": 0, "totalTaxAmount": 75, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "ARADJ0034", "currency": "ZAR", "currencyRate": 1, "customerRef": {"companyName": "Pacificorp", "id": "53"}, "discountPercentage": 0, "id": "5020", "issueDate": "2022-03-16T00:00:00", "lineItems": [{"accountRef": {"id": "2", "name": "Accounts Receivable"}, "description": "No Description Provided", "isDirectIncome": false, "quantity": 1, "subTotal": 100, "taxAmount": 15, "taxRateRef": {"effectiveTaxRate": 15, "id": "28", "name": "Standard Rate (Capital Goods) Output"}, "totalAmount": 115, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable", "recordRef": {"dataType": "accountTransaction"}}, "trackingCategoryRefs": [{"id": "LOCATION-10", "name": "South Africa"}, {"id": "CUSTOMER-53", "name": "Pacificorp"}], "unitAmount": 100}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-02-23T14:21:40Z", "note": "", "paymentAllocations": [], "remainingCredit": 115, "sourceModifiedDate": "2022-03-16T12:30:19", "status": "Submitted", "subTotal": 100, "totalAmount": 115, "totalDiscount": 0, "totalTaxAmount": 15, "withholdingTax": []}], "totalResults": 2} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/creditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/creditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/creditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "CN-0025", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Hamilton Smith Ltd", "id": "af0091a9-82ef-4cac-9fd6-22c095ac6a58"}, "discountPercentage": 0, "id": "47fb825b-3c43-4284-905f-c6d97acc6b37", "issueDate": "2022-11-20T00:00:00", "lineItems": [{"description": "FULL CREDIT of INV-0016 due to duplication of invoice INV-0012. Please accept our apologies.", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "quantity": 0, "subTotal": 0, "taxAmount": 0, "totalAmount": 0, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [], "unitAmount": 0}, {"accountRef": {"id": "c563b607-fb0e-4d06-9ddb-76fdeef20ae3", "name": "Sales"}, "description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "itemRef": {"id": "f8fb7e00-5e5d-466c-aef0-15861f73d04f", "name": "Desktop/network support via email & phone"}, "quantity": 1, "subTotal": 451.04, "taxAmount": 90.21, "taxRateRef": {"effectiveTaxRate": 20, "id": "OUTPUT2", "name": "20% (VAT on Income)"}, "totalAmount": 541.25, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "34b9b859-07a9-451a-b4d3-effc9946634a", "name": "North"}], "unitAmount": 451.04}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:35:09Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-11-20T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 541.25}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "47fb825b-3c43-4284-905f-c6d97acc6b37", "paidOnDate": "2022-11-20T00:00:00", "reference": "Monthly Support", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2011-04-07T00:34:38", "status": "Paid", "subTotal": 451.04, "totalAmount": 541.25, "totalDiscount": 0, "totalTaxAmount": 90.21, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "CN-0026", "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Boom FM", "id": "9ce626d2-14ea-463c-9fff-6785ab5f9bfb"}, "discountPercentage": 0, "id": "caba470e-962f-4168-9c57-35caa289204d", "issueDate": "2023-01-13T00:00:00", "lineItems": [{"accountRef": {"id": "c563b607-fb0e-4d06-9ddb-76fdeef20ae3", "name": "Sales"}, "description": "CREDIT Half day training - Microsoft Office and include in suite of training\r\nINV-0024", "discountAmount": 0, "discountPercentage": 0, "isDirectIncome": false, "itemRef": {"id": "489558f5-27b7-4f37-ad9f-d84611c2e2ab", "name": "Half day training - Microsoft Office"}, "quantity": 1, "subTotal": 416.67, "taxAmount": 83.33, "taxRateRef": {"effectiveTaxRate": 20, "id": "OUTPUT2", "name": "20% (VAT on Income)"}, "totalAmount": 500, "tracking": {"categoryRefs": [], "isBilledTo": "NotApplicable", "isRebilledTo": "Project", "recordRef": {"dataType": "journalEntry"}}, "trackingCategoryRefs": [{"id": "b3900cc6-3745-40ea-955f-9ef7b1c8cf7e", "name": "South"}], "unitAmount": 416.67}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:35:09Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2023-01-13T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 500}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "caba470e-962f-4168-9c57-35caa289204d", "paidOnDate": "2023-01-13T00:00:00", "reference": "Training", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2011-04-07T02:47:04", "status": "Paid", "subTotal": 416.67, "totalAmount": 500, "totalDiscount": 0, "totalTaxAmount": 83.33, "withholdingTax": []}], "totalResults": 3} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/creditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/creditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/creditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "CN-00001", "currency": "GBP", "customerRef": {"companyName": "Test Company", "id": "104957000000037097"}, "discountPercentage": 0, "id": "104957000000129002", "issueDate": "2020-04-28T18:16:22", "lineItems": [], "modifiedDate": "2022-10-03T08:40:43Z", "paymentAllocations": [], "remainingCredit": 9001, "sourceModifiedDate": "2020-04-28T18:16:22", "status": "Draft", "subTotal": 0, "totalAmount": 9001, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"additionalTaxAmount": 0, "additionalTaxPercentage": 0, "allocatedOnDate": "2022-10-23T00:00:00Z", "creditNoteNumber": "CN-00002", "currency": "GBP", "customerRef": {"companyName": "Doe, John", "id": "104957000000054050"}, "discountPercentage": 0, "id": "104957000000134023", "issueDate": "2020-05-06T13:04:20", "lineItems": [], "modifiedDate": "2022-10-03T08:40:43Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 125}, "payment": {"currency": "GBP", "id": "104957000000134039", "paidOnDate": "2020-05-06T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2020-05-06T13:05:27", "status": "Paid", "subTotal": 0, "totalAmount": 125, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 12} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-accounting-payment: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Keara Leffler", "id": "a82042f1-a005-4ca5-bfd3-5bc237123aa5"}, "date": "2022-04-25T13:04:02", "id": "7ba4fc1b-e248-49ba-8bf8-0813d7f203a8", "lines": [{"allocatedOnDate": "2022-04-25T13:04:02", "amount": 3669.52, "links": [{"amount": -3669.52, "currencyRate": 1, "id": "ac3ac4dd-defe-4f9c-b7bb-2c3fe726a9d1", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "note": "Payment against invoice ac3ac4dd-defe-4f9c-b7bb-2c3fe726a9d1", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "ac3ac4dd-defe-4f9c-b7bb-2c3fe726a9d1", "sourceModifiedDate": "2022-04-25T13:04:02", "totalAmount": 3669.52} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "621217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Petty Cash"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Trey Researches", "id": "b61217b3-89d1-ea11-bbaa-000d3a2b9185"}, "date": "2019-01-15T00:00:00", "id": "e0299ced-89d1-ea11-bbaa-000d3a2b9185", "lines": [{"allocatedOnDate": "2019-01-15T00:00:00", "amount": 128.16, "links": [{"amount": -128.16, "currencyRate": 1, "id": "18c906bf-89d1-ea11-bbaa-000d3a2b9185", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:27Z", "note": "Invoice 102001", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "Document No: 103001", "sourceModifiedDate": "0001-01-01T00:00:00Z", "totalAmount": 128.16} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "35717508-0696-4481-a32c-2835f0ed8b4e", "name": "Test GL account 2"}, "currency": "EUR", "currencyRate": 1, "customerRef": {"companyName": "Mr Abe", "id": "c3bf08a3-4d51-4859-acbb-5075f9484f87"}, "date": "2019-11-26T00:00:00Z", "id": "090f5d9f-d1ce-4a61-985f-d3915618b64a_c3bf08a3-4d51-4859-acbb-5075f9484f87", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 229.08, "links": [{"amount": -229.08, "currencyRate": 1, "id": "f010d4df-13ea-45d1-8525-785164df7dd9", "type": "Invoice"}]}], "modifiedDate": "2022-10-26T13:36:13Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "19230011", "sourceModifiedDate": "2019-11-26T12:31:46Z", "totalAmount": 229.08} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "4a4e34b5-7f62-4b64-a44a-073398b14b41", "name": "Bank"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Customer A", "id": "7e566728-a7f3-4860-a7f5-381664673287"}, "date": "2020-01-02T00:00:00Z", "id": "14b7d656-07ee-4d70-aafa-61c0030c08ad_7e566728-a7f3-4860-a7f5-381664673287", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1, "links": [{"amount": -1, "currencyRate": 1, "id": "6220ed43-1fec-4e17-a88f-c7ee5b949e76", "type": "Invoice"}]}], "modifiedDate": "2022-10-26T13:35:14Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "20200002", "sourceModifiedDate": "2020-01-02T10:08:27Z", "totalAmount": 1} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"currency": "GBP", "customerRef": {"companyName": "Wintershall Holding GmbH", "id": "6162049"}, "date": "2017-11-23T00:00:00", "id": "135234099", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 100, "links": [{"amount": -100, "currencyRate": 1, "id": "21973931", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:21:37Z", "note": "CODAT LTD ref: NOV TOPUP OTHER �100.00 - Invoice receipt against 015", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 100} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"currency": "GBP", "customerRef": {"id": "113070"}, "date": "2018-09-11T00:00:00", "id": "765831", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1, "links": [{"amount": -1, "currencyRate": 1, "id": "113070", "type": "PaymentOnAccount"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:24Z", "note": "Overpayment: invoice #0000003, some test", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2018-09-11T06:58:46", "totalAmount": 1} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"currency": "GBP", "customerRef": {"companyName": "Parent customer", "id": "85743294"}, "date": "2010-04-07T00:00:00", "id": "139214921", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1.2, "links": [{"amount": -1.2, "currencyRate": 1, "id": "137055108", "type": "Invoice"}]}], "modifiedDate": "2022-09-30T10:29:15Z", "note": "", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 1.2} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "10 Breww Ltd", "id": "417"}, "date": "2021-04-09T00:00:00", "id": "8828", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -16, "currencyRate": 1, "id": "8530", "type": "Invoice"}, {"amount": 16, "currencyRate": 1, "id": "8828", "type": "CreditNote"}]}], "modifiedDate": "2022-09-20T08:18:33Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "Credit Memo #CM28", "sourceModifiedDate": "2022-02-25T10:58:37", "totalAmount": 0} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "80000-933270541", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Melton, Johnny", "id": "220000-933272658"}, "date": "2023-01-10T00:00:00", "id": "6915-1197775450", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 14488.64, "links": [{"amount": -14488.64, "currencyRate": 1, "id": "469E-1071530054", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:08:36Z", "note": "Check - 80000-933270541", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "19650", "sourceModifiedDate": "2023-12-16T05:06:11", "totalAmount": 14488.64} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "56", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Abe", "id": "9"}, "date": "2018-10-05T00:00:00", "id": "710", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 95.2, "links": [{"amount": -95.2, "currencyRate": 1, "id": "688", "type": "Invoice"}]}], "modifiedDate": "2023-01-18T11:03:14Z", "note": "Sarah's Test", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2020-08-14T09:59:29Z", "totalAmount": 95.2} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "81", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Oxon Insurance - Holiday Party", "id": "55"}, "date": "2016-02-12T00:00:00", "id": "25", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 10800, "links": [{"amount": -10800, "currencyRate": 1, "id": "55", "type": "PaymentOnAccount"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:50Z", "note": "", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-02-03T12:09:35Z", "totalAmount": 10800} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Stevenson & Smith", "id": "STE001"}, "date": "2019-01-30T00:00:00Z", "id": "29684", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 12.5, "links": [{"amount": -12.5, "currencyRate": 1, "id": "29676", "type": "Invoice"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 487.5, "links": [{"amount": -487.5, "currencyRate": 1, "id": "29851", "type": "Invoice"}]}], "modifiedDate": "2022-10-14T09:36:05Z", "note": "Payment on Account", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "5897532", "sourceModifiedDate": "2020-02-28T14:23:46Z", "totalAmount": 500} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Stevenson & Smith", "id": "STE001"}, "date": "2021-01-30T00:00:00", "id": "53", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 12.5, "links": [{"amount": -12.5, "currencyRate": 1, "id": "TX-3", "type": "Invoice"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 245.34, "links": [{"amount": -245.34, "currencyRate": 1, "id": "INV-31", "type": "Invoice"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 126.9, "links": [{"amount": -126.9, "currencyRate": 1, "id": "INV-31", "type": "Invoice"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 115.26, "links": [{"amount": -115.26, "currencyRate": 1, "id": "INV-31", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:39Z", "note": "Sales receipt on account 53 linked to sales invoice tx-3, sales invoice inv-31.", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-11-25T09:43:54", "totalAmount": 500} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Widgets Limited", "id": "f4ff85ba33dd11e797950a57719b2edb"}, "date": "2017-05-08T00:00:00", "id": "d39f7a5733de11e797950a57719b2edb", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": -1080, "links": [{"amount": 1080, "currencyRate": 1, "id": "c1a0176c33de11e797950a57719b2edb", "type": "CreditNote"}]}], "modifiedDate": "2022-10-24T14:55:39Z", "note": "Customer refund using credit/debit card", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2017-05-08T11:09:38Z", "totalAmount": -1080} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "customerRef": {"companyName": "MK Manufacturing", "id": "12"}, "date": "2021-04-22T00:00:00", "id": "2918", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 120, "links": [{"amount": -120, "currencyRate": 1, "id": "2916", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:02Z", "note": "", "paymentMethodRef": {"id": "1", "name": "Printed Check"}, "sourceModifiedDate": "2021-04-22T11:01:11Z", "totalAmount": 120} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Maddox Publishing Group", "id": "afd4093b-c655-4847-8ee2-10a4f2c3eae3"}, "date": "2022-02-17T00:00:00", "id": "65b746c8-9a5d-4a95-8096-d2316fcff592", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 4200, "links": [{"amount": -4200, "currencyRate": 1, "id": "321bfed3-2da2-4969-9358-4de97821181b", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:37:08Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2021-01-02T22:50:58", "totalAmount": 4200} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "104957000000060010", "name": "Abdi Test"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Test Company", "id": "104957000000037097"}, "date": "2020-02-06T00:00:00", "id": "104957000000070175", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 9001, "links": [{"amount": -9001, "currencyRate": 1, "id": "104957000000038052", "type": "Invoice"}]}], "modifiedDate": "2022-10-03T08:41:17Z", "note": "Cheque deposit", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "4", "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 9001} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounting-payments: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/payments?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/payments?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Keara Leffler", "id": "a82042f1-a005-4ca5-bfd3-5bc237123aa5"}, "date": "2022-04-25T13:04:02", "id": "7ba4fc1b-e248-49ba-8bf8-0813d7f203a8", "lines": [{"allocatedOnDate": "2022-04-25T13:04:02", "amount": 3669.52, "links": [{"amount": -3669.52, "currencyRate": 1, "id": "ac3ac4dd-defe-4f9c-b7bb-2c3fe726a9d1", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "note": "Payment against invoice ac3ac4dd-defe-4f9c-b7bb-2c3fe726a9d1", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "ac3ac4dd-defe-4f9c-b7bb-2c3fe726a9d1", "sourceModifiedDate": "2022-04-25T13:04:02", "totalAmount": 3669.52}, {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Jensen Steuber", "id": "d65ac505-072c-49ec-be3c-3cb74228966d"}, "date": "2022-04-25T13:04:02", "id": "9407d5ee-893a-4547-bd89-bc7b795ee774", "lines": [{"allocatedOnDate": "2022-04-25T13:04:02", "amount": 1772.72, "links": [{"amount": -1772.72, "currencyRate": 1, "id": "2518ca08-5e2a-4630-8cee-a6bcd1625660", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "note": "Payment against invoice 2518ca08-5e2a-4630-8cee-a6bcd1625660", "paymentMethodRef": {"id": "8db2de81-0db4-46ee-b7f9-c711a7e89a01", "name": "Cash payments-IHz"}, "reference": "2518ca08-5e2a-4630-8cee-a6bcd1625660", "sourceModifiedDate": "2022-04-25T13:04:02", "totalAmount": 1772.72}], "totalResults": 200} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/payments?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/payments?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "621217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Petty Cash"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Trey Researches", "id": "b61217b3-89d1-ea11-bbaa-000d3a2b9185"}, "date": "2019-01-15T00:00:00", "id": "e0299ced-89d1-ea11-bbaa-000d3a2b9185", "lines": [{"allocatedOnDate": "2019-01-15T00:00:00", "amount": 128.16, "links": [{"amount": -128.16, "currencyRate": 1, "id": "18c906bf-89d1-ea11-bbaa-000d3a2b9185", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:27Z", "note": "Invoice 102001", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "Document No: 103001", "sourceModifiedDate": "0001-01-01T00:00:00Z", "totalAmount": 128.16}, {"accountRef": {"id": "621217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Petty Cash"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Adatum Corporation", "id": "b41217b3-89d1-ea11-bbaa-000d3a2b9185"}, "date": "2019-01-16T00:00:00", "id": "042a9ced-89d1-ea11-bbaa-000d3a2b9185", "lines": [{"allocatedOnDate": "2019-01-16T00:00:00", "amount": 600.48, "links": [{"amount": -600.48, "currencyRate": 1, "id": "1bc906bf-89d1-ea11-bbaa-000d3a2b9185", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:27Z", "note": "Invoice 102002", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "Document No: 103002", "sourceModifiedDate": "0001-01-01T00:00:00Z", "totalAmount": 600.48}], "totalResults": 249} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/payments?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/payments?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "35717508-0696-4481-a32c-2835f0ed8b4e", "name": "Test GL account 2"}, "currency": "EUR", "currencyRate": 1, "customerRef": {"companyName": "Mr Abe", "id": "c3bf08a3-4d51-4859-acbb-5075f9484f87"}, "date": "2019-11-26T00:00:00Z", "id": "090f5d9f-d1ce-4a61-985f-d3915618b64a_c3bf08a3-4d51-4859-acbb-5075f9484f87", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 229.08, "links": [{"amount": -229.08, "currencyRate": 1, "id": "f010d4df-13ea-45d1-8525-785164df7dd9", "type": "Invoice"}]}], "modifiedDate": "2022-10-26T13:36:13Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "19230011", "sourceModifiedDate": "2019-11-26T12:31:46Z", "totalAmount": 229.08}, {"accountRef": {"id": "35717508-0696-4481-a32c-2835f0ed8b4e", "name": "Test GL account 2"}, "currency": "EUR", "currencyRate": 1, "customerRef": {"companyName": "Mr Abe", "id": "c3bf08a3-4d51-4859-acbb-5075f9484f87"}, "date": "2019-11-26T00:00:00Z", "id": "1650bb9c-5d9a-40f2-9015-0e251a12f861_c3bf08a3-4d51-4859-acbb-5075f9484f87", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 991.56, "links": [{"amount": -991.56, "currencyRate": 1, "id": "013f05e6-2583-4e6d-8309-a479808cf7bf", "type": "Invoice"}]}], "modifiedDate": "2022-10-26T13:36:13Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "19230010", "sourceModifiedDate": "2019-11-26T12:31:12Z", "totalAmount": 991.56}], "totalResults": 46} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/payments?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/payments?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "4a4e34b5-7f62-4b64-a44a-073398b14b41", "name": "Bank"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Customer A", "id": "7e566728-a7f3-4860-a7f5-381664673287"}, "date": "2020-01-02T00:00:00Z", "id": "14b7d656-07ee-4d70-aafa-61c0030c08ad_7e566728-a7f3-4860-a7f5-381664673287", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1, "links": [{"amount": -1, "currencyRate": 1, "id": "6220ed43-1fec-4e17-a88f-c7ee5b949e76", "type": "Invoice"}]}], "modifiedDate": "2022-10-26T13:35:14Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "20200002", "sourceModifiedDate": "2020-01-02T10:08:27Z", "totalAmount": 1}, {"accountRef": {"id": "4a4e34b5-7f62-4b64-a44a-073398b14b41", "name": "Bank"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Customer A", "id": "7e566728-a7f3-4860-a7f5-381664673287"}, "date": "2020-01-02T00:00:00Z", "id": "d8b093cf-3d37-405b-9e85-72552226553f_7e566728-a7f3-4860-a7f5-381664673287", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1, "links": [{"amount": -1, "currencyRate": 1, "id": "6220ed43-1fec-4e17-a88f-c7ee5b949e76", "type": "Invoice"}]}], "modifiedDate": "2022-10-26T13:35:14Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "20200001", "sourceModifiedDate": "2020-01-02T09:58:15Z", "totalAmount": 1}], "totalResults": 5} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/payments?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/payments?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "customerRef": {"companyName": "Wintershall Holding GmbH", "id": "6162049"}, "date": "2017-11-23T00:00:00", "id": "135234099", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 100, "links": [{"amount": -100, "currencyRate": 1, "id": "21973931", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:21:37Z", "note": "CODAT LTD ref: NOV TOPUP OTHER �100.00 - Invoice receipt against 015", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 100}, {"currency": "GBP", "customerRef": {"companyName": "Stronachs LLP", "id": "6162230"}, "date": "2017-11-23T00:00:00", "id": "135258250", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 100, "links": [{"amount": -100, "currencyRate": 1, "id": "21952246", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:21:37Z", "note": "CODAT LTD ref: NOV TOPUP OTHER �100.00 - Invoice receipt against 006", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 100}], "totalResults": 1146} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/payments?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/payments?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "customerRef": {"id": "113070"}, "date": "2018-09-11T00:00:00", "id": "765831", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1, "links": [{"amount": -1, "currencyRate": 1, "id": "113070", "type": "PaymentOnAccount"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:24Z", "note": "Overpayment: invoice #0000003, some test", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2018-09-11T06:58:46", "totalAmount": 1}, {"currency": "GBP", "customerRef": {"id": "380630"}, "date": "2019-01-21T00:00:00", "id": "988600", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 5, "links": [{"amount": -5, "currencyRate": 1, "id": "380630", "type": "PaymentOnAccount"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:24Z", "note": "Overpayment: invoice #0000007", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2019-01-21T10:23:59", "totalAmount": 5}], "totalResults": 239} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/payments?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/payments?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "customerRef": {"companyName": "Parent customer", "id": "85743294"}, "date": "2010-04-07T00:00:00", "id": "139214921", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1.2, "links": [{"amount": -1.2, "currencyRate": 1, "id": "137055108", "type": "Invoice"}]}], "modifiedDate": "2022-09-30T10:29:15Z", "note": "", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 1.2}, {"currency": "GBP", "customerRef": {"companyName": "Peter Lord", "id": "69946501"}, "date": "2017-05-01T00:00:00", "id": "86861497", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 10, "links": [{"amount": -10, "currencyRate": 1, "id": "85315064", "type": "Invoice"}]}], "modifiedDate": "2022-09-30T10:29:15Z", "note": "", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 10}], "totalResults": 74} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/data/payments?page=1&pageSize=2"}, "next": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/data/payments?page=2&pageSize=2"}, "self": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "10 Breww Ltd", "id": "417"}, "date": "2021-04-09T00:00:00", "id": "8828", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -16, "currencyRate": 1, "id": "8530", "type": "Invoice"}, {"amount": 16, "currencyRate": 1, "id": "8828", "type": "CreditNote"}]}], "modifiedDate": "2022-09-20T08:18:33Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "Credit Memo #CM28", "sourceModifiedDate": "2022-02-25T10:58:37", "totalAmount": 0}, {"accountRef": {"id": "122", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "10 Breww Ltd", "id": "417"}, "date": "2021-04-20T00:00:00", "id": "428", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 90, "links": [{"amount": -90, "currencyRate": 1, "id": "416", "type": "Invoice"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 10, "links": [{"amount": -10, "currencyRate": 1, "id": "416", "type": "Invoice"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": -10, "links": [{"amount": 10, "currencyRate": 1, "id": "428", "type": "Other"}]}], "modifiedDate": "2022-09-20T08:18:33Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "Payment #PYMT01", "sourceModifiedDate": "2022-04-28T13:36:54", "totalAmount": 90}], "totalResults": 113} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/payments?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/payments?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "80000-933270541", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Melton, Johnny", "id": "220000-933272658"}, "date": "2023-01-10T00:00:00", "id": "6915-1197775450", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 14488.64, "links": [{"amount": -14488.64, "currencyRate": 1, "id": "469E-1071530054", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:08:36Z", "note": "Check - 80000-933270541", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "19650", "sourceModifiedDate": "2023-12-16T05:06:11", "totalAmount": 14488.64}, {"accountRef": {"id": "80000-933270541", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Prentice, Adelaide", "id": "420000-1071522044"}, "date": "2023-01-15T00:00:00", "id": "6973-1197775625", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 431.95, "links": [{"amount": -431.95, "currencyRate": 1, "id": "2453-1071526256", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:08:36Z", "note": "Check - 80000-933270541", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "983409", "sourceModifiedDate": "2023-12-16T05:06:11", "totalAmount": 431.95}], "totalResults": 108} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/payments?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/payments?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "56", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Abe", "id": "9"}, "date": "2018-10-05T00:00:00", "id": "710", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 95.2, "links": [{"amount": -95.2, "currencyRate": 1, "id": "688", "type": "Invoice"}]}], "modifiedDate": "2023-01-18T11:03:14Z", "note": "Sarah's Test", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2020-08-14T09:59:29Z", "totalAmount": 95.2}, {"accountRef": {"id": "56", "name": "Undeposited Funds"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Abe", "id": "9"}, "date": "2018-10-05T00:00:00", "id": "9298", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 95.2, "links": [{"amount": -95.2, "currencyRate": 1, "id": "9", "type": "PaymentOnAccount"}]}], "modifiedDate": "2023-01-18T11:03:18Z", "note": "Adeel Test", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-06-20T13:51:36Z", "totalAmount": 95.2}], "totalResults": 3723} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/payments?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/payments?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "81", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Oxon Insurance - Holiday Party", "id": "55"}, "date": "2016-02-12T00:00:00", "id": "25", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 10800, "links": [{"amount": -10800, "currencyRate": 1, "id": "55", "type": "PaymentOnAccount"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:50Z", "note": "", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-02-03T12:09:35Z", "totalAmount": 10800}, {"accountRef": {"id": "81", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Ecker Holiday event", "id": "59"}, "date": "2016-02-12T00:00:00", "id": "31", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 15615, "links": [{"amount": -15615, "currencyRate": 1, "id": "30", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:50Z", "note": "", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2016-09-12T16:50:17Z", "totalAmount": 15615}], "totalResults": 813} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/payments?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/payments?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Stevenson & Smith", "id": "STE001"}, "date": "2019-01-30T00:00:00Z", "id": "29684", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 12.5, "links": [{"amount": -12.5, "currencyRate": 1, "id": "29676", "type": "Invoice"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 487.5, "links": [{"amount": -487.5, "currencyRate": 1, "id": "29851", "type": "Invoice"}]}], "modifiedDate": "2022-10-14T09:36:05Z", "note": "Payment on Account", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "5897532", "sourceModifiedDate": "2020-02-28T14:23:46Z", "totalAmount": 500}, {"currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Macolm Hall Associates", "id": "MAC001"}, "date": "2019-12-31T00:00:00Z", "id": "29681", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": 0.05, "currencyRate": 1, "id": "29745", "type": "Invoice"}, {"amount": -0.05, "currencyRate": 1, "id": "29681", "type": "CreditNote"}]}], "modifiedDate": "2022-10-14T09:36:05Z", "note": "Opening Balance", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "O/BAL", "sourceModifiedDate": "2020-02-28T14:23:46Z", "totalAmount": 0}], "totalResults": 83} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/payments?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/payments?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Stevenson & Smith", "id": "STE001"}, "date": "2021-01-30T00:00:00", "id": "53", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 12.5, "links": [{"amount": -12.5, "currencyRate": 1, "id": "TX-3", "type": "Invoice"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 245.34, "links": [{"amount": -245.34, "currencyRate": 1, "id": "INV-31", "type": "Invoice"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 126.9, "links": [{"amount": -126.9, "currencyRate": 1, "id": "INV-31", "type": "Invoice"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 115.26, "links": [{"amount": -115.26, "currencyRate": 1, "id": "INV-31", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:39Z", "note": "Sales receipt on account 53 linked to sales invoice tx-3, sales invoice inv-31.", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-11-25T09:43:54", "totalAmount": 500}, {"accountRef": {"id": ""}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Macolm Hall Associates", "id": "MAC001"}, "date": "2021-12-31T00:00:00", "id": "8", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -0.05, "currencyRate": 1, "id": "INV-10", "type": "Invoice"}, {"amount": 0.05, "currencyRate": 1, "id": "TX-8", "type": "CreditNote"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:39Z", "note": "Sales credit tx-8 linked to sales invoice inv-10.", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-11-25T09:43:54", "totalAmount": 0}], "totalResults": 53} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/payments?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/payments?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Widgets Limited", "id": "f4ff85ba33dd11e797950a57719b2edb"}, "date": "2017-05-08T00:00:00", "id": "d39f7a5733de11e797950a57719b2edb", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": -1080, "links": [{"amount": 1080, "currencyRate": 1, "id": "c1a0176c33de11e797950a57719b2edb", "type": "CreditNote"}]}], "modifiedDate": "2022-10-24T14:55:39Z", "note": "Customer refund using credit/debit card", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2017-05-08T11:09:38Z", "totalAmount": -1080}, {"accountRef": {"id": "2572c8766afc11e8aaa5027d54329956", "name": "Tide Current"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "John's Test Customer", "id": "3cc3148bbd8111e8bad90617b3da4b8a"}, "date": "2017-11-23T00:00:00", "id": "03a5fdc8baa643fb97587033b0c4590b", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 100, "links": [{"amount": -100, "currencyRate": 1, "id": "ede1e735bd8111e8bad90617b3da4b8a", "type": "Invoice"}]}], "modifiedDate": "2022-10-24T14:55:39Z", "note": "Customer receipt using credit/debit card", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2019-01-17T14:14:55Z", "totalAmount": 100}], "totalResults": 2321} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/payments?page=1&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "customerRef": {"companyName": "MK Manufacturing", "id": "12"}, "date": "2021-04-22T00:00:00", "id": "2918", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 120, "links": [{"amount": -120, "currencyRate": 1, "id": "2916", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:02Z", "note": "", "paymentMethodRef": {"id": "1", "name": "Printed Check"}, "sourceModifiedDate": "2021-04-22T11:01:11Z", "totalAmount": 120}, {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "customerRef": {"companyName": "Shoprite", "id": "531"}, "date": "2022-04-19T00:00:00", "id": "6105", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 150, "links": [{"amount": -150, "currencyRate": 1, "id": "531", "type": "PaymentOnAccount"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:02Z", "note": "", "paymentMethodRef": {"id": "6", "name": "Cash"}, "sourceModifiedDate": "2022-04-19T13:38:45Z", "totalAmount": 150}], "totalResults": 2} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/payments?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/payments?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Maddox Publishing Group", "id": "afd4093b-c655-4847-8ee2-10a4f2c3eae3"}, "date": "2022-02-17T00:00:00", "id": "65b746c8-9a5d-4a95-8096-d2316fcff592", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 4200, "links": [{"amount": -4200, "currencyRate": 1, "id": "321bfed3-2da2-4969-9358-4de97821181b", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:37:08Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2021-01-02T22:50:58", "totalAmount": 4200}, {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Ridgeway University", "id": "a871a956-05b5-4e2a-9419-7aeb478ca647"}, "date": "2022-02-17T00:00:00", "id": "8c481b70-b5d7-4de4-a7f7-9e161be2c472", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 500, "links": [{"amount": -500, "currencyRate": 1, "id": "4b6d0c8f-10fa-42cd-a6e5-53b175e90005", "type": "Invoice"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:37:08Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "", "sourceModifiedDate": "2021-01-02T22:51:43", "totalAmount": 500}], "totalResults": 30} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/payments?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/payments?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/payments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "104957000000060010", "name": "Abdi Test"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Test Company", "id": "104957000000037097"}, "date": "2020-02-06T00:00:00", "id": "104957000000070175", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 9001, "links": [{"amount": -9001, "currencyRate": 1, "id": "104957000000038052", "type": "Invoice"}]}], "modifiedDate": "2022-10-03T08:41:17Z", "note": "Cheque deposit", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "4", "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 9001}, {"accountRef": {"id": "104957000000060010", "name": "Abdi Test"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Test Company", "id": "104957000000037097"}, "date": "2020-02-14T00:00:00", "id": "104957000000067014", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 9001, "links": [{"amount": -9001, "currencyRate": 1, "id": "104957000000038106", "type": "Invoice"}]}], "modifiedDate": "2022-10-03T08:41:17Z", "note": "", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 9001}], "totalResults": 33} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-accounting-aged-creditors-report: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -78.12, "details": [{"amount": -78.12, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 375.6, "details": [{"amount": 375.6, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "owQ2Gqgj9f", "supplierName": "Abshire - Kshlerin"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -3782.27, "details": [{"amount": -3782.27, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 8556.1, "details": [{"amount": 8556.1, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "FyUkHbZxhn", "supplierName": "Arjun Kuvalis"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 213.19, "details": [{"amount": 213.19, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "gxazX5hqx4", "supplierName": "Bernier Inc"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -2242.95, "details": [{"amount": 0, "name": "Bills"}, {"amount": -2242.95, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 838.67, "details": [{"amount": 838.67, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "ro8nWYGzlg", "supplierName": "Botsford - Hickle"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -276.5, "details": [{"amount": -276.5, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 46060.53, "details": [{"amount": 46060.53, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "D4Q4iYwHou", "supplierName": "Breitenberg, Emard and Schiller"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 22726.97, "details": [{"amount": 22726.97, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "9436ead6-545e-4e8c-8444-0220047c5a38", "supplierName": "Champlin LLC"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -19.39, "details": [{"amount": -19.39, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "O6jExrbN3v", "supplierName": "Collins - Anderson"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 302.8, "details": [{"amount": 302.8, "name": "Bills"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "9d4b61a4-4ce3-4d90-8d6b-66614694dc27", "supplierName": "Crona - Adams"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -3271.91, "details": [{"amount": -3271.91, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 3479.78, "details": [{"amount": 3479.78, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "ad8f4ee1-7a04-415f-b3dc-365d41d8d4f0", "supplierName": "Cronin, Kunde and Tremblay"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -16511.91, "details": [{"amount": -16511.91, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "8GeHBdBZiZ", "supplierName": "DuBuque, Goyette and Franecki"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 238599.9, "details": [{"amount": 238599.9, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "XOPP3v2lQu", "supplierName": "Fisher and Sons"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -113.59, "details": [{"amount": -113.59, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 910.45, "details": [{"amount": 910.45, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "0a7b0432-7de3-4e29-bf15-4e7ca0722384", "supplierName": "Flatley - Kirlin"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -2070.59, "details": [{"amount": -2070.59, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "HrGZeW4I51", "supplierName": "Frami, Simonis and Krajcik"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -105.07, "details": [{"amount": -105.07, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "SFmBGSHLQ3", "supplierName": "Gottlieb LLC"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -297.78, "details": [{"amount": -297.78, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2095.75, "details": [{"amount": 2095.75, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "unNIu8Uyap", "supplierName": "Hahn and Sons"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 3612.41, "details": [{"amount": 3612.41, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "GTGS3Sx241", "supplierName": "Harvey Predovic"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -11662.51, "details": [{"amount": -11662.51, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 393776.18, "details": [{"amount": 393776.18, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "w07H3CBm5P", "supplierName": "Hayes, Predovic and Ruecker"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 3433.54, "details": [{"amount": 3433.54, "name": "Bills"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "92144542-2227-409e-8f5b-fc73260e670b", "supplierName": "Hettinger, Schmitt and Will"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -7484.88, "details": [{"amount": -7484.88, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "rpLhEYz0ML", "supplierName": "Hickle - Buckridge"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -6627.16, "details": [{"amount": -6627.16, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 18266.27, "details": [{"amount": 18266.27, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "d2056eb9-649e-4808-8f96-d8ea4dac71fe", "supplierName": "Hodkiewicz Group"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 4042.16, "details": [{"amount": 4042.16, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "s3WcvMyVdR", "supplierName": "Howe - Ruecker"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -12938.29, "details": [{"amount": -12938.29, "name": "BillCreditNotes"}, {"amount": 0, "name": "Bills"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 18360.8, "details": [{"amount": 18360.8, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "b60XbI9zhE", "supplierName": "Jenkins Inc"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 190.16, "details": [{"amount": 190.16, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "OtXKRTOcQc", "supplierName": "Jensen Steuber"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -69.05, "details": [{"amount": -69.05, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 51357.36, "details": [{"amount": 51357.36, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "c02bc2f1-631d-4721-aec1-a190d63e8322", "supplierName": "Jones - Zulauf"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -2496.69, "details": [{"amount": -2496.69, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1519.74, "details": [{"amount": 1519.74, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "c02382bd-ff23-4b34-bfd7-8dce15fa7d6a", "supplierName": "Keara Leffler"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 12367.4, "details": [{"amount": 12367.4, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "d3tf43eghS", "supplierName": "Klocko - Keebler"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -318.71, "details": [{"amount": -318.71, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "7GObELDcsE", "supplierName": "Lakin, Schmeler and Kihn"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -1042.8, "details": [{"amount": -1042.8, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "gO8p5O3Mvy", "supplierName": "Lehner Group"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -7.5, "details": [{"amount": -7.5, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "62229022-713f-4c64-84f2-63cf6dd11443", "supplierName": "Littel - Cole"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -1611.56, "details": [{"amount": -1611.56, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "39b32019-c5d0-4db3-ae83-f0a644e614ef", "supplierName": "Marvin - Schaden"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -604.41, "details": [{"amount": -604.41, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "8635b986-048f-424c-985d-912576c004d9", "supplierName": "Mills, Bechtelar and Wintheiser"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -55.93, "details": [{"amount": -55.93, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "d2fb1aba-79ac-4840-95d5-6c173c9beaad", "supplierName": "Morissette LLC"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1546.46, "details": [{"amount": 1546.46, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "27dc0345-aae8-4b69-a903-fed6b0a8778b", "supplierName": "Newton Zieme"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -186.97, "details": [{"amount": -186.97, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 5131.74, "details": [{"amount": 5131.74, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "0d892acd-4b56-4412-80ee-381b8118637b", "supplierName": "Nicolas - McKenzie"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -6.41, "details": [{"amount": -6.41, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "cc283863-960f-42f8-8e38-1e22235e9cfc", "supplierName": "Nicolas Group"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -2822.41, "details": [{"amount": -2822.41, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "9UvJVVmPHO", "supplierName": "Nienow - Schroeder"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 3600.36, "details": [{"amount": 3600.36, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "1346295c-2970-47a7-8a99-1f935567db02", "supplierName": "Polly Crona"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -2938.85, "details": [{"amount": 0, "name": "Bills"}, {"amount": -2938.85, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "5fcb09bf-ae92-42a1-a69b-57c5f0ebedd9", "supplierName": "Raul Johns"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1106.72, "details": [{"amount": 1106.72, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "4253a13e-638e-4a42-9e61-665a60267a48", "supplierName": "Robel, Ledner and Stroman"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -12468.22, "details": [{"amount": -12468.22, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 39306.44, "details": [{"amount": 39306.44, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "143ed2c5-2623-465e-a015-5ac12df75aa6", "supplierName": "Schulist - Douglas"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -517.52, "details": [{"amount": -517.52, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "d770b767-489e-455b-9d32-29c37a1b9d07", "supplierName": "Schultz Group"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -597.01, "details": [{"amount": -597.01, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "98e93284-fcaa-440c-8f86-f36e5df591da", "supplierName": "Simonis - Ziemann"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -62443.6, "details": [{"amount": -62443.6, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "87e907ed-97f8-4146-b276-fea2a10671bf", "supplierName": "Sporer and Sons"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -1104.37, "details": [{"amount": -1104.37, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1050.12, "details": [{"amount": 1050.12, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "97682025-4e50-449f-8510-6d09d1d0f84b", "supplierName": "Sporer LLC"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -1966.59, "details": [{"amount": -1966.59, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 10234.97, "details": [{"amount": 10234.97, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "c51351a0-b43f-48c6-8dbb-8417171bda67", "supplierName": "Veum - Schiller"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -23450.31, "details": [{"amount": -23450.31, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "26f6b56a-4a86-468f-a302-9d60bdc01d91", "supplierName": "Vincenzo Wolff"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -681.79, "details": [{"amount": -681.79, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 10221.45, "details": [{"amount": 10221.45, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "f589fd05-c5f8-4815-b205-0a9f3f0b3b96", "supplierName": "Weber LLC"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1219.54, "details": [{"amount": 1219.54, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "1cc8b95c-62ec-415a-ab0e-facf7e7218bf", "supplierName": "Welch, Terry and Hermiston"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 272.67, "details": [{"amount": 272.67, "name": "Bills"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "f6CgWtm1aw", "supplierName": "Wisoky Group"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 7238.24, "details": [{"amount": 7238.24, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "je5ok1Cam5", "supplierName": "Wunsch, Kerluke and West"}], "generated": "2023-05-02T16:05:21.7545859Z", "reportDate": "2023-05-02T16:05:21.7016767Z"} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -526.8, "details": [{"amount": -526.8, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 120, "details": [{"amount": 120, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "e89328bd-485a-eb11-89fa-00224800af18", "supplierName": "A QA"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -65, "details": [{"amount": -65, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -11904.4, "details": [{"amount": 461.6, "name": "Bills"}, {"amount": -12366, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -15, "details": [{"amount": -15, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "PLN"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 5, "details": [{"amount": 5, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "MAD"}], "supplierId": "be1217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "Fabrikam, Inc."}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 12123.81, "details": [{"amount": 12128.81, "name": "Bills"}, {"amount": -5, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "c01217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "First Up Consultants"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 7514.8, "details": [{"amount": 7520.8, "name": "Bills"}, {"amount": -6, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "c21217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "Graphic Design Institute"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -121, "details": [{"amount": -121, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "supplierId": "4a1b210e-b805-ec11-86bc-0022481a45c2", "supplierName": "Kays Farm"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 13156.74, "details": [{"amount": 13156.74, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "c61217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "Nod Publishers"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 3951, "details": [{"amount": 3951, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 121.45, "details": [{"amount": 121.45, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "MAD"}], "supplierId": "b864b5ae-4a5a-eb11-89fa-00224800af18", "supplierName": "Test Supplier"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -5.27, "details": [{"amount": 0, "name": "Bills"}, {"amount": -5.27, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -11.75, "details": [{"amount": -11.75, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "supplierId": "8b4c95b4-b705-ec11-86bc-0022481a45c2", "supplierName": "Vegan Farm"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 15843.22, "details": [{"amount": 15848.22, "name": "Bills"}, {"amount": -5, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "c41217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "Wide World Importers"}], "generated": "2023-05-02T16:05:21.1349781Z", "reportDate": "2023-05-02T16:05:21.0866594Z"} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -38.28, "details": [{"amount": -38.28, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1952.27, "details": [{"amount": 1941.58, "name": "Bills"}, {"amount": 10.69, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 10, "details": [{"amount": 10, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "3150917c-1d92-4d77-9018-31b5c4758ca9", "supplierName": "Abe"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -10000, "details": [{"amount": -10000, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 117, "details": [{"amount": 117, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 4997.25, "details": [{"amount": 4997.25, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "5811b467-53eb-4491-8ca1-bc9b7889811b", "supplierName": "Ann's test supplier 2"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 110, "details": [{"amount": 108, "name": "Bills"}, {"amount": 2, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}], "supplierId": "78afea22-ee21-48c3-84d5-45b9b24768e9", "supplierName": "Ann's test supplier 2"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -293.14, "details": [{"amount": -293.14, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1547.08, "details": [{"amount": 1547.08, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 32.17, "details": [{"amount": 32.17, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "773416a6-b196-487b-ae02-eeb273a86bcd", "supplierName": "Belastingdienst"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 121, "details": [{"amount": 121, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}], "supplierId": "7017da1f-2d49-4601-abf3-c4e779459976", "supplierName": "Bool Test"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -65.73, "details": [{"amount": -65.73, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -83351.62, "details": [{"amount": -83381.63, "name": "BillPayments"}, {"amount": 30.01, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -8285.73, "details": [{"amount": -8285.73, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "f87070e2-bbd7-4383-a7c9-824748c1d70e", "supplierName": "Exact Software Nederland B.V."}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 19.93, "details": [{"amount": 19.93, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "8cb6745b-4769-4c7a-9d92-bc688c60ca3c", "supplierName": "iZettle AB (Supplier)"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 5, "details": [{"amount": 5, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}], "supplierId": "63fadca8-4905-475a-b32a-b4341293bcf4", "supplierName": "Kelly's Industrial Supplies"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -276, "details": [{"amount": -276, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 75, "details": [{"amount": 105, "name": "Bills"}, {"amount": -30, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -10, "details": [{"amount": -10, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "RUB"}], "supplierId": "acde3236-898e-4e68-b076-4e946defbc5f", "supplierName": "Matt Ager Test Supplier 1"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -12.1, "details": [{"amount": -12.1, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 119.97, "details": [{"amount": 119.97, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}, {"agedOutstandingAmounts": [{"amount": -7040, "details": [{"amount": -7040, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 8800, "details": [{"amount": 8800, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "5e6f49b9-6489-4b82-83e7-291d308919bb", "supplierName": "Mickey Mouse"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -0.83, "details": [{"amount": -0.83, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}], "supplierId": "fc189bfa-f083-438c-bf09-379a0631d4a1", "supplierName": "Mickey Mouse"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 25, "details": [{"amount": 25, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "1d2c9f47-a2fc-48e6-a967-71583d764b10", "supplierName": "NLSuppliers07"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -55, "details": [{"amount": -55, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 11084, "details": [{"amount": 11084, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "a1e88d58-caec-4ed6-ad1b-646ebb959c17", "supplierName": "supplierrrr"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 13.21, "details": [{"amount": 13.21, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}], "supplierId": "cdcdce7b-0330-49fb-8169-0a50e0b74dcc", "supplierName": "Test NL sup1"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 718.22, "details": [{"amount": 718.22, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}], "supplierId": "bad8020a-267f-41fb-9e0f-e93465ee9529", "supplierName": "Test supplier"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 403.74, "details": [{"amount": 403.74, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}], "supplierId": "26bc5305-8613-43e4-ab97-522ade34cbba", "supplierName": "Vandana's Test Supplier"}], "generated": "2023-05-02T16:05:19.8312183Z", "reportDate": "2023-05-02T16:05:19.7538301Z"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -10, "details": [{"amount": -10, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 560.1, "details": [{"amount": 660.1, "name": "Bills"}, {"amount": -100, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "0185fea2-0298-445b-909a-0db685118a9e", "supplierName": "a"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -400, "details": [{"amount": -400, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 30, "details": [{"amount": 430, "name": "Bills"}, {"amount": -400, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "64ae712f-4155-48bb-9fce-98232c51d979", "supplierName": "aa"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -65, "details": [{"amount": -65, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 609, "details": [{"amount": 258, "name": "Bills"}, {"amount": 351, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "5f20075a-a28e-434d-81a6-2db0dc170e87", "supplierName": "Abdi 99"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -3600, "details": [{"amount": -3600, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2400, "details": [{"amount": 2400, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "0d3f8692-4b0a-4bc3-85f2-4cb763306397", "supplierName": "Ann's test supplier"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -1717.5, "details": [{"amount": -1717.5, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2751, "details": [{"amount": 2751, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "fc62db43-a6f8-4b65-9d29-15290ec56674", "supplierName": "Anna's test supplier"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -6, "details": [{"amount": -6, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "cde51f36-2a06-4eac-9784-c0c967c1e1ed", "supplierName": "b"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 220, "details": [{"amount": 220, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "437c6631-3c5d-4351-b757-6ad4f94bd26e", "supplierName": "bb"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -60, "details": [{"amount": -60, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "fe713acb-3c98-423d-8372-68a32aae6232", "supplierName": "cc"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -100073.4, "details": [{"amount": -100073.4, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 374.8, "details": [{"amount": 373.8, "name": "Bills"}, {"amount": 1, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "1c703cce-967c-4476-a86a-32e35341a8f5", "supplierName": "Customer Bill Supplier"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2.05, "details": [{"amount": 2.05, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "6a4c6a14-d5eb-4427-aae0-c544f67dff7a", "supplierName": "CustomerAndSupplier"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 200, "details": [{"amount": 200, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "efb5d438-7d3a-4b77-a254-2d90f76d3f22", "supplierName": "dd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -72.33, "details": [{"amount": -72.33, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "77b652bb-a363-4425-adbd-0206e2ce4639", "supplierName": "e"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 133.6, "details": [{"amount": 133.6, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "a4d5d739-c979-4819-b0ce-666db1ec3a7d", "supplierName": "Exact Software (UK) Ltd � Exact Online"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 192.5, "details": [{"amount": 192.5, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "7c8a9143-7322-48e3-b809-88a038b8a0e0", "supplierName": "John Doe"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -1200, "details": [{"amount": -1200, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 3837, "details": [{"amount": 3837, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "a7cad20d-44db-442b-ac1f-90475802d6fb", "supplierName": "Pencils Pencils Pencils"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -46.8, "details": [{"amount": -46.8, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -54537.12, "details": [{"amount": 455.73, "name": "Bills"}, {"amount": -54992.85, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "41302634-76b5-4442-b800-0bb63780e77c", "supplierName": "Some Supplier"}], "generated": "2023-05-02T16:05:22.8960035Z", "reportDate": "2023-05-02T16:05:22.8283897Z"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [{"amount": 0, "name": "BillPayments"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 791, "details": [{"amount": 791, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 12, "details": [{"amount": 12, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "QAR"}], "supplierId": "10123537", "supplierName": "_Test 1"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -6430, "details": [{"amount": 1500, "name": "Bills"}, {"amount": -7930, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1200, "details": [{"amount": 1200, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "11526230", "supplierName": "-"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 5, "details": [{"amount": 5, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}], "supplierId": "9677150", "supplierName": "-"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -134.3, "details": [{"amount": -134.3, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 46, "details": [{"amount": 46, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "8959011", "supplierName": "1"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -2433.99, "details": [{"amount": -2433.99, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 3431, "details": [{"amount": 3431, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 400, "details": [{"amount": 400, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "supplierId": "6161941", "supplierName": "A & J Fabtech Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -10, "details": [{"amount": -10, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "6161963", "supplierName": "ABB Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 12, "details": [{"amount": 12, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "9356878", "supplierName": "Abdul Al-haj"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 77, "details": [{"amount": 77, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "8984892", "supplierName": "Abraham's Spider Hunting Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -456, "details": [{"amount": -456, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "9273150", "supplierName": "Best Company"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -100, "details": [{"amount": -100, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 122, "details": [{"amount": 122, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "6161956", "supplierName": "C Allen"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 10, "details": [{"amount": 10, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "7994567", "supplierName": "codat"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 200, "details": [{"amount": 200, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "5730310", "supplierName": "Demo Customer"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 42, "details": [{"amount": 42, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "6162169", "supplierName": "PricewaterhouseCoopers LLP"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -42, "details": [{"amount": -42, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 130, "details": [{"amount": 130, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "10672202", "supplierName": "Random Org"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -500, "details": [{"amount": -500, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -150, "details": [{"amount": -150, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "8989342", "supplierName": "Supplier Hidden"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -492, "details": [{"amount": -492, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 3523.75, "details": [{"amount": 3523.75, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 301, "details": [{"amount": 301, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "supplierId": "7169654", "supplierName": "The Eagle"}], "generated": "2023-05-02T16:05:23.3560058Z", "reportDate": "2023-05-02T16:05:23.3059155Z"} + MYOB AccountRight and Essentials: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [], "generated": "2023-05-02T16:05:21.5229720Z", "reportDate": "2023-05-02T16:05:21.2821865Z"} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 56, "details": [{"amount": 56, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "779", "supplierName": "Test Vendor"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 579.55, "details": [{"amount": 524, "name": "Bills"}, {"amount": 55.55, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "724", "supplierName": "Vendor A.A.A"}], "generated": "2023-05-02T16:05:20.3296968Z", "reportDate": "2023-05-02T16:05:20.2442587Z"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [{"amount": 0, "name": "BillPayments"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 5000, "details": [{"amount": 5000, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "B0000-933272656", "supplierName": "Patton Hardware Supplies"}], "generated": "2023-05-02T16:05:20.3972104Z", "reportDate": "2023-05-02T16:05:20.3178060Z"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 230.98, "details": [{"amount": 276.38, "name": "Bills"}, {"amount": -45.4, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "129", "supplierName": "Ally Johnson"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -16, "details": [{"amount": -16, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 66.25, "details": [{"amount": -13.75, "name": "BillPayments"}, {"amount": 80, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "88", "supplierName": "Andrew Haberbosch"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 63, "details": [{"amount": 63, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "53", "supplierName": "Bank of AnyCity"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 490.5, "details": [{"amount": -9.5, "name": "BillPayments"}, {"amount": 500, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "282", "supplierName": "Becky's Bakery"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -69, "details": [{"amount": -69, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 52260, "details": [{"amount": 52260, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "24", "supplierName": "Brijesh Jain"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 70, "details": [{"amount": 70, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "25", "supplierName": "Brittney Hughes"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 33.05, "details": [{"amount": 33.05, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "26", "supplierName": "Burc Gunes"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1450, "details": [{"amount": 1500, "name": "Bills"}, {"amount": -50, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "27", "supplierName": "Cass Hayden"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 7.25, "details": [{"amount": 24, "name": "Bills"}, {"amount": -16.75, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "51", "supplierName": "City Water Co"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -128, "details": [{"amount": 0, "name": "Bills"}, {"amount": -25, "name": "BillPayments"}, {"amount": -103, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -328.32, "details": [{"amount": 0, "name": "Bills"}, {"amount": -328.32, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "297", "supplierName": "Codat Supplier"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -17.85, "details": [{"amount": -17.85, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "87", "supplierName": "Costco"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1041.09, "details": [{"amount": 1041.09, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "HKD"}], "supplierId": "57", "supplierName": "Hall's Promo Items"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 25292, "details": [{"amount": 25302, "name": "Bills"}, {"amount": -10, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "92", "supplierName": "Huw Thomas"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -446.83, "details": [{"amount": -446.83, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 9759.68, "details": [{"amount": 9822.46, "name": "Bills"}, {"amount": -62.78, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "85", "supplierName": "Jay's Farm"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 239.01, "details": [{"amount": 239.01, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "34", "supplierName": "Jennifer Hargreaves"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -1710, "details": [{"amount": -1710, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 502.38, "details": [{"amount": 502.38, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "37", "supplierName": "Kristina Gibson"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 3000, "details": [{"amount": 3000, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "41", "supplierName": "Mark Howard"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -21.2, "details": [{"amount": -21.2, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 54.09, "details": [{"amount": 54.09, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "23", "supplierName": "Mr Andrew Thomas Haberbosch"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 390, "details": [{"amount": 390, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "54", "supplierName": "Organization of Outstanding Event Planners"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 21, "details": [{"amount": 21, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "47", "supplierName": "Sanjeev Kak"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 200, "details": [{"amount": 200, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "74", "supplierName": "TestPushCustomer3"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -42.76, "details": [{"amount": -42.76, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1249.3, "details": [{"amount": -504.24, "name": "BillPayments"}, {"amount": 1753.54, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "86", "supplierName": "Vegan Farm"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 461, "details": [{"amount": 500, "name": "Bills"}, {"amount": -39, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "58", "supplierName": "Venue Rental"}], "generated": "2023-05-02T16:05:21.3065432Z", "reportDate": "2023-05-02T16:05:21.2488309Z"} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 411.76, "details": [{"amount": 782.56, "name": "Bills"}, {"amount": -370.8, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "CON002", "supplierName": "Concept Stationery Sub A"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -167.1, "details": [{"amount": -167.1, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 5062.78, "details": [{"amount": 5111.01, "name": "Bills"}, {"amount": -48.23, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "CON001", "supplierName": "Concept Stationery Supplies"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 25802.03, "details": [{"amount": 25934.03, "name": "Bills"}, {"amount": -132, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "MCN001", "supplierName": "McNally Computer Supplies"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -48, "details": [{"amount": -48, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1368.02, "details": [{"amount": 1524, "name": "Bills"}, {"amount": -155.98, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "MEA001", "supplierName": "Mears Insurance"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -13.21, "details": [{"amount": -13.21, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1024.13, "details": [{"amount": 1041.61, "name": "Bills"}, {"amount": -17.48, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "NEW001", "supplierName": "Newtown Builders Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -105.64, "details": [{"amount": -105.64, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 155.92, "details": [{"amount": 155.92, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "QUA001", "supplierName": "Quality Motors"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 60000, "details": [{"amount": 60000, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "JPY"}], "supplierId": "RSP002", "supplierName": "Richard Sanderson-Pope"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1130.29, "details": [{"amount": 1189.29, "name": "Bills"}, {"amount": -59, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "SDE001", "supplierName": "S D Enterprises"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 562.06, "details": [{"amount": 562.06, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "STU001", "supplierName": "Studio Designs"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2055.3, "details": [{"amount": 2055.3, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "SUP002", "supplierName": "Superclean"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 9433.71, "details": [{"amount": 9433.71, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "SUP001", "supplierName": "Superior Technologies Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -135.13, "details": [{"amount": -135.13, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 576.04, "details": [{"amount": 1091.04, "name": "Bills"}, {"amount": -515, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "THO001", "supplierName": "Thompsons Electricals"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -103.4, "details": [{"amount": -103.4, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1104.16, "details": [{"amount": 1104.16, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "UNI001", "supplierName": "Unique Systems"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -70.76, "details": [{"amount": -70.76, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -55.52, "details": [{"amount": 94.48, "name": "Bills"}, {"amount": -150, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "WAL001", "supplierName": "Wallace Office Equipment"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -35.01, "details": [{"amount": -35.01, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -221.75, "details": [{"amount": -121.75, "name": "Bills"}, {"amount": -100, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "WIS001", "supplierName": "Wise Electricals Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 5868.13, "details": [{"amount": 5868.13, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "WIS002", "supplierName": "Wiseman Paper Products"}], "generated": "2023-05-02T16:05:20.7939148Z", "reportDate": "2023-05-02T16:05:20.7474542Z"} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1644.39, "details": [{"amount": 1644.39, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "CON001", "supplierName": "Concept Stationery Supplies"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 24734.12, "details": [{"amount": 24734.12, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "MCN001", "supplierName": "McNally Computer Supplies"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -0.01, "details": [{"amount": -0.01, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0.01, "details": [{"amount": 0.01, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "NEW001", "supplierName": "Newtown Builders Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -42.63, "details": [{"amount": -42.63, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 72.85, "details": [{"amount": 72.85, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "QUA001", "supplierName": "Quality Motors"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 352.5, "details": [{"amount": 352.5, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "SDE001", "supplierName": "S D Enterprises"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1762.5, "details": [{"amount": 1762.5, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "SUP002", "supplierName": "Superclean"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 9164.95, "details": [{"amount": 9164.95, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "SUP001", "supplierName": "Superior Technologies Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -135.13, "details": [{"amount": -135.13, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 472.24, "details": [{"amount": 972.24, "name": "Bills"}, {"amount": -500, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "THO001", "supplierName": "Thompsons Electricals"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -103.4, "details": [{"amount": -103.4, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 744.16, "details": [{"amount": 744.16, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "UNI001", "supplierName": "Unique Systems"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -58.76, "details": [{"amount": -58.76, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -55.52, "details": [{"amount": 94.48, "name": "Bills"}, {"amount": -150, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "WAL001", "supplierName": "Wallace Office Equipment"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -35.01, "details": [{"amount": -35.01, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 117.29, "details": [{"amount": 117.29, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "WIS001", "supplierName": "Wise Electricals Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 5868.13, "details": [{"amount": 5868.13, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "WIS002", "supplierName": "Wiseman Paper Products"}], "generated": "2023-05-02T16:05:20.0257207Z", "reportDate": "2023-05-02T16:05:19.9751677Z"} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -60, "details": [{"amount": -60, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1548.84, "details": [{"amount": 1608.84, "name": "Bills"}, {"amount": -60, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "65179671e9ef424caff8b9006cd111c8", "supplierName": "5555 Abdul's Test Name"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -841570.32, "details": [{"amount": -841570.32, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 661901.14, "details": [{"amount": 662062.14, "name": "Bills"}, {"amount": -161, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "cf7f44d693904944a6a7cf3de0887964", "supplierName": "Abdi Supplier"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -38.8, "details": [{"amount": 1.2, "name": "Bills"}, {"amount": -40, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "f82f0f59fbf44416b833562783388ee9", "supplierName": "Abe's Spider Hunting Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -140.97, "details": [{"amount": -140.97, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1856307.16, "details": [{"amount": -213, "name": "BillPayments"}, {"amount": 1856520.16, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "supplierId": "ec716559789111e8aaa5027d54329956", "supplierName": "Bagels Limited"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 360000, "details": [{"amount": 360000, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "b1354c4ae5db4d069acbcf49bee62215", "supplierName": "Boyer Inc"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1.2, "details": [{"amount": 1.2, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "46b3d6acedcb4738a9646dc512562cda", "supplierName": "callum"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -36, "details": [{"amount": -36, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1814652, "details": [{"amount": 1814652, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "7e7450fadbb94d09abdaf609a51d05eb", "supplierName": "Debs UK Supplier"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -105.6, "details": [{"amount": -105.6, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 26.4, "details": [{"amount": 26.4, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "bf6fc20701264c899a1ba96365aa9d70", "supplierName": "Eliana's"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 60, "details": [{"amount": 60, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "30862a4b2c084a4fa2e640f9ef371e4c", "supplierName": "Flour Inc"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 9, "details": [{"amount": 9, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "390ca10633cb4bf989961491e834b47a", "supplierName": "Jo Cheese"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 65150090, "details": [{"amount": 65150090, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "b10be78d0e9340a79743c538a0b481d0", "supplierName": "M7 Smith"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -6841.33, "details": [{"amount": -6841.33, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 6841.33, "details": [{"amount": 6841.33, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}], "supplierId": "693d3b961e744b02a6a260f4bada75b0", "supplierName": "Matt Ager Test EU Supplier"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 300, "details": [{"amount": 300, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "1edf56c368e14a35a050b3e8336e2272", "supplierName": "Mike B Commerce Test"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -120, "details": [{"amount": -120, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "c6d3fa5bf2634b148d0ee82b6fbb8fe3", "supplierName": "my shop supplier"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -36, "details": [{"amount": -36, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "cdeae2fcbe6447f698d2a59d68e4ad82", "supplierName": "Nic Supp"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 30, "details": [{"amount": 30, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "2e14c8cfee3041a4a5e8a619b336f900", "supplierName": "Nic Supplies Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -306, "details": [{"amount": -306, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "c41981674176495f927f46ce663d46ac", "supplierName": "Ninetta Ponting"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -70, "details": [{"amount": -70, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "e2dd680fed99410982673f8fc2722357", "supplierName": "Supplier 70"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -701, "details": [{"amount": -701, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "AUD"}], "supplierId": "8d61f7cd3a2f4ceea26ac5bca15e10da", "supplierName": "Supplier 71 (AUD)"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 12014.4, "details": [{"amount": 12014.4, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "7a67caeb261f40259f0948785090af0b", "supplierName": "supplier test"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -454, "details": [{"amount": -454, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 456, "details": [{"amount": 456, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "d884f637bb3a4e589d640085b31ad6ee", "supplierName": "Tasty Treats Icecreams"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -1152.78, "details": [{"amount": -1152.78, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 14960.37, "details": [{"amount": 15064.41, "name": "Bills"}, {"amount": -104.04, "name": "BillPayments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "ca430e0d156011e8b45c025132dab352", "supplierName": "Test Supplier"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -50, "details": [{"amount": -50, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 63338524.47, "details": [{"amount": 63338524.47, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "2541e491791c485a96cc480cfde112d6", "supplierName": "Test Supplier 2"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -3535.61, "details": [{"amount": -3535.61, "name": "BillCreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 50658.58, "details": [{"amount": 50658.58, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}], "supplierId": "877aac191c3c40eda61115eea12641f7", "supplierName": "Test Supplier 3"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 51872949, "details": [{"amount": 51872949, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "d98e7afb4ca846dfbb12ca285f95f863", "supplierName": "Test Supplier 4 (US)"}], "generated": "2023-05-02T16:05:21.3095542Z", "reportDate": "2023-05-02T16:05:21.1514485Z"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 487.5, "details": [{"amount": 487.5, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "3", "supplierName": "ADP"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 7200, "details": [{"amount": 7200, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "supplierId": "14", "supplierName": "Kristofferson Consulting"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 190, "details": [{"amount": 190, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "supplierId": "7", "supplierName": "Lenovo"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 10, "details": [{"amount": 10, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "supplierId": "8", "supplierName": "Worldwide Commercial"}], "generated": "2023-05-02T16:05:22.9252709Z", "reportDate": "2023-05-02T16:05:22.8758390Z"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1200, "details": [{"amount": 1200, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "699f0091-b127-4796-9f15-41a2f42abeb2", "supplierName": "ABC Furniture"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 130, "details": [{"amount": 130, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "362819c9-f285-4d09-ac95-26327863adac", "supplierName": "Bayside Club"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 961.21, "details": [{"amount": 961.21, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "2dc0ef7c-582f-4542-963b-dbdc069e4819", "supplierName": "Bayside Wholesale"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 242, "details": [{"amount": 242, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "51cbbfb0-8dc9-41aa-aad6-eb93b3cc40c6", "supplierName": "Capital Cab Co"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1063.56, "details": [{"amount": 1063.56, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "3828f379-afa5-4b2a-9000-9c53d75ba1c6", "supplierName": "Central Copiers"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 119.08, "details": [{"amount": 119.08, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "8a593982-291c-4ec3-9a42-3dbccbc6e3c8", "supplierName": "MCO Cleaning Services"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 54.13, "details": [{"amount": 54.13, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "97cc88ca-f89b-41f0-b8b9-e750b6f2f1d9", "supplierName": "Net Connect"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 244.45, "details": [{"amount": 244.45, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "dec56ceb-65e9-43b3-ac98-7fe09eb37e31", "supplierName": "PowerDirect"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 4500, "details": [{"amount": 4500, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "f5a77e82-50e3-4340-a6e0-13d6a482a08a", "supplierName": "SMART Agency"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 93.64, "details": [{"amount": 93.64, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "3a0d40a2-2698-4cf5-b7b2-30133c632ab6", "supplierName": "Swanston Security"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 56.35, "details": [{"amount": 56.35, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "ac48c67d-3eea-44eb-96b1-9f7a89d9b761", "supplierName": "Xero"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 125.03, "details": [{"amount": 125.03, "name": "Bills"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "supplierId": "94a82e91-53da-4f87-a417-63d6a1607ced", "supplierName": "Young Bros Transport"}], "generated": "2023-05-02T16:05:20.3006654Z", "reportDate": "2023-05-02T16:05:20.2587933Z"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-aged-debtors-report: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -3367.71, "details": [{"amount": -3367.71, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "c8180244-74ac-40cf-a5df-6d83661c44d7", "customerName": "Arjun Kuvalis"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -4299.26, "details": [{"amount": 0, "name": "Invoices"}, {"amount": -4299.26, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "6d162ee4-47b4-46c6-a2e6-aa9edd0fe6b0", "customerName": "Breitenberg, Emard and Schiller"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -14959.84, "details": [{"amount": -14959.84, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 773.94, "details": [{"amount": 773.94, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "981d56a7-cf63-4ed2-b8db-2eba2c0aeb5a", "customerName": "Collins - Anderson"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -2817.59, "details": [{"amount": -2817.59, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "d3739e0f-5a70-465b-9dfe-deb8efac0cd3", "customerName": "Damien Schneider"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -1541.52, "details": [{"amount": -1541.52, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "10652b76-2a9a-43ba-a892-fb4f369fe1ef", "customerName": "Franco Labadie"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -14312.59, "details": [{"amount": -14312.59, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 158.76, "details": [{"amount": 158.76, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "03b7f9fd-40e0-4c71-9f93-58e867233bcb", "customerName": "Harvey Predovic"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -32818.36, "details": [{"amount": -32818.36, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 431.71, "details": [{"amount": 431.71, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "bbea9634-7a60-4c3f-97cd-70e481ec2cce", "customerName": "Jenkins Inc"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -9766.18, "details": [{"amount": 0, "name": "Invoices"}, {"amount": -9766.18, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1273.16, "details": [{"amount": 1273.16, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "d65ac505-072c-49ec-be3c-3cb74228966d", "customerName": "Jensen Steuber"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -2595.66, "details": [{"amount": -2595.66, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1397.98, "details": [{"amount": 1397.98, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "a82042f1-a005-4ca5-bfd3-5bc237123aa5", "customerName": "Keara Leffler"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -3047.62, "details": [{"amount": -3047.62, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "f67eab14-12f1-432f-af73-81ebf6ec8ddc", "customerName": "Neoma Kreiger"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -225.44, "details": [{"amount": -225.44, "name": "CreditNotes"}, {"amount": 0, "name": "Invoices"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "2d6a5c2d-80dc-4aac-8909-ddfb3cb24437", "customerName": "Newton Zieme"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -537.61, "details": [{"amount": -537.61, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "976a2402-0908-46d9-9121-a93005d29c01", "customerName": "Norbert Tillman"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -2538.49, "details": [{"amount": -2538.49, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "453ddfc0-49ce-4f66-a815-dae734be885c", "customerName": "Ralph Wilderman"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -4403.5, "details": [{"amount": -4403.5, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 3477.81, "details": [{"amount": 3477.81, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "51f03576-f6b0-40d5-9fba-81a490411c03", "customerName": "Raul Johns"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -1456.66, "details": [{"amount": -1456.66, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 7366.21, "details": [{"amount": 7366.21, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "84539fde-118f-48ed-978d-0aa50c7ec223", "customerName": "Rodger Feest"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -80.97, "details": [{"amount": -80.97, "name": "CreditNotes"}, {"amount": 0, "name": "Invoices"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "dc75136b-b504-49c5-be35-04e1d2771e1e", "customerName": "Vincenzo Wolff"}], "generated": "2023-05-02T16:05:21.4959955Z", "reportDate": "2023-05-02T16:05:21.4459444Z"} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -80, "details": [{"amount": -80, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -257.28, "details": [{"amount": -300, "name": "Payments"}, {"amount": 42.72, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "8ddfa6bf-0c60-eb11-89fa-00224800af18", "customerName": "Abdi Company"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -1558.56, "details": [{"amount": -1558.56, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 33200.76, "details": [{"amount": 34782.32, "name": "Invoices"}, {"amount": -1581.56, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 8554.46, "details": [{"amount": 8554.46, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "HKD"}], "customerId": "b41217b3-89d1-ea11-bbaa-000d3a2b9185", "customerName": "Adatum Corporation"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 7503.08, "details": [{"amount": 7503.08, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "ba1217b3-89d1-ea11-bbaa-000d3a2b9185", "customerName": "Alpine Ski House"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 349.68, "details": [{"amount": 349.68, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "f5860a8e-4b5a-eb11-89fa-00224800af18", "customerName": "CustomerQA"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 332.2, "details": [{"amount": 427.2, "name": "Invoices"}, {"amount": -95, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "feef29a2-1d59-ed11-8c36-002248c5e6c0", "customerName": "DP Test Customer"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -779.28, "details": [{"amount": -779.28, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1905, "details": [{"amount": 1905, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "264d74d4-3218-ed11-90eb-000d3a873415", "customerName": "Eliana"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 4923.48, "details": [{"amount": 4923.48, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "99faf6fb-5209-eb11-bbf6-0022481ad2e8", "customerName": "QA Customer"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 10559.04, "details": [{"amount": 10559.04, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "bc1217b3-89d1-ea11-bbaa-000d3a2b9185", "customerName": "Relecloud"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 33438.88, "details": [{"amount": 34811.2, "name": "Invoices"}, {"amount": -1372.32, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "b81217b3-89d1-ea11-bbaa-000d3a2b9185", "customerName": "School of Fine Art"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 10, "details": [{"amount": 10, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "dc3f4f1b-3c54-ed11-9470-002248c5e18c", "customerName": "Test no payment terms"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 126, "details": [{"amount": 126, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "9e55a119-064e-ed11-946f-0022481b84d7", "customerName": "Test Push"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 116, "details": [{"amount": 116, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "b30ca600-074e-ed11-946f-0022481b84d7", "customerName": "Test Push"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -24, "details": [{"amount": -24, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2663.38, "details": [{"amount": 10, "name": "Payments"}, {"amount": 2653.38, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "b61217b3-89d1-ea11-bbaa-000d3a2b9185", "customerName": "Trey Researches"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -18.67, "details": [{"amount": -18.67, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "customerId": "d93ceb37-b805-ec11-86bc-0022481a45c2", "customerName": "Vegan Bakeshop"}], "generated": "2023-05-02T16:05:20.8918448Z", "reportDate": "2023-05-02T16:05:20.8411594Z"} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -1, "details": [{"amount": -1, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "f594cefb-7750-4c3a-bab2-b5322026dee9", "customerName": "John Doe"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -5, "details": [{"amount": -5, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "f594cefb-7750-4c3a-bab2-b5322026dee9", "customerName": "John Doe"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -500, "details": [{"amount": -500, "name": "Payments"}, {"amount": 0, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "f594cefb-7750-4c3a-bab2-b5322026dee9", "customerName": "John Doe"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -100, "details": [{"amount": -100, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "f594cefb-7750-4c3a-bab2-b5322026dee9", "customerName": "John Doe"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -49, "details": [{"amount": -49, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "f594cefb-7750-4c3a-bab2-b5322026dee9", "customerName": "John Doe"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -10, "details": [{"amount": -10, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "f594cefb-7750-4c3a-bab2-b5322026dee9", "customerName": "John Doe"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 100, "details": [{"amount": 100, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "f594cefb-7750-4c3a-bab2-b5322026dee9", "customerName": "John Doe"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 222.71, "details": [{"amount": 222.71, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -5, "details": [{"amount": -5, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "AED"}], "customerId": "602174", "customerName": "ab1"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -2060.2, "details": [{"amount": -2083.83, "name": "Payments"}, {"amount": 23.63, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "511657", "customerName": "Bob's Stationary"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -132.15, "details": [{"amount": -160.9, "name": "Payments"}, {"amount": 28.75, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2.88, "details": [{"amount": 2.88, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "CNY"}], "customerId": "581145", "customerName": "CanadaCo"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -1031.45, "details": [{"amount": 144, "name": "Invoices"}, {"amount": -1175.45, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -100.29, "details": [{"amount": 0, "name": "Invoices"}, {"amount": -100.29, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "578409", "customerName": "company1"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 24.98, "details": [{"amount": 24.98, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "669531", "customerName": "P"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -2898.25, "details": [{"amount": -2898.25, "name": "Payments"}, {"amount": 0, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "515655", "customerName": "Parent company"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 516.3, "details": [{"amount": 0, "name": "Payments"}, {"amount": 516.3, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "customerId": "511669", "customerName": "Pens International"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -76, "details": [{"amount": 20, "name": "Invoices"}, {"amount": -96, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -1.15, "details": [{"amount": -1.15, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "customerId": "582461", "customerName": "QA Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -10, "details": [{"amount": 0, "name": "Invoices"}, {"amount": -10, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "511661", "customerName": "Sarah's Office Supplies"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 141.25, "details": [{"amount": 141.25, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "572047", "customerName": "SRS Customer"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -144.46, "details": [{"amount": 7.64, "name": "Invoices"}, {"amount": -152.1, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "536295", "customerName": "Test company"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 48442.07, "details": [{"amount": 51089.28, "name": "Invoices"}, {"amount": -2647.21, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -10, "details": [{"amount": 0, "name": "Invoices"}, {"amount": -10, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 192.28, "details": [{"amount": 1186.28, "name": "Invoices"}, {"amount": -994, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "CAD"}], "customerId": "512927", "customerName": "Wood Turnerss"}], "generated": "2023-05-02T16:05:20.6173310Z", "reportDate": "2023-05-02T16:05:20.5039554Z"} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 482.57, "details": [{"amount": 482.57, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "88459410", "customerName": "Diogo Sousa"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -216, "details": [{"amount": -216, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "86810130", "customerName": "Maria Gomez"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 5, "details": [{"amount": 5, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 5, "details": [{"amount": 5, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}], "customerId": "86832299", "customerName": "Mr French Person"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 3, "details": [{"amount": 3, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}, {"agedOutstandingAmounts": [{"amount": -46, "details": [{"amount": -46, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 55661.49, "details": [{"amount": 55911.49, "name": "Invoices"}, {"amount": -250, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "69946501", "customerName": "Peter Lord"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 4771.03, "details": [{"amount": 4771.03, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "88353693", "customerName": "Test Customer updated"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -42.42, "details": [{"amount": -42.42, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 6385, "details": [{"amount": 6385, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "69952389", "customerName": "Things Limited"}], "generated": "2023-05-02T16:05:20.3727270Z", "reportDate": "2023-05-02T16:05:20.3123550Z"} + MYOB AccountRight and Essentials: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [], "generated": "2023-05-02T16:05:21.0942911Z", "reportDate": "2023-05-02T16:05:20.8602315Z"} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [], "generated": "2023-05-02T16:05:20.0339587Z", "reportDate": "2023-05-02T16:05:19.8669114Z"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 7991.52, "details": [{"amount": 7991.52, "name": "Invoices"}, {"amount": 0, "name": "Payments"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "1F0000-933272658", "customerName": "Jacobsen, Doug"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -271.53, "details": [{"amount": -271.53, "name": "Payments"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "6F0000-1071510646", "customerName": "Morgenthaler, Jenny"}], "generated": "2023-05-02T16:05:19.9204890Z", "reportDate": "2023-05-02T16:05:19.8723073Z"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -837.11, "details": [{"amount": -837.11, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 55512.84, "details": [{"amount": 55578.69, "name": "Invoices"}, {"amount": -65.85, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 10, "details": [{"amount": 10, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "67", "customerName": "Abercrombie International Group"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -905.8, "details": [{"amount": 314.2, "name": "Invoices"}, {"amount": -1220, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "4", "customerName": "Cathy's Consulting Company"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -75, "details": [{"amount": -75, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "20", "customerName": "Chadha's Consultants"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 24, "details": [{"amount": 24, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "7", "customerName": "Clement's Cleaners"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -650.27, "details": [{"amount": 15, "name": "Invoices"}, {"amount": -469.52, "name": "CreditNotes"}, {"amount": -195.75, "name": "Payments"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 266.49, "details": [{"amount": 210.01, "name": "Invoices"}, {"amount": 56.48, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "301", "customerName": "Codat Customer"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [{"amount": 0, "name": "Payments"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 121.5, "details": [{"amount": 0, "name": "Invoices"}, {"amount": 121.5, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}, {"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 10, "details": [{"amount": 10, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "305", "customerName": "Codat Customer (USD)"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 13.37, "details": [{"amount": 13.37, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "136", "customerName": "Customer Name"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 11.65, "details": [{"amount": 11.65, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "218", "customerName": "Diego Trantow"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2273, "details": [{"amount": 2273, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "8", "customerName": "Ecker Designs"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 3206779, "details": [{"amount": 3206779, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "59", "customerName": "Ecker Holiday event"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -100, "details": [{"amount": 0, "name": "Invoices"}, {"amount": -100, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "13", "customerName": "Himateja Madala"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 10, "details": [{"amount": 10, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "11", "customerName": "Ho Engineering Company"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 116.4, "details": [{"amount": 116.4, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "114", "customerName": "huw default not included"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -521.4, "details": [{"amount": -521.4, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1120.6, "details": [{"amount": 1232.2, "name": "Invoices"}, {"amount": -111.6, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "117", "customerName": "Huw's Test Push customer2"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 32.1, "details": [{"amount": 176.1, "name": "Invoices"}, {"amount": -144, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "306", "customerName": "J Codat"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 4800, "details": [{"amount": 4800, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "15", "customerName": "Jen Zaccarella"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 112.6, "details": [{"amount": 143.96, "name": "Invoices"}, {"amount": 58.14, "name": "Payments"}, {"amount": -89.5, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "307", "customerName": "Jo Codat 2"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 160, "details": [{"amount": 160, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "119", "customerName": "John Smith 1"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -1098, "details": [{"amount": -1098, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -60, "details": [{"amount": 0, "name": "Invoices"}, {"amount": -60, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "16", "customerName": "Jordan Burgess"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 8508.37, "details": [{"amount": 8717.33, "name": "Invoices"}, {"amount": -208.96, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "83", "customerName": "Kay's Bake Shop"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -3586.2, "details": [{"amount": -3586.2, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 11291.4, "details": [{"amount": 11474.05, "name": "Invoices"}, {"amount": -182.65, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "1", "customerName": "Ko International Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -2311.27, "details": [{"amount": -2311.27, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2292.91, "details": [{"amount": 2290.91, "name": "Invoices"}, {"amount": 2, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "91", "customerName": "Mr Huw Test"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -10800, "details": [{"amount": -10800, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "55", "customerName": "Oxon Insurance - Holiday Party"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 50, "details": [{"amount": 50, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "70", "customerName": "Project X"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 12.75, "details": [{"amount": 12.75, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "281", "customerName": "Renee O'Connell"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 100, "details": [{"amount": 100, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "118", "customerName": "RSP"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1320, "details": [{"amount": 1320, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "76", "customerName": "TestPushCustomer5"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1848, "details": [{"amount": 1848, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "77", "customerName": "TestPushCustomer6"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -25, "details": [{"amount": -25, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "79", "customerName": "TestPushCustomer7"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -86.4, "details": [{"amount": -116.4, "name": "CreditNotes"}, {"amount": 30, "name": "Payments"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -206460.15, "details": [{"amount": 5145.29, "name": "Invoices"}, {"amount": -211605.44, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "84", "customerName": "Vegan Cake Shop"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -1100, "details": [{"amount": -1100, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "60", "customerName": "Whitehead - Employee celebration"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 754.4, "details": [{"amount": 754.4, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "5", "customerName": "Whitehead and Sons"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -600, "details": [{"amount": -600, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 20035.25, "details": [{"amount": 20604.49, "name": "Invoices"}, {"amount": -569.24, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "3", "customerName": "Yeung's Architects"}], "generated": "2023-05-02T16:05:21.0640297Z", "reportDate": "2023-05-02T16:05:20.9965545Z"} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -378, "details": [{"amount": -378, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 4504.07, "details": [{"amount": 4505.07, "name": "Invoices"}, {"amount": -1, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "A1D001", "customerName": "A1 Design Services"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -66, "details": [{"amount": -66, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 540, "details": [{"amount": 540, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "A1D002", "customerName": "A2 Design Services"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -24.71, "details": [{"amount": -24.71, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 16606.32, "details": [{"amount": 16606.32, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "A1D003", "customerName": "A2 Design Services"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -177.14, "details": [{"amount": -177.14, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 4345.3, "details": [{"amount": 4845.3, "name": "Invoices"}, {"amount": -500, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "ABS001", "customerName": "ABS Garages Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 100, "details": [{"amount": 100, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "customerId": "USA1", "customerName": "American Sales"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -103.16, "details": [{"amount": -103.16, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 4284.77, "details": [{"amount": 4309.77, "name": "Invoices"}, {"amount": -25, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "BBS001", "customerName": "Bobs Building Supplies"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 786.48, "details": [{"amount": 852, "name": "Invoices"}, {"amount": -65.52, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "BRO001", "customerName": "Bronson Inc"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2274.62, "details": [{"amount": 2374.62, "name": "Invoices"}, {"amount": -100, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "BUS001", "customerName": "Business Exhibitions"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 324.5, "details": [{"amount": 324.5, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "CASH001", "customerName": "Cash and Credit Card Sales"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 4571.04, "details": [{"amount": 4571.04, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "COM001", "customerName": "Compton Packaging"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2028.03, "details": [{"amount": 2028.03, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "CGS001", "customerName": "County Golf Supplies"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2341.25, "details": [{"amount": 2341.25, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "STU001", "customerName": "Edward Stuart"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 11260.26, "details": [{"amount": 11260.26, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "FGL001", "customerName": "F G Landscape & Design"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 536.67, "details": [{"amount": 656.67, "name": "Invoices"}, {"amount": -120, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "BRI001", "customerName": "Fred Briant"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 4149.09, "details": [{"amount": 4149.09, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "GRA001", "customerName": "Graham Electonics"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2082.96, "details": [{"amount": 2082.96, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "HAU001", "customerName": "Hausser GMBH"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1228.34, "details": [{"amount": 1228.34, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "JSS001", "customerName": "John Smith Studios"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 9254.03, "details": [{"amount": 9254.03, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "KIN001", "customerName": "Kinghorn & French"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 6927.26, "details": [{"amount": 6927.26, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "MAC001", "customerName": "Macolm Hall Associates"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 69.12, "details": [{"amount": 69.12, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "1A2B3C", "customerName": "Maria Company"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 3597.16, "details": [{"amount": 3597.16, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "MIB001", "customerName": "Mikes Insurance Services"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 5644.12, "details": [{"amount": 6644.12, "name": "Invoices"}, {"amount": -1000, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "MIL001", "customerName": "Mile Road Health Centre"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 392.67, "details": [{"amount": 1767.67, "name": "Invoices"}, {"amount": -1375, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "MOR001", "customerName": "Morley Solicitors"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 915.24, "details": [{"amount": 915.24, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "PAT001", "customerName": "Patterson & Graham Garages"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -168, "details": [{"amount": -168, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2106.84, "details": [{"amount": 2106.84, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "YOU001", "customerName": "Peter Young"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 546.12, "details": [{"amount": 1413.9, "name": "Invoices"}, {"amount": -867.78, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "PIC001", "customerName": "Picture Frame Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -29210, "details": [{"amount": -29210, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 623907.28, "details": [{"amount": 624053.94, "name": "Invoices"}, {"amount": -146.66, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "JPY"}], "customerId": "RSP001", "customerName": "Richard Sanderson-Pope"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 4550.2, "details": [{"amount": 4550.2, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "ROB001", "customerName": "Robertson Joinery"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 15339.68, "details": [{"amount": 15339.68, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "SDE001", "customerName": "S D Enterprises"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1562.75, "details": [{"amount": 1562.75, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "STE001", "customerName": "Stevenson & Smith"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -16.68, "details": [{"amount": -16.68, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1615.51, "details": [{"amount": 1615.51, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "SWA001", "customerName": "Swan Leisure Centre"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -366.71, "details": [{"amount": -366.71, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 900.22, "details": [{"amount": 913.38, "name": "Invoices"}, {"amount": -13.16, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "customerId": "0001", "customerName": "Test Customer01"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 149.61, "details": [{"amount": 149.61, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "customerId": "TESTSUPP", "customerName": "Test supplier for testing purposes 1234567891234567891234567"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 7148.07, "details": [{"amount": 7148.07, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "SHO001", "customerName": "The Show Lodge"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2041.66, "details": [{"amount": 2041.66, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "VID001", "customerName": "The Video Rental Company"}], "generated": "2023-05-02T16:05:20.5553019Z", "reportDate": "2023-05-02T16:05:20.4958267Z"} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -5.37, "details": [{"amount": -5.37, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "A1D001", "customerName": "A1 Design Services"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2454.97, "details": [{"amount": 2454.97, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "ABS001", "customerName": "ABS Garages Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 4309.77, "details": [{"amount": 4309.77, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "BBS001", "customerName": "Bobs Building Supplies"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2066.61, "details": [{"amount": 2166.61, "name": "Invoices"}, {"amount": -100, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "BUS001", "customerName": "Business Exhibitions"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -0.01, "details": [{"amount": -0.01, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "CASH001", "customerName": "Cash and Credit Card Sales"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2749.02, "details": [{"amount": 2749.02, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "COM001", "customerName": "Compton Packaging"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2028.03, "details": [{"amount": 2028.03, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "CGS001", "customerName": "County Golf Supplies"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2341.25, "details": [{"amount": 2341.25, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "STU001", "customerName": "Edward Stuart"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 11256.18, "details": [{"amount": 11256.18, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "FGL001", "customerName": "F G Landscape & Design"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 4149.08, "details": [{"amount": 4149.08, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "GRA001", "customerName": "Graham Electonics"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1965.96, "details": [{"amount": 1965.96, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "HAU001", "customerName": "Hausser GMBH"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 977.09, "details": [{"amount": 977.09, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "JSS001", "customerName": "John Smith Studios"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 7398.33, "details": [{"amount": 7398.33, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "KIN001", "customerName": "Kinghorn & French"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 6916.46, "details": [{"amount": 6916.46, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "MAC001", "customerName": "Macolm Hall Associates"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 3525.26, "details": [{"amount": 3525.26, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "MIB001", "customerName": "Mikes Insurance Services"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2307.84, "details": [{"amount": 3307.84, "name": "Invoices"}, {"amount": -1000, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "MIL001", "customerName": "Mile Road Health Centre"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 370.27, "details": [{"amount": 1745.27, "name": "Invoices"}, {"amount": -1375, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "MOR001", "customerName": "Morley Solicitors"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 915.24, "details": [{"amount": 915.24, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "PAT001", "customerName": "Patterson & Graham Garages"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2115.77, "details": [{"amount": 2115.77, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "YOU001", "customerName": "Peter Young"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 268.93, "details": [{"amount": 1136.71, "name": "Invoices"}, {"amount": -867.78, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "PIC001", "customerName": "Picture Frame Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 4530.98, "details": [{"amount": 4530.98, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "ROB001", "customerName": "Robertson Joinery"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 15339.68, "details": [{"amount": 15339.68, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "SDE001", "customerName": "S D Enterprises"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 8.35, "details": [{"amount": 8.35, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "STE002", "customerName": "Steven Stephenson"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1562.75, "details": [{"amount": 1562.75, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "STE001", "customerName": "Stevenson & Smith"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -16.68, "details": [{"amount": -16.68, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1615.51, "details": [{"amount": 1615.51, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "SWA001", "customerName": "Swan Leisure Centre"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 7305.77, "details": [{"amount": 7305.77, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "SHO001", "customerName": "The Show Lodge"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2041.64, "details": [{"amount": 2041.64, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "VID001", "customerName": "The Video Rental Company"}], "generated": "2023-05-02T16:05:19.8072734Z", "reportDate": "2023-05-02T16:05:19.7472225Z"} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -60, "details": [{"amount": -60, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1471, "details": [{"amount": 1891, "name": "Invoices"}, {"amount": -420, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "260f6a3f94a243738f2d5e08496a41a8", "customerName": "100 test name"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1065, "details": [{"amount": 1080, "name": "Invoices"}, {"amount": -15, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "860dd9f1ad9346ba85117aedfa19cc72", "customerName": "100 test name DS"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -120, "details": [{"amount": -120, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2443.8, "details": [{"amount": 2759.8, "name": "Invoices"}, {"amount": -316, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "395d26ee8ab44f8b861b468caf63b00d", "customerName": "222 Abdul's Test Name"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -0.66, "details": [{"amount": 9.34, "name": "Invoices"}, {"amount": -10, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "013cf04960924a0da800f019369c3262", "customerName": "333 Abdul's Test Name"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -10, "details": [{"amount": -10, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 65, "details": [{"amount": 65, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "4ba77efb904e4380accc242b1526ac2c", "customerName": "333 Abdul's Test Name"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -2, "details": [{"amount": 48, "name": "Invoices"}, {"amount": -50, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "18e45991fe6440ad8e8b5ecf9a2e7e09", "customerName": "444 Abdul's Test Name"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -22, "details": [{"amount": -22, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -62, "details": [{"amount": 7, "name": "Invoices"}, {"amount": -69, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "23ca7ffaa2b54360937531dde804c9aa", "customerName": "aaa"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 288, "details": [{"amount": 288, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "2b93da6ce4af4dc99520eafd28768457", "customerName": "Abdul Al-haj"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 48, "details": [{"amount": 48, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "460af92dd82a4a61b6ce1d18245789b3", "customerName": "Abdul Al-haj"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -119.99, "details": [{"amount": -119.99, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "b8bd7e0dfdd64d39abaaf2dcd1c48b49", "customerName": "Abdul Al-haj"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -1562, "details": [{"amount": -1562, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1337, "details": [{"amount": 1362, "name": "Invoices"}, {"amount": -25, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "aa37b59417024d2494f01ba23d92a2ef", "customerName": "Abe The Engineer"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -844.99, "details": [{"amount": -844.99, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 616726.02, "details": [{"amount": 617888.74, "name": "Invoices"}, {"amount": -1162.72, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}], "customerId": "df65eaa6789111e8aaa5027d54329956", "customerName": "Baguettes Ltd"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1.2, "details": [{"amount": 1.2, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "2916114b3b6942a7b08f1bcc971f5bf9", "customerName": "c.taylor@codat.io"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -701, "details": [{"amount": -701, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "AUD"}], "customerId": "0556b365ef4e42068fff775f847c0330", "customerName": "Customer 71 (AUD)"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -10, "details": [{"amount": -10, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "145dee01b49c4359a052682f234007e3", "customerName": "Customer Name"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -10, "details": [{"amount": -10, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "76f656dfbafa4cec823f1e2e43ea1a8e", "customerName": "Customer Test 59"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 5279.2, "details": [{"amount": 5279.2, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "a11e6776ca9a4e16af3425982de25a22", "customerName": "Debs Customer"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 15111, "details": [{"amount": 15111, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "cc80e0fb747e4ddaab743d778d04ec4a", "customerName": "Debs US Customer"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 300, "details": [{"amount": 300, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "adb9cae8b34e446da3d53305b299168b", "customerName": "Fo Shizzle"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -1150, "details": [{"amount": 0, "name": "Invoices"}, {"amount": -1150, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "cc745370213545f6bd4129a7502f19fb", "customerName": "Grace Lo"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 12, "details": [{"amount": 12, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "3b17c5ae9caf4b88a4a9e33a83fa321d", "customerName": "Hello"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -52795, "details": [{"amount": -52795, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 134045, "details": [{"amount": 134045, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "979c5156ea0e45d9a9ea7b9d54775138", "customerName": "J Customer FR"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -265, "details": [{"amount": -265, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 15, "details": [{"amount": 30, "name": "Invoices"}, {"amount": -15, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "99d52ca7060341a698a664d1737663c5", "customerName": "J Customer UK"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -161570, "details": [{"amount": -161570, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 181372, "details": [{"amount": 181372, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "f40870d5b704407481be14f780122d4f", "customerName": "J Customer US"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -10, "details": [{"amount": -10, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "50a66e9756d2416d946419948bcf3631", "customerName": "J Customer ZA"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -719, "details": [{"amount": 178, "name": "Invoices"}, {"amount": -897, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "0328dd6b109a4a6cbcb3d1a73f1d541b", "customerName": "James Arroyo"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 25.01, "details": [{"amount": 25.01, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "customerId": "bca2a47d7b4549c79b0c092d26b6661c", "customerName": "Jay Farm"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -37.8, "details": [{"amount": -37.8, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 22.25, "details": [{"amount": 48, "name": "Invoices"}, {"amount": -25.75, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "6477be6d012b4d48b4c160c098645c1c", "customerName": "Jo's Bake Shop"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 396, "details": [{"amount": 396, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "097305a078ba473c884d2519ab290e57", "customerName": "John QuickEntry Test"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 200, "details": [{"amount": 200, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "eac978a7622e4ef8b8d3af661f0cfdd3", "customerName": "John Smith"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -1081.2, "details": [{"amount": -1081.2, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 3379, "details": [{"amount": 3479, "name": "Invoices"}, {"amount": -100, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "3cc3148bbd8111e8bad90617b3da4b8a", "customerName": "John's Test Customer"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 48, "details": [{"amount": 48, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "f66deccde15843ef80a82daad887146b", "customerName": "Kiran testing 2"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 900, "details": [{"amount": 900, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "6e921696a21a45c891ff4716a18e7649", "customerName": "M Smith"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 40, "details": [{"amount": 40, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "bbb0582a0d054f5db268e570b50b4d6c", "customerName": "Mark Smith"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -8159.78, "details": [{"amount": -8159.78, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 6016.67, "details": [{"amount": 6022.98, "name": "Invoices"}, {"amount": -6.31, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}], "customerId": "440ba2199c07426a93e8edc1beb09791", "customerName": "Matt Ager test EUR customer"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 240, "details": [{"amount": 240, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "d430ed86b05645d7af0a630dae5d11d2", "customerName": "Matthew Smith"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 300, "details": [{"amount": 300, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "9e8c3d82a2164ad29e29ab3a09ddf382", "customerName": "Morv Smith"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -384, "details": [{"amount": -384, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 398, "details": [{"amount": 398, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "fbdd38adb5b4441ebb200b83700d7ea5", "customerName": "My Shop Customer"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 90, "details": [{"amount": 90, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "4b4cc40d998f47c3bec92fc088dcf327", "customerName": "Nicoletta Carchia"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -48, "details": [{"amount": -48, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 48, "details": [{"amount": 48, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "ed070b1768bb4dd295e2a544a74c8ec0", "customerName": "Paige Burlingham"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -1085, "details": [{"amount": -1085, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "84709d3f01a4462eb7f1527718f525f4", "customerName": "SageOneCustomer.BusinessName"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -16.2, "details": [{"amount": -16.2, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1137.2, "details": [{"amount": 1137.2, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "90c438274d0b43759407da704394c104", "customerName": "Test Company"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -615, "details": [{"amount": -615, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2178.25, "details": [{"amount": 2178.25, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "762e6895c1ff43f988f35fb507e20dd9", "customerName": "Test Custiomer 2"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1200, "details": [{"amount": 1200, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "7b9c18af4b66454b9f7e9409eb7da123", "customerName": "Test Customer"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -50, "details": [{"amount": -50, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 499971, "details": [{"amount": 499971, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "customerId": "4ccf5c5fa14046ecb591e0620d87ea2e", "customerName": "Test Customer 3"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -23206.12, "details": [{"amount": -23206.12, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 733824.64, "details": [{"amount": 739536.49, "name": "Invoices"}, {"amount": -5711.85, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "f4ff85ba33dd11e797950a57719b2edb", "customerName": "Widgets Limited"}], "generated": "2023-05-02T16:05:20.9416221Z", "reportDate": "2023-05-02T16:05:20.7435694Z"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 180, "details": [{"amount": 180, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "USD"}], "customerId": "6", "customerName": "AG Insurance"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -150, "details": [{"amount": -150, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "531", "customerName": "Shoprite"}], "generated": "2023-05-02T16:05:22.6557479Z", "reportDate": "2023-05-02T16:05:22.6081858Z"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 914.55, "details": [{"amount": 914.55, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "305ca5cf-497d-4fee-a161-cdb30e6be989", "customerName": "Basket Case"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 3434, "details": [{"amount": 3434, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "362819c9-f285-4d09-ac95-26327863adac", "customerName": "Bayside Club"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1623.75, "details": [{"amount": 1623.75, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "9ce626d2-14ea-463c-9fff-6785ab5f9bfb", "customerName": "Boom FM"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 1169.95, "details": [{"amount": 1169.95, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "c523e12f-8b74-4d3a-bbd8-32d7a2f598b4", "customerName": "City Limousines"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 4470.63, "details": [{"amount": 4470.63, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "customerName": "DIISR - Small Business Services"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 396, "details": [{"amount": 396, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "94cb6d7b-5291-49f3-a0bc-fc0c01e68575", "customerName": "Marine Systems"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 2245, "details": [{"amount": 2245, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "847933f0-7c35-4e5b-b884-5f9df64c8e4b", "customerName": "Port & Philip Freight"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 6187.5, "details": [{"amount": 6187.5, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "a871a956-05b5-4e2a-9419-7aeb478ca647", "customerName": "Ridgeway University"}], "generated": "2023-05-02T16:05:20.0730291Z", "reportDate": "2023-05-02T16:05:20.0102278Z"} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "200": + application/json: {"data": [{"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -10567, "details": [{"amount": -10567, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 38965, "details": [{"amount": 39865, "name": "Invoices"}, {"amount": -900, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "104957000000054050", "customerName": "Doe, John"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -110, "details": [{"amount": -110, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}], "customerId": "104957000000634160", "customerName": "Dr. Jekyll"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": -68, "details": [{"amount": 0, "name": "Invoices"}, {"amount": -68, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "EUR"}], "customerId": "104957000000080010", "customerName": "Max Mustermann"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -10, "details": [{"amount": -10, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [{"amount": 0, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "104957000000277089", "customerName": "Miss. No Contact Persons"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -465, "details": [{"amount": -465, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 0, "details": [], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "104957000000054080", "customerName": "Ms. Jane Doe"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 9001, "details": [{"amount": 9001, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "104957000000277001", "customerName": "Sousa, Diogo"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": -9001, "details": [{"amount": -9001, "name": "CreditNotes"}], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 3556.98, "details": [{"amount": 4501, "name": "Invoices"}, {"amount": -944.02, "name": "Payments"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "104957000000037097", "customerName": "Test Company"}, {"agedCurrencyOutstanding": [{"agedOutstandingAmounts": [{"amount": 0, "details": [], "fromDate": "2023-04-02T00:00:00.0000000", "toDate": "2023-05-02T00:00:00.0000000"}, {"amount": 56, "details": [{"amount": 56, "name": "Invoices"}], "fromDate": "0001-01-01T00:00:00.0000000", "toDate": "2023-04-02T00:00:00.0000000"}], "currency": "GBP"}], "customerId": "104957000001497001", "customerName": "Will Westrop"}], "generated": "2023-05-02T16:05:23.2078272Z", "reportDate": "2023-05-02T16:05:23.1573589Z"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "2022-12-31" + numberOfPeriods: 12 + periodLengthDays: 30 + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + is-aged-creditors-report-available: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + is-aged-debtors-report-available: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + download-files: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + date: "2022-10-23T00:00:00Z" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + list-files: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + upload-files: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + create-bank-account: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"currency": "USD", "modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-create-update-bankAccounts-model: + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Needs to be of the format '{No.}-{Name}'", "field": "AccountName"}], "warnings": []}}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": true, "type": "String"}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": false, "type": "String"}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String", "validation": {"information": [{"details": "Bank Account Posting Group with Nominal Account must exist", "field": "NominalCode"}], "warnings": []}}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": false, "type": "String", "validation": {"information": [{"details": "Must have a length between 0 and 20 characters", "field": "SortCode"}], "warnings": []}}, "iBan": {"description": "The international bank account number of the account. Often used when making or receiving international payments", "displayName": "IBAN", "required": false, "type": "String"}, "overdraftLimit": {"description": "The pre-arranged overdraft limit of the account", "displayName": "Overdraft Limit", "required": false, "type": "Number", "validation": {"information": [{"details": "Default value is 0", "field": "OverdraftLimit"}], "warnings": []}}}, "required": true, "type": "Object"} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String"}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Should not exceed the maximum length of 14 characters if the specified currency is GBP.", "field": "AccountNumber"}]}}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be 6 characters long if the specified currency is GBP.", "field": "SortCode"}, {"details": "Must be provided if the specified currency is GBP.", "field": "SortCode"}]}}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": false, "type": "String"}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String"}}, "required": true, "type": "Object"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String"}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Should not exceed the maximum length of 14 characters if the specified currency is GBP.", "field": "AccountNumber"}]}}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be 6 characters long if the specified currency is GBP.", "field": "SortCode"}, {"details": "Must be provided if the specified currency is GBP.", "field": "SortCode"}]}}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": false, "type": "String"}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String"}}, "required": true, "type": "Object"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String"}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must have a length between 0 and 8 characters", "field": "SortCode"}]}}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": false, "type": "String"}, "iBan": {"description": "The international bank account number of the account. Often used when making or receiving international payments", "displayName": "IBAN", "required": false, "type": "String"}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "options": [{"displayName": "AED", "required": false, "type": "String", "value": "AED"}, {"displayName": "AMD", "required": false, "type": "String", "value": "AMD"}, {"displayName": "AOA", "required": false, "type": "String", "value": "AOA"}, {"displayName": "ARS", "required": false, "type": "String", "value": "ARS"}, {"displayName": "AUD", "required": false, "type": "String", "value": "AUD"}, {"displayName": "AWG", "required": false, "type": "String", "value": "AWG"}, {"displayName": "AZN", "required": false, "type": "String", "value": "AZN"}, {"displayName": "BBD", "required": false, "type": "String", "value": "BBD"}, {"displayName": "BDT", "required": false, "type": "String", "value": "BDT"}, {"displayName": "BGN", "required": false, "type": "String", "value": "BGN"}, {"displayName": "BRL", "required": false, "type": "String", "value": "BRL"}, {"displayName": "BWP", "required": false, "type": "String", "value": "BWP"}, {"displayName": "CAD", "required": false, "type": "String", "value": "CAD"}, {"displayName": "CHF", "required": false, "type": "String", "value": "CHF"}, {"displayName": "CLP", "required": false, "type": "String", "value": "CLP"}, {"displayName": "CNY", "required": false, "type": "String", "value": "CNY"}, {"displayName": "COP", "required": false, "type": "String", "value": "COP"}, {"displayName": "CRC", "required": false, "type": "String", "value": "CRC"}, {"displayName": "CUC", "required": false, "type": "String", "value": "CUC"}, {"displayName": "CUP", "required": false, "type": "String", "value": "CUP"}, {"displayName": "CZK", "required": false, "type": "String", "value": "CZK"}, {"displayName": "DKK", "required": false, "type": "String", "value": "DKK"}, {"displayName": "DOP", "required": false, "type": "String", "value": "DOP"}, {"displayName": "EGP", "required": false, "type": "String", "value": "EGP"}, {"displayName": "EUR", "required": false, "type": "String", "value": "EUR"}, {"displayName": "FJD", "required": false, "type": "String", "value": "FJD"}, {"displayName": "GBP", "required": false, "type": "String", "value": "GBP"}, {"displayName": "GEL", "required": false, "type": "String", "value": "GEL"}, {"displayName": "GHS", "required": false, "type": "String", "value": "GHS"}, {"displayName": "GTQ", "required": false, "type": "String", "value": "GTQ"}, {"displayName": "GYD", "required": false, "type": "String", "value": "GYD"}, {"displayName": "HKD", "required": false, "type": "String", "value": "HKD"}, {"displayName": "HNL", "required": false, "type": "String", "value": "HNL"}, {"displayName": "HRK", "required": false, "type": "String", "value": "HRK"}, {"displayName": "HUF", "required": false, "type": "String", "value": "HUF"}, {"displayName": "IDR", "required": false, "type": "String", "value": "IDR"}, {"displayName": "ILS", "required": false, "type": "String", "value": "ILS"}, {"displayName": "INR", "required": false, "type": "String", "value": "INR"}, {"displayName": "ISK", "required": false, "type": "String", "value": "ISK"}, {"displayName": "JMD", "required": false, "type": "String", "value": "JMD"}, {"displayName": "JPY", "required": false, "type": "String", "value": "JPY"}, {"displayName": "KES", "required": false, "type": "String", "value": "KES"}, {"displayName": "KRW", "required": false, "type": "String", "value": "KRW"}, {"displayName": "KWD", "required": false, "type": "String", "value": "KWD"}, {"displayName": "KYD", "required": false, "type": "String", "value": "KYD"}, {"displayName": "KZT", "required": false, "type": "String", "value": "KZT"}, {"displayName": "LAK", "required": false, "type": "String", "value": "LAK"}, {"displayName": "LBP", "required": false, "type": "String", "value": "LBP"}, {"displayName": "LKR", "required": false, "type": "String", "value": "LKR"}, {"displayName": "LTL", "required": false, "type": "String", "value": "LTL"}, {"displayName": "LVL", "required": false, "type": "String", "value": "LVL"}, {"displayName": "MAD", "required": false, "type": "String", "value": "MAD"}, {"displayName": "MDL", "required": false, "type": "String", "value": "MDL"}, {"displayName": "MGA", "required": false, "type": "String", "value": "MGA"}, {"displayName": "MUR", "required": false, "type": "String", "value": "MUR"}, {"displayName": "MVR", "required": false, "type": "String", "value": "MVR"}, {"displayName": "MWK", "required": false, "type": "String", "value": "MWK"}, {"displayName": "MXN", "required": false, "type": "String", "value": "MXN"}, {"displayName": "MYR", "required": false, "type": "String", "value": "MYR"}, {"displayName": "MZN", "required": false, "type": "String", "value": "MZN"}, {"displayName": "NAD", "required": false, "type": "String", "value": "NAD"}, {"displayName": "NGN", "required": false, "type": "String", "value": "NGN"}, {"displayName": "NOK", "required": false, "type": "String", "value": "NOK"}, {"displayName": "NPR", "required": false, "type": "String", "value": "NPR"}, {"displayName": "NZD", "required": false, "type": "String", "value": "NZD"}, {"displayName": "OMR", "required": false, "type": "String", "value": "OMR"}, {"displayName": "PEN", "required": false, "type": "String", "value": "PEN"}, {"displayName": "PHP", "required": false, "type": "String", "value": "PHP"}, {"displayName": "PKR", "required": false, "type": "String", "value": "PKR"}, {"displayName": "PLN", "required": false, "type": "String", "value": "PLN"}, {"displayName": "QAR", "required": false, "type": "String", "value": "QAR"}, {"displayName": "RON", "required": false, "type": "String", "value": "RON"}, {"displayName": "RSD", "required": false, "type": "String", "value": "RSD"}, {"displayName": "RUB", "required": false, "type": "String", "value": "RUB"}, {"displayName": "RWF", "required": false, "type": "String", "value": "RWF"}, {"displayName": "SAR", "required": false, "type": "String", "value": "SAR"}, {"displayName": "SCR", "required": false, "type": "String", "value": "SCR"}, {"displayName": "SEK", "required": false, "type": "String", "value": "SEK"}, {"displayName": "SGD", "required": false, "type": "String", "value": "SGD"}, {"displayName": "THB", "required": false, "type": "String", "value": "THB"}, {"displayName": "TND", "required": false, "type": "String", "value": "TND"}, {"displayName": "TRY", "required": false, "type": "String", "value": "TRY"}, {"displayName": "TTD", "required": false, "type": "String", "value": "TTD"}, {"displayName": "TWD", "required": false, "type": "String", "value": "TWD"}, {"displayName": "TZS", "required": false, "type": "String", "value": "TZS"}, {"displayName": "UAH", "required": false, "type": "String", "value": "UAH"}, {"displayName": "UGX", "required": false, "type": "String", "value": "UGX"}, {"displayName": "USD", "required": false, "type": "String", "value": "USD"}, {"displayName": "UYU", "required": false, "type": "String", "value": "UYU"}, {"displayName": "VEF", "required": false, "type": "String", "value": "VEF"}, {"displayName": "VND", "required": false, "type": "String", "value": "VND"}, {"displayName": "VUV", "required": false, "type": "String", "value": "VUV"}, {"displayName": "XAF", "required": false, "type": "String", "value": "XAF"}, {"displayName": "XCD", "required": false, "type": "String", "value": "XCD"}, {"displayName": "XOF", "required": false, "type": "String", "value": "XOF"}, {"displayName": "ZAR", "required": false, "type": "String", "value": "ZAR"}, {"displayName": "ZMK", "required": false, "type": "String", "value": "ZMK"}], "required": true, "type": "String"}, "balance": {"description": "The balance of the bank account", "displayName": "Balance", "required": false, "type": "Number", "validation": {"information": [{"details": "The opening balance, in the account currency", "field": "Balance"}], "warnings": []}}, "institution": {"description": "The institution of the bank account", "displayName": "Institution", "required": false, "type": "String"}}, "required": true, "type": "Object"} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "Name of the bank account as it appears in Kashflow.", "displayName": "Account Name", "required": true, "type": "String"}, "balance": {"description": "The opening balance, in the account currency.", "displayName": "Balance", "required": false, "type": "Number"}, "currency": {"description": "The currency of the bank account.", "displayName": "Currency", "required": true, "type": "String"}}, "required": true, "type": "Object"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 7 characters.", "field": "NominalCode"}]}}, "accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 31 characters.", "field": "AccountName"}]}}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If not set, will default to the base currency of the QuickBooks Desktop company", "field": "Currency"}], "warnings": [{"details": "The currency must match the base currency of the QuickBooks Desktop company unless the FullyQualifiedCategory is 'Asset.AccountsReceivable','Liability.AccountsPayable' or 'Liability.CreditCard'", "field": "Currency"}, {"details": "Must be a three letter ISO code that matches an existing active currency in the QuickBooks Desktop company", "field": "Currency"}, {"details": "Can only be set if the Quickbooks Desktop company has Multicurrency enabled.", "field": "Currency"}]}}, "balance": {"description": "The balance of the bank account", "displayName": "Balance", "required": false, "type": "Number"}}, "required": true, "type": "Object"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "Name of account as it appears in the chart of accounts or general ledger.", "displayName": "Account Name", "required": true, "type": "String"}, "accountNumber": {"description": "User-defined account number to help the user in identifying the account within the chart-of-accounts and in deciding what should be posted to the account.", "displayName": "Account Number", "required": true, "type": "String"}, "currency": {"description": "Currency of the bank account.", "displayName": "Currency", "required": true, "type": "String"}}, "required": true, "type": "Object"} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "AccountName"}, {"details": "Should not be longer than 50 characters.", "field": "AccountName"}], "warnings": []}}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Currency"}, {"details": "Must match the company's base currency.", "field": "Currency"}], "warnings": []}}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": false, "type": "String", "validation": {"information": [{"details": "Should be a 6 digit number.", "field": "SortCode"}], "warnings": []}}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": false, "type": "String", "validation": {"information": [{"details": "Should not be longer than 25 characters.", "field": "AccountNumber"}], "warnings": []}}, "iBan": {"description": "The international bank account number of the account. Often used when making or receiving international payments", "displayName": "IBAN", "required": false, "type": "String", "validation": {"information": [{"details": "Should be in the international bank account number format.", "field": "IBan"}], "warnings": []}}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String", "validation": {"information": [{"details": "Should be a number between 1 and 99999999.", "field": "NominalCode"}], "warnings": []}}}, "required": true, "type": "Object"} + Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String"}, "accountType": {"description": "The type of account", "displayName": "Account Type", "required": true, "type": "String"}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String"}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": true, "type": "String"}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": true, "type": "String"}, "iBan": {"description": "The international bank account number of the account. Often used when making or receiving international payments", "displayName": "IBAN", "required": true, "type": "String"}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": true, "type": "String"}, "balance": {"description": "The balance of the bank account", "displayName": "Balance", "required": true, "type": "Number"}, "availableBalance": {"description": "The available balance of the bank account", "displayName": "Available Balance", "required": true, "type": "Number"}, "overdraftLimit": {"description": "The pre-arranged overdraft limit of the account", "displayName": "Overdraft Limit", "required": true, "type": "Number"}, "institution": {"description": "The institution of the bank account", "displayName": "Institution", "required": true, "type": "String"}, "metadata": {"description": "Miscellaneous data about the item", "displayName": "Metadata", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-bank-transactions: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + query: {} + requestBody: + application/json: {"accountId": "7110701885", "transactions": []} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-create-bank-transactions-model: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-account: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"currency": "USD", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Current", "fullyQualifiedName": "Cash On Hand", "name": "Accounts Receivable", "nominalCode": "610", "status": "Active", "type": "Asset"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-create-chartOfAccounts-model: + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "NominalCode"}], "warnings": []}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Name"}], "warnings": []}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Asset.Assets.Cash", "required": false, "type": "String", "value": "Asset.Assets.Cash"}, {"displayName": "Asset.Assets.Bank", "required": false, "type": "String", "value": "Asset.Assets.Bank"}, {"displayName": "Asset.Assets.PaymentServices", "required": false, "type": "String", "value": "Asset.Assets.PaymentServices"}, {"displayName": "Asset.Assets.AccountsReceivable", "required": false, "type": "String", "value": "Asset.Assets.AccountsReceivable"}, {"displayName": "Liability.EquityAndLiabilities.AccountsPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.AccountsPayable"}, {"displayName": "Asset.Assets.VAT", "required": false, "type": "String", "value": "Asset.Assets.VAT"}, {"displayName": "Liability.EquityAndLiabilities.EmployeesPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.EmployeesPayable"}, {"displayName": "Asset.Assets.PrepaidExpenses", "required": false, "type": "String", "value": "Asset.Assets.PrepaidExpenses"}, {"displayName": "Liability.EquityAndLiabilities.AccruedExpenses", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.AccruedExpenses"}, {"displayName": "Liability.EquityAndLiabilities.IncomeTaxesPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.IncomeTaxesPayable"}, {"displayName": "Asset.Assets.FixedAssets", "required": false, "type": "String", "value": "Asset.Assets.FixedAssets"}, {"displayName": "Asset.Assets.OtherAssets", "required": false, "type": "String", "value": "Asset.Assets.OtherAssets"}, {"displayName": "Asset.Assets.AccumulatedDeprecation", "required": false, "type": "String", "value": "Asset.Assets.AccumulatedDeprecation"}, {"displayName": "Asset.Assets.Inventory", "required": false, "type": "String", "value": "Asset.Assets.Inventory"}, {"displayName": "Equity.EquityAndLiabilities.CapitalStock", "required": false, "type": "String", "value": "Equity.EquityAndLiabilities.CapitalStock"}, {"displayName": "Equity.EquityAndLiabilities.RetainedEarnings", "required": false, "type": "String", "value": "Equity.EquityAndLiabilities.RetainedEarnings"}, {"displayName": "Liability.EquityAndLiabilities.LongTermDebt", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.LongTermDebt"}, {"displayName": "Liability.EquityAndLiabilities.CurrentPortionOfDebt", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.CurrentPortionOfDebt"}, {"displayName": "Unknown.EquityAndLiabilities.Intercompany", "required": false, "type": "String", "value": "Unknown.EquityAndLiabilities.Intercompany"}, {"displayName": "Unknown.General.General", "required": false, "type": "String", "value": "Unknown.General.General"}, {"displayName": "Income.NetIncome.Revenue", "required": false, "type": "String", "value": "Income.NetIncome.Revenue"}, {"displayName": "Expense.NetIncome.CostOfGoods", "required": false, "type": "String", "value": "Expense.NetIncome.CostOfGoods"}, {"displayName": "Expense.NetIncome.OtherCosts", "required": false, "type": "String", "value": "Expense.NetIncome.OtherCosts"}, {"displayName": "Expense.NetIncome.SalesGeneralAdministrativeExpenses", "required": false, "type": "String", "value": "Expense.NetIncome.SalesGeneralAdministrativeExpenses"}, {"displayName": "Expense.NetIncome.DeprecationCosts", "required": false, "type": "String", "value": "Expense.NetIncome.DeprecationCosts"}, {"displayName": "Expense.NetIncome.ResearchAndDevelopment", "required": false, "type": "String", "value": "Expense.NetIncome.ResearchAndDevelopment"}, {"displayName": "Expense.NetIncome.EmployeeCosts", "required": false, "type": "String", "value": "Expense.NetIncome.EmployeeCosts"}, {"displayName": "Expense.NetIncome.EmploymentCosts", "required": false, "type": "String", "value": "Expense.NetIncome.EmploymentCosts"}, {"displayName": "Expense.ExceptionalIncome.ExceptionalCosts", "required": false, "type": "String", "value": "Expense.ExceptionalIncome.ExceptionalCosts"}, {"displayName": "Income.ExceptionalIncome.ExceptionalIncome", "required": false, "type": "String", "value": "Income.ExceptionalIncome.ExceptionalIncome"}, {"displayName": "Expense.ExceptionalIncome.IncomeTaxes", "required": false, "type": "String", "value": "Expense.ExceptionalIncome.IncomeTaxes"}, {"displayName": "Income.ExceptionalIncome.InterestIncome", "required": false, "type": "String", "value": "Income.ExceptionalIncome.InterestIncome"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "FullyQualifiedCategory"}], "warnings": []}}, "status": {"description": "The status of the account", "displayName": "Account Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Pending", "required": false, "type": "String", "value": "Pending"}, {"displayName": "Unknown", "required": false, "type": "String", "value": "Unknown"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Status"}], "warnings": []}}}, "required": true, "type": "Object"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "NominalCode"}], "warnings": []}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Name"}], "warnings": []}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Asset.Assets.Cash", "required": false, "type": "String", "value": "Asset.Assets.Cash"}, {"displayName": "Asset.Assets.Bank", "required": false, "type": "String", "value": "Asset.Assets.Bank"}, {"displayName": "Asset.Assets.PaymentServices", "required": false, "type": "String", "value": "Asset.Assets.PaymentServices"}, {"displayName": "Asset.Assets.AccountsReceivable", "required": false, "type": "String", "value": "Asset.Assets.AccountsReceivable"}, {"displayName": "Liability.EquityAndLiabilities.AccountsPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.AccountsPayable"}, {"displayName": "Asset.Assets.VAT", "required": false, "type": "String", "value": "Asset.Assets.VAT"}, {"displayName": "Liability.EquityAndLiabilities.EmployeesPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.EmployeesPayable"}, {"displayName": "Asset.Assets.PrepaidExpenses", "required": false, "type": "String", "value": "Asset.Assets.PrepaidExpenses"}, {"displayName": "Liability.EquityAndLiabilities.AccruedExpenses", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.AccruedExpenses"}, {"displayName": "Liability.EquityAndLiabilities.IncomeTaxesPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.IncomeTaxesPayable"}, {"displayName": "Asset.Assets.FixedAssets", "required": false, "type": "String", "value": "Asset.Assets.FixedAssets"}, {"displayName": "Asset.Assets.OtherAssets", "required": false, "type": "String", "value": "Asset.Assets.OtherAssets"}, {"displayName": "Asset.Assets.AccumulatedDeprecation", "required": false, "type": "String", "value": "Asset.Assets.AccumulatedDeprecation"}, {"displayName": "Asset.Assets.Inventory", "required": false, "type": "String", "value": "Asset.Assets.Inventory"}, {"displayName": "Equity.EquityAndLiabilities.CapitalStock", "required": false, "type": "String", "value": "Equity.EquityAndLiabilities.CapitalStock"}, {"displayName": "Equity.EquityAndLiabilities.RetainedEarnings", "required": false, "type": "String", "value": "Equity.EquityAndLiabilities.RetainedEarnings"}, {"displayName": "Liability.EquityAndLiabilities.LongTermDebt", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.LongTermDebt"}, {"displayName": "Liability.EquityAndLiabilities.CurrentPortionOfDebt", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.CurrentPortionOfDebt"}, {"displayName": "Unknown.EquityAndLiabilities.Intercompany", "required": false, "type": "String", "value": "Unknown.EquityAndLiabilities.Intercompany"}, {"displayName": "Unknown.General.General", "required": false, "type": "String", "value": "Unknown.General.General"}, {"displayName": "Income.NetIncome.Revenue", "required": false, "type": "String", "value": "Income.NetIncome.Revenue"}, {"displayName": "Expense.NetIncome.CostOfGoods", "required": false, "type": "String", "value": "Expense.NetIncome.CostOfGoods"}, {"displayName": "Expense.NetIncome.OtherCosts", "required": false, "type": "String", "value": "Expense.NetIncome.OtherCosts"}, {"displayName": "Expense.NetIncome.SalesGeneralAdministrativeExpenses", "required": false, "type": "String", "value": "Expense.NetIncome.SalesGeneralAdministrativeExpenses"}, {"displayName": "Expense.NetIncome.DeprecationCosts", "required": false, "type": "String", "value": "Expense.NetIncome.DeprecationCosts"}, {"displayName": "Expense.NetIncome.ResearchAndDevelopment", "required": false, "type": "String", "value": "Expense.NetIncome.ResearchAndDevelopment"}, {"displayName": "Expense.NetIncome.EmployeeCosts", "required": false, "type": "String", "value": "Expense.NetIncome.EmployeeCosts"}, {"displayName": "Expense.NetIncome.EmploymentCosts", "required": false, "type": "String", "value": "Expense.NetIncome.EmploymentCosts"}, {"displayName": "Expense.ExceptionalIncome.ExceptionalCosts", "required": false, "type": "String", "value": "Expense.ExceptionalIncome.ExceptionalCosts"}, {"displayName": "Income.ExceptionalIncome.ExceptionalIncome", "required": false, "type": "String", "value": "Income.ExceptionalIncome.ExceptionalIncome"}, {"displayName": "Expense.ExceptionalIncome.IncomeTaxes", "required": false, "type": "String", "value": "Expense.ExceptionalIncome.IncomeTaxes"}, {"displayName": "Income.ExceptionalIncome.InterestIncome", "required": false, "type": "String", "value": "Income.ExceptionalIncome.InterestIncome"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "FullyQualifiedCategory"}], "warnings": []}}, "status": {"description": "The status of the account", "displayName": "Account Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Pending", "required": false, "type": "String", "value": "Pending"}, {"displayName": "Unknown", "required": false, "type": "String", "value": "Unknown"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Status"}], "warnings": []}}}, "required": true, "type": "Object"} + MYOB AccountRight and Essentials: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "If alphanumeric is supported, must be between 1 and 10 characters. Otherwise format is x-xxxx", "field": "NominalCode"}]}}, "name": {"description": "Name of the account", "displayName": "Name", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must have a length between 1 and 60 characters", "field": "Name"}]}}, "description": {"description": "Description of the account", "displayName": "Description", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must have a length between 1 and 255 characters", "field": "Description"}]}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Bank", "required": false, "type": "String", "value": "Asset.Bank"}, {"displayName": "Accounts Receivable", "required": false, "type": "String", "value": "Asset.AccountReceivable"}, {"displayName": "Other Current Asset", "required": false, "type": "String", "value": "Asset.OtherCurrentAsset"}, {"displayName": "Fixed Asset", "required": false, "type": "String", "value": "Asset.FixedAsset"}, {"displayName": "Other Asset", "required": false, "type": "String", "value": "Asset.OtherAsset"}, {"displayName": "Cash", "required": false, "type": "String", "value": "Asset.CashAndBank"}, {"displayName": "Equipment Machinery", "required": false, "type": "String", "value": "Asset.Property Plant and Equipment"}, {"displayName": "Credit Card", "required": false, "type": "String", "value": "Liability.CreditCard"}, {"displayName": "Accounts Payable", "required": false, "type": "String", "value": "Liability.AccountsPayable"}, {"displayName": "Other Current Liability", "required": false, "type": "String", "value": "Liability.OtherCurrentLiability"}, {"displayName": "Long Term Liability", "required": false, "type": "String", "value": "Liability.LongTermLiability"}, {"displayName": "Other Liability", "required": false, "type": "String", "value": "Liability.OtherLiability"}, {"displayName": "Equity", "required": false, "type": "String", "value": "Equity"}, {"displayName": "Retained Earnings", "required": false, "type": "String", "value": "Equity.Equity"}, {"displayName": "Retained Earnings", "required": false, "type": "String", "value": "Equity.Equity.RetainedEarnings"}, {"displayName": "Retained Earnings", "required": false, "type": "String", "value": "Equity.Owner's Equity"}, {"displayName": "Income", "required": false, "type": "String", "value": "Income"}, {"displayName": "Other Income", "required": false, "type": "String", "value": "OtherIncome"}, {"displayName": "Expense", "required": false, "type": "String", "value": "Expense"}, {"displayName": "Sales Marketing", "required": false, "type": "String", "value": "Expense.Expense"}, {"displayName": "General Administrative", "required": false, "type": "String", "value": "Expense.Expense.Insurance"}, {"displayName": "General Administrative", "required": false, "type": "String", "value": "Expense.Overhead"}, {"displayName": "Repairs Maintenance", "required": false, "type": "String", "value": "Expense.Expense.RepairMaintenance"}, {"displayName": "Other Expense", "required": false, "type": "String", "value": "OtherExpense"}, {"displayName": "Cost of Sales", "required": false, "type": "String", "value": "CostOfSales"}, {"displayName": "Other", "required": false, "type": "String", "value": "Cost Of Goods Sold.Cost of Sales"}], "required": true, "type": "String"}, "status": {"description": "The status of the account", "displayName": "Account Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 7 characters.", "field": "NominalCode"}]}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 31 characters.", "field": "Name"}]}}, "description": {"description": "Description of the account", "displayName": "Description", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 200 characters.", "field": "Description"}]}}, "currency": {"description": "The currency of the account", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If not set, will default to the base currency of the QuickBooks Desktop company", "field": "Currency"}], "warnings": [{"details": "The currency must match the base currency of the QuickBooks Desktop company unless the FullyQualifiedCategory is 'Asset.AccountsReceivable','Liability.AccountsPayable' or 'Liability.CreditCard'", "field": "Currency"}, {"details": "Must be a three letter ISO code that matches an existing active currency in the QuickBooks Desktop company", "field": "Currency"}, {"details": "Can only be set if the Quickbooks Desktop company has Multicurrency enabled.", "field": "Currency"}]}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Account Receivable", "required": false, "type": "String", "value": "Asset.AccountsReceivable"}, {"displayName": "Fixed Asset", "required": false, "type": "String", "value": "Asset.FixedAsset"}, {"displayName": "Other Current Asset", "required": false, "type": "String", "value": "Asset.OtherCurrentAsset"}, {"displayName": "Other Asset", "required": false, "type": "String", "value": "Asset.OtherAsset"}, {"displayName": "Income", "required": false, "type": "String", "value": "Income.Income"}, {"displayName": "Other Income", "required": false, "type": "String", "value": "Income.OtherIncome"}, {"displayName": "Accounts Payable", "required": false, "type": "String", "value": "Liability.AccountsPayable"}, {"displayName": "Credit Card", "required": false, "type": "String", "value": "Liability.CreditCard"}, {"displayName": "Long Term Liability", "required": false, "type": "String", "value": "Liability.LongTermLiability"}, {"displayName": "Other Current Liability", "required": false, "type": "String", "value": "Liability.OtherCurrentLiability"}, {"displayName": "Cost Of Goods Sold", "required": false, "type": "String", "value": "Liability.CostOfGoodsSold"}, {"displayName": "Equity", "required": false, "type": "String", "value": "Equity.Equity"}, {"displayName": "Expense", "required": false, "type": "String", "value": "Expense.Expense"}, {"displayName": "Other Expense", "required": false, "type": "String", "value": "Expense.OtherExpense"}], "required": true, "type": "String"}, "currentBalance": {"description": "The current balance in the account", "displayName": "Current Balance", "required": false, "type": "Number"}}, "required": true, "type": "Object"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String", "validation": {"information": [{"details": "If included must have a length between 1 and 7 characters", "field": "NominalCode"}], "warnings": []}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must have a length between 1 and 100 characters", "field": "Name"}]}}, "currency": {"description": "The currency of the account", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "When not specified company base currency will be used", "field": "Currency"}], "warnings": []}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Cash On Hand", "required": false, "type": "String", "value": "Asset.Bank.CashOnHand"}, {"displayName": "Checking", "required": false, "type": "String", "value": "Asset.Bank.Checking"}, {"displayName": "Money Market", "required": false, "type": "String", "value": "Asset.Bank.MoneyMarket"}, {"displayName": "Rents Held In Trust", "required": false, "type": "String", "value": "Asset.Bank.RentsHeldInTrust"}, {"displayName": "Savings", "required": false, "type": "String", "value": "Asset.Bank.Savings"}, {"displayName": "Trust Accounts", "required": false, "type": "String", "value": "Asset.Bank.TrustAccounts"}, {"displayName": "Cash And Cash Equivalents", "required": false, "type": "String", "value": "Asset.Bank.CashAndCashEquivalents"}, {"displayName": "Other Earmarked Bank Accounts", "required": false, "type": "String", "value": "Asset.Bank.OtherEarmarkedBankAccounts"}, {"displayName": "Allowance For Bad Debts", "required": false, "type": "String", "value": "Asset.Other Current Asset.AllowanceForBadDebts"}, {"displayName": "Development Costs", "required": false, "type": "String", "value": "Asset.Other Current Asset.DevelopmentCosts"}, {"displayName": "Employee Cash Advances", "required": false, "type": "String", "value": "Asset.Other Current Asset.EmployeeCashAdvances"}, {"displayName": "Other Current Assets", "required": false, "type": "String", "value": "Asset.Other Current Asset.OtherCurrentAssets"}, {"displayName": "Inventory", "required": false, "type": "String", "value": "Asset.Other Current Asset.Inventory"}, {"displayName": "Investment Mortgage Real Estate Loans", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_MortgageRealEstateLoans"}, {"displayName": "Investment Other", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_Other"}, {"displayName": "Investment Tax Exempt Securities", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_TaxExemptSecurities"}, {"displayName": "Investment US Government Obligations", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_USGovernmentObligations"}, {"displayName": "Loans To Officers", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToOfficers"}, {"displayName": "Loans To Others", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToOthers"}, {"displayName": "Loans To Stockholders", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToStockholders"}, {"displayName": "Prepaid Expenses", "required": false, "type": "String", "value": "Asset.Other Current Asset.PrepaidExpenses"}, {"displayName": "Retainage", "required": false, "type": "String", "value": "Asset.Other Current Asset.Retainage"}, {"displayName": "Undeposited Funds", "required": false, "type": "String", "value": "Asset.Other Current Asset.UndepositedFunds"}, {"displayName": "Assets Available For Sale", "required": false, "type": "String", "value": "Asset.Other Current Asset.AssetsAvailableForSale"}, {"displayName": "Balance With Govt Authorities", "required": false, "type": "String", "value": "Asset.Other Current Asset.BalWithGovtAuthorities"}, {"displayName": "Called Up Share Capital Not Paid", "required": false, "type": "String", "value": "Asset.Other Current Asset.CalledUpShareCapitalNotPaid"}, {"displayName": "Expenditure Authorisations And Letters Of Credit", "required": false, "type": "String", "value": "Asset.Other Current Asset.ExpenditureAuthorisationsAndLettersOfCredit"}, {"displayName": "Global Tax Deferred", "required": false, "type": "String", "value": "Asset.Other Current Asset.GlobalTaxDeferred"}, {"displayName": "Global Tax Refund", "required": false, "type": "String", "value": "Asset.Other Current Asset.GlobalTaxRefund"}, {"displayName": "Internal Transfers", "required": false, "type": "String", "value": "Asset.Other Current Asset.InternalTransfers"}, {"displayName": "Other Consumables", "required": false, "type": "String", "value": "Asset.Other Current Asset.OtherConsumables"}, {"displayName": "Provisions Current Assets", "required": false, "type": "String", "value": "Asset.Other Current Asset.ProvisionsCurrentAssets"}, {"displayName": "Short Term Investments In Related Parties", "required": false, "type": "String", "value": "Asset.Other Current Asset.ShortTermInvestmentsInRelatedParties"}, {"displayName": "Short Term Loans And Advances To Related Parties", "required": false, "type": "String", "value": "Asset.Other Current Asset.ShortTermLoansAndAdvancesToRelatedParties"}, {"displayName": "Trade And Other Receivables", "required": false, "type": "String", "value": "Asset.Other Current Asset.TradeAndOtherReceivables"}, {"displayName": "Accumulated Depletion", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedDepletion"}, {"displayName": "Accumulated Depreciation", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedDepreciation"}, {"displayName": "Depletable Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.DepletableAssets"}, {"displayName": "Fixed Asset Computers", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetComputers"}, {"displayName": "Fixed Asset Copiers", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetCopiers"}, {"displayName": "Fixed Asset Furniture", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetFurniture"}, {"displayName": "Fixed Asset Phone", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetPhone"}, {"displayName": "Fixed Asset Photo Video", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetPhotoVideo"}, {"displayName": "Fixed Asset Software", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetSoftware"}, {"displayName": "Fixed Asset Other Tools Equipment", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetOtherToolsEquipment"}, {"displayName": "Furniture And Fixtures", "required": false, "type": "String", "value": "Asset.Fixed Asset.FurnitureAndFixtures"}, {"displayName": "Land", "required": false, "type": "String", "value": "Asset.Fixed Asset.Land"}, {"displayName": "Leasehold Improvements", "required": false, "type": "String", "value": "Asset.Fixed Asset.LeaseholdImprovements"}, {"displayName": "Other Fixed Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.OtherFixedAssets"}, {"displayName": "Accumulated Amortization", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedAmortization"}, {"displayName": "Buildings", "required": false, "type": "String", "value": "Asset.Fixed Asset.Buildings"}, {"displayName": "Intangible Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.IntangibleAssets"}, {"displayName": "Machinery And Equipment", "required": false, "type": "String", "value": "Asset.Fixed Asset.MachineryAndEquipment"}, {"displayName": "Vehicles", "required": false, "type": "String", "value": "Asset.Fixed Asset.Vehicles"}, {"displayName": "Assets In Course Of Construction", "required": false, "type": "String", "value": "Asset.Fixed Asset.AssetsInCourseOfConstruction"}, {"displayName": "Capital Wip", "required": false, "type": "String", "value": "Asset.Fixed Asset.CapitalWip"}, {"displayName": "Cumulative Depreciation On Intangible Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.CumulativeDepreciationOnIntangibleAssets"}, {"displayName": "Intangible Assets Under Development", "required": false, "type": "String", "value": "Asset.Fixed Asset.IntangibleAssetsUnderDevelopment"}, {"displayName": "Land Asset", "required": false, "type": "String", "value": "Asset.Fixed Asset.LandAsset"}, {"displayName": "Non Current Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.NonCurrentAssets"}, {"displayName": "Participating Interests", "required": false, "type": "String", "value": "Asset.Fixed Asset.ParticipatingInterests"}, {"displayName": "Provisions Fixed Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.ProvisionsFixedAssets"}, {"displayName": "Lease Buyout", "required": false, "type": "String", "value": "Asset.Other Asset.LeaseBuyout"}, {"displayName": "Other Long Term Assets", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermAssets"}, {"displayName": "Security Deposits", "required": false, "type": "String", "value": "Asset.Other Asset.SecurityDeposits"}, {"displayName": "Accumulated Amortization Of Other Assets", "required": false, "type": "String", "value": "Asset.Other Asset.AccumulatedAmortizationOfOtherAssets"}, {"displayName": "Goodwill", "required": false, "type": "String", "value": "Asset.Other Asset.Goodwill"}, {"displayName": "Licenses", "required": false, "type": "String", "value": "Asset.Other Asset.Licenses"}, {"displayName": "Organizational Costs", "required": false, "type": "String", "value": "Asset.Other Asset.OrganizationalCosts"}, {"displayName": "Assets Held For Sale", "required": false, "type": "String", "value": "Asset.Other Asset.AssetsHeldForSale"}, {"displayName": "Available For Sale Financial Assets", "required": false, "type": "String", "value": "Asset.Other Asset.AvailableForSaleFinancialAssets"}, {"displayName": "Deferred Tax", "required": false, "type": "String", "value": "Asset.Other Asset.DeferredTax"}, {"displayName": "Investments", "required": false, "type": "String", "value": "Asset.Other Asset.Investments"}, {"displayName": "Long Term Investments", "required": false, "type": "String", "value": "Asset.Other Asset.LongTermInvestments"}, {"displayName": "Long Term Loans And Advances To Related Parties", "required": false, "type": "String", "value": "Asset.Other Asset.LongTermLoansAndAdvancesToRelatedParties"}, {"displayName": "Other Intangible Assets", "required": false, "type": "String", "value": "Asset.Other Asset.OtherIntangibleAssets"}, {"displayName": "Other Long Term Investments", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermInvestments"}, {"displayName": "Other Long Term Loans And Advances", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermLoansAndAdvances"}, {"displayName": "Prepayments And Accrued Income", "required": false, "type": "String", "value": "Asset.Other Asset.PrepaymentsAndAccruedIncome"}, {"displayName": "Provisions Non-Current Assets", "required": false, "type": "String", "value": "Asset.Other Asset.ProvisionsNonCurrentAssets"}, {"displayName": "Accounts Receivable", "required": false, "type": "String", "value": "Asset.Accounts Receivable.AccountsReceivable"}, {"displayName": "Advertising/Promotional", "required": false, "type": "String", "value": "Expense.Expense.AdvertisingPromotional"}, {"displayName": "Bad Debts", "required": false, "type": "String", "value": "Expense.Expense.BadDebts"}, {"displayName": "Bank Charges", "required": false, "type": "String", "value": "Expense.Expense.BankCharges"}, {"displayName": "Charitable Contributions", "required": false, "type": "String", "value": "Expense.Expense.CharitableContributions"}, {"displayName": "Commissions And Fees", "required": false, "type": "String", "value": "Expense.Expense.CommissionsAndFees"}, {"displayName": "Entertainment", "required": false, "type": "String", "value": "Expense.Expense.Entertainment"}, {"displayName": "Entertainment Meals", "required": false, "type": "String", "value": "Expense.Expense.EntertainmentMeals"}, {"displayName": "Equipment Rental", "required": false, "type": "String", "value": "Expense.Expense.EquipmentRental"}, {"displayName": "Finance Costs", "required": false, "type": "String", "value": "Expense.Expense.FinanceCosts"}, {"displayName": "Global Tax Expense", "required": false, "type": "String", "value": "Expense.Expense.GlobalTaxExpense"}, {"displayName": "Insurance", "required": false, "type": "String", "value": "Expense.Expense.Insurance"}, {"displayName": "Interest Paid", "required": false, "type": "String", "value": "Expense.Expense.InterestPaid"}, {"displayName": "Legal And Professional Fees", "required": false, "type": "String", "value": "Expense.Expense.LegalProfessionalFees"}, {"displayName": "Office Expenses", "required": false, "type": "String", "value": "Expense.Expense.OfficeExpenses"}, {"displayName": "Office/General Administrative Expenses", "required": false, "type": "String", "value": "Expense.Expense.OfficeGeneralAdministrativeExpenses"}, {"displayName": "Other Business Expenses", "required": false, "type": "String", "value": "Expense.Expense.OtherBusinessExpenses"}, {"displayName": "Other Miscellaneous Service Cost", "required": false, "type": "String", "value": "Expense.Expense.OtherMiscellaneousServiceCost"}, {"displayName": "Promotional Meals", "required": false, "type": "String", "value": "Expense.Expense.PromotionalMeals"}, {"displayName": "Rent Or Lease Of Buildings", "required": false, "type": "String", "value": "Expense.Expense.RentOrLeaseOfBuildings"}, {"displayName": "Repair And Maintenance", "required": false, "type": "String", "value": "Expense.Expense.RepairMaintenance"}, {"displayName": "Shipping, Freight And Delivery", "required": false, "type": "String", "value": "Expense.Expense.ShippingFreightDelivery"}, {"displayName": "Supplies And Materials", "required": false, "type": "String", "value": "Expense.Expense.SuppliesMaterials"}, {"displayName": "Travel", "required": false, "type": "String", "value": "Expense.Expense.Travel"}, {"displayName": "Travel Meals", "required": false, "type": "String", "value": "Expense.Expense.TravelMeals"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Expense.Utilities"}, {"displayName": "Auto", "required": false, "type": "String", "value": "Expense.Expense.Auto"}, {"displayName": "Cost Of Labor", "required": false, "type": "String", "value": "Expense.Expense.CostOfLabor"}, {"displayName": "Dues And Subscriptions", "required": false, "type": "String", "value": "Expense.Expense.DuesSubscriptions"}, {"displayName": "Payroll Expenses", "required": false, "type": "String", "value": "Expense.Expense.PayrollExpenses"}, {"displayName": "Taxes Paid", "required": false, "type": "String", "value": "Expense.Expense.TaxesPaid"}, {"displayName": "Unapplied Cash Bill Payment Expense", "required": false, "type": "String", "value": "Expense.Expense.UnappliedCashBillPaymentExpense"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Expense.Utilities"}, {"displayName": "Amortization Expense", "required": false, "type": "String", "value": "Expense.Expense.AmortizationExpense"}, {"displayName": "Appropriations To Depreciation", "required": false, "type": "String", "value": "Expense.Expense.AppropriationsToDepreciation"}, {"displayName": "Borrowing Cost", "required": false, "type": "String", "value": "Expense.Expense.BorrowingCost"}, {"displayName": "Commissions And Fees", "required": false, "type": "String", "value": "Expense.Expense.CommissionsAndFees"}, {"displayName": "Distribution Costs", "required": false, "type": "String", "value": "Expense.Expense.DistributionCosts"}, {"displayName": "External Services", "required": false, "type": "String", "value": "Expense.Expense.ExternalServices"}, {"displayName": "Extraordinary Charges", "required": false, "type": "String", "value": "Expense.Expense.ExtraordinaryCharges"}, {"displayName": "Income Tax Expense", "required": false, "type": "String", "value": "Expense.Expense.IncomeTaxExpense"}, {"displayName": "Loss On Discontinued Operations Net Of Tax", "required": false, "type": "String", "value": "Expense.Expense.LossOnDiscontinuedOperationsNetOfTax"}, {"displayName": "Management Compensation", "required": false, "type": "String", "value": "Expense.Expense.ManagementCompensation"}, {"displayName": "Other Current Operating Charges", "required": false, "type": "String", "value": "Expense.Expense.OtherCurrentOperatingCharges"}, {"displayName": "Other External Services", "required": false, "type": "String", "value": "Expense.Expense.OtherExternalServices"}, {"displayName": "Other Rental Costs", "required": false, "type": "String", "value": "Expense.Expense.OtherRentalCosts"}, {"displayName": "Other Selling Expenses", "required": false, "type": "String", "value": "Expense.Expense.OtherSellingExpenses"}, {"displayName": "Project Studies Surveys Assessments", "required": false, "type": "String", "value": "Expense.Expense.ProjectStudiesSurveysAssessments"}, {"displayName": "Purchases Rebates", "required": false, "type": "String", "value": "Expense.Expense.PurchasesRebates"}, {"displayName": "Shipping And Delivery Expense", "required": false, "type": "String", "value": "Expense.Expense.ShippingAndDeliveryExpense"}, {"displayName": "Staff Costs", "required": false, "type": "String", "value": "Expense.Expense.StaffCosts"}, {"displayName": "Sundry", "required": false, "type": "String", "value": "Expense.Expense.Sundry"}, {"displayName": "Travel Expenses General And Admin Expenses", "required": false, "type": "String", "value": "Expense.Expense.TravelExpensesGeneralAndAdminExpenses"}, {"displayName": "Travel Expenses Selling Expense", "required": false, "type": "String", "value": "Expense.Expense.TravelExpensesSellingExpense"}, {"displayName": "Depreciation", "required": false, "type": "String", "value": "Expense.Other Expense.Depreciation"}, {"displayName": "Exchange Gain Or Loss", "required": false, "type": "String", "value": "Expense.Other Expense.ExchangeGainOrLoss"}, {"displayName": "Other Miscellaneous Expense", "required": false, "type": "String", "value": "Expense.Other Expense.OtherMiscellaneousExpense"}, {"displayName": "Penalties And Settlements", "required": false, "type": "String", "value": "Expense.Other Expense.PenaltiesSettlements"}, {"displayName": "Amortization", "required": false, "type": "String", "value": "Expense.Other Expense.Amortization"}, {"displayName": "Gas And Fuel", "required": false, "type": "String", "value": "Expense.Other Expense.GasAndFuel"}, {"displayName": "Home Office", "required": false, "type": "String", "value": "Expense.Other Expense.HomeOffice"}, {"displayName": "Home Owner Rental Insurance", "required": false, "type": "String", "value": "Expense.Other Expense.HomeOwnerRentalInsurance"}, {"displayName": "Other Home Office Expenses", "required": false, "type": "String", "value": "Expense.Other Expense.OtherHomeOfficeExpenses"}, {"displayName": "Mortgage Interest", "required": false, "type": "String", "value": "Expense.Other Expense.MortgageInterest"}, {"displayName": "Rent And Lease", "required": false, "type": "String", "value": "Expense.Other Expense.RentAndLease"}, {"displayName": "Repairs And Maintenance", "required": false, "type": "String", "value": "Expense.Other Expense.RepairsAndMaintenance"}, {"displayName": "Parking And Tolls", "required": false, "type": "String", "value": "Expense.Other Expense.ParkingAndTolls"}, {"displayName": "Vehicle", "required": false, "type": "String", "value": "Expense.Other Expense.Vehicle"}, {"displayName": "Vehicle Insurance", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleInsurance"}, {"displayName": "Vehicle Lease", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLease"}, {"displayName": "Vehicle Loan Interest", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLoanInterest"}, {"displayName": "Vehicle Loan", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLoan"}, {"displayName": "Vehicle Registration", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleRegistration"}, {"displayName": "Vehicle Repairs", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleRepairs"}, {"displayName": "Other Vehicle Expenses", "required": false, "type": "String", "value": "Expense.Other Expense.OtherVehicleExpenses"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Other Expense.Utilities"}, {"displayName": "Wash And Road Services", "required": false, "type": "String", "value": "Expense.Other Expense.WashAndRoadServices"}, {"displayName": "Deferred Tax Expense", "required": false, "type": "String", "value": "Expense.Other Expense.DeferredTaxExpense"}, {"displayName": "Depletion", "required": false, "type": "String", "value": "Expense.Other Expense.Depletion"}, {"displayName": "Exceptional Items", "required": false, "type": "String", "value": "Expense.Other Expense.ExceptionalItems"}, {"displayName": "Extraordinary Items", "required": false, "type": "String", "value": "Expense.Other Expense.ExtraordinaryItems"}, {"displayName": "Income Tax Other Expense", "required": false, "type": "String", "value": "Expense.Other Expense.IncomeTaxOtherExpense"}, {"displayName": "Mat Credit", "required": false, "type": "String", "value": "Expense.Other Expense.MatCredit"}, {"displayName": "Prior Period Items", "required": false, "type": "String", "value": "Expense.Other Expense.PriorPeriodItems"}, {"displayName": "Tax Roundoff Gain Or Loss", "required": false, "type": "String", "value": "Expense.Other Expense.TaxRoundoffGainOrLoss"}, {"displayName": "Equipment Rental - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.EquipmentRentalCos"}, {"displayName": "Other Costs Of Sales - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.OtherCostsOfServiceCos"}, {"displayName": "Shipping, Freight And Delivery - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.ShippingFreightDeliveryCos"}, {"displayName": "Supplies And Materials - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.SuppliesMaterialsCogs"}, {"displayName": "Cost Of Labor - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.CostOfLaborCos"}, {"displayName": "Cost Of Sales", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.CostOfSales"}, {"displayName": "Freight And Delivery Cost", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.FreightAndDeliveryCost"}, {"displayName": "Non Profit Income", "required": false, "type": "String", "value": "Income.Income.NonProfitIncome"}, {"displayName": "Other Primary Income", "required": false, "type": "String", "value": "Income.Income.OtherPrimaryIncome"}, {"displayName": "Sales Of ProductIncome", "required": false, "type": "String", "value": "Income.Income.SalesOfProductIncome"}, {"displayName": "Service Fee Income", "required": false, "type": "String", "value": "Income.Income.ServiceFeeIncome"}, {"displayName": "Discounts Refunds Given", "required": false, "type": "String", "value": "Income.Income.DiscountsRefundsGiven"}, {"displayName": "Unapplied Cash Payment Income", "required": false, "type": "String", "value": "Income.Income.UnappliedCashPaymentIncome"}, {"displayName": "Cash Receipt Income", "required": false, "type": "String", "value": "Income.Income.CashReceiptIncome"}, {"displayName": "Operating Grants", "required": false, "type": "String", "value": "Income.Income.OperatingGrants"}, {"displayName": "Other Current Operating Income", "required": false, "type": "String", "value": "Income.Income.OtherCurrentOperatingIncome"}, {"displayName": "Own Work Capitalized", "required": false, "type": "String", "value": "Income.Income.OwnWorkCapitalized"}, {"displayName": "Revenue General", "required": false, "type": "String", "value": "Income.Income.RevenueGeneral"}, {"displayName": "Sales Retail", "required": false, "type": "String", "value": "Income.Income.SalesRetail"}, {"displayName": "Sales Wholesale", "required": false, "type": "String", "value": "Income.Income.SalesWholesale"}, {"displayName": "Savings By Tax Scheme", "required": false, "type": "String", "value": "Income.Income.SavingsByTaxScheme"}, {"displayName": "Dividend Income", "required": false, "type": "String", "value": "Income.Other Income.DividendIncome"}, {"displayName": "Interest Earned", "required": false, "type": "String", "value": "Income.Other Income.InterestEarned"}, {"displayName": "Other Investment Income", "required": false, "type": "String", "value": "Income.Other Income.OtherInvestmentIncome"}, {"displayName": "Other Miscellaneous Income", "required": false, "type": "String", "value": "Income.Other Income.OtherMiscellaneousIncome"}, {"displayName": "Tax Exempt Interest", "required": false, "type": "String", "value": "Income.Other Income.TaxExemptInterest"}, {"displayName": "Gain Loss On Sale Of Fixed Assets", "required": false, "type": "String", "value": "Income.Other Income.GainLossOnSaleOfFixedAssets"}, {"displayName": "Gain Loss On Sale Of Investments", "required": false, "type": "String", "value": "Income.Other Income.GainLossOnSaleOfInvestments"}, {"displayName": "Loss On Disposal Of Assets", "required": false, "type": "String", "value": "Income.Other Income.LossOnDisposalOfAssets"}, {"displayName": "Other Operating Income", "required": false, "type": "String", "value": "Income.Other Income.OtherOperatingIncome"}, {"displayName": "Unrealised Loss On Securities Net Of Tax", "required": false, "type": "String", "value": "Income.Other Income.UnrealisedLossOnSecuritiesNetOfTax"}, {"displayName": "Accounts Payable", "required": false, "type": "String", "value": "Liability.Accounts Payable.AccountsPayable"}, {"displayName": "Outstanding Dues Micro Small Enterprise", "required": false, "type": "String", "value": "Liability.Accounts Payable.OutstandingDuesMicroSmallEnterprise"}, {"displayName": "Outstanding Dues Other Than Micro Small Enterprise", "required": false, "type": "String", "value": "Liability.Accounts Payable.OutstandingDuesOtherThanMicroSmallEnterprise"}, {"displayName": "Credit Card", "required": false, "type": "String", "value": "Liability.Credit Card.CreditCard"}, {"displayName": "Notes Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.NotesPayable"}, {"displayName": "Other Long Term Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.OtherLongTermLiabilities"}, {"displayName": "Shareholder Notes Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.ShareholderNotesPayable"}, {"displayName": "Accruals And Deferred Income", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccrualsAndDeferredIncome"}, {"displayName": "Accrued Long Lerm Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccruedLongLermLiabilities"}, {"displayName": "Accrued Vacation Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccruedVacationPayable"}, {"displayName": "Bank Loans", "required": false, "type": "String", "value": "Liability.Long Term Liability.BankLoans"}, {"displayName": "Debts Related To Participating Interests", "required": false, "type": "String", "value": "Liability.Long Term Liability.DebtsRelatedToParticipatingInterests"}, {"displayName": "Deferred Tax Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.DeferredTaxLiabilities"}, {"displayName": "Government And Other Public Authorities", "required": false, "type": "String", "value": "Liability.Long Term Liability.GovernmentAndOtherPublicAuthorities"}, {"displayName": "Group And Associates", "required": false, "type": "String", "value": "Liability.Long Term Liability.GroupAndAssociates"}, {"displayName": "Liabilities Related To Assets Held For Sale", "required": false, "type": "String", "value": "Liability.Long Term Liability.LiabilitiesRelatedToAssetsHeldForSale"}, {"displayName": "Long Term Borrowings", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermBorrowings"}, {"displayName": "Long Term Debit", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermDebit"}, {"displayName": "Long Term Employee Benefit Obligations", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermEmployeeBenefitObligations"}, {"displayName": "Obligations Under Finance Leases", "required": false, "type": "String", "value": "Liability.Long Term Liability.ObligationsUnderFinanceLeases"}, {"displayName": "Other Long Term Provisions", "required": false, "type": "String", "value": "Liability.Long Term Liability.OtherLongTermProvisions"}, {"displayName": "Provision For Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.ProvisionForLiabilities"}, {"displayName": "Provisions Non Current Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.ProvisionsNonCurrentLiabilities"}, {"displayName": "Staff And Related Long Term Liability Accounts", "required": false, "type": "String", "value": "Liability.Long Term Liability.StaffAndRelatedLongTermLiabilityAccounts"}, {"displayName": "Direct Deposit Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.DirectDepositPayable"}, {"displayName": "Line Of Credit", "required": false, "type": "String", "value": "Liability.Other Current Liability.LineOfCredit"}, {"displayName": "Loan Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.LoanPayable"}, {"displayName": "Global Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.GlobalTaxPayable"}, {"displayName": "Global Tax Suspense", "required": false, "type": "String", "value": "Liability.Other Current Liability.GlobalTaxSuspense"}, {"displayName": "Other Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.OtherCurrentLiabilities"}, {"displayName": "Payroll Clearing", "required": false, "type": "String", "value": "Liability.Other Current Liability.PayrollClearing"}, {"displayName": "Payroll Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.PayrollTaxPayable"}, {"displayName": "Prepaid Expenses Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.PrepaidExpensesPayable"}, {"displayName": "Rents In Trust Liability", "required": false, "type": "String", "value": "Liability.Other Current Liability.RentsInTrustLiability"}, {"displayName": "Trust Accounts Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.TrustAccountsLiabilities"}, {"displayName": "Federal Income Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.FederalIncomeTaxPayable"}, {"displayName": "Insurance Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.InsurancePayable"}, {"displayName": "Sales Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.SalesTaxPayable"}, {"displayName": "State Local Income Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.StateLocalIncomeTaxPayable"}, {"displayName": "Accrued Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.AccruedLiabilities"}, {"displayName": "Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentLiabilities"}, {"displayName": "Current Portion EmployeeBenefits Obligations", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentPortionEmployeeBenefitsObligations"}, {"displayName": "Current Portion Of Obligations Under Finance Leases", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentPortionOfObligationsUnderFinanceLeases"}, {"displayName": "Current Tax Liability", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentTaxLiability"}, {"displayName": "Dividends Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.DividendsPayable"}, {"displayName": "Duties And Taxes", "required": false, "type": "String", "value": "Liability.Other Current Liability.DutiesAndTaxes"}, {"displayName": "Interest Payables", "required": false, "type": "String", "value": "Liability.Other Current Liability.InterestPayables"}, {"displayName": "Provision For Warranty Obligations", "required": false, "type": "String", "value": "Liability.Other Current Liability.ProvisionForWarrantyObligations"}, {"displayName": "Provisions Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.ProvisionsCurrentLiabilities"}, {"displayName": "Short Term Borrowings", "required": false, "type": "String", "value": "Liability.Other Current Liability.ShortTermBorrowings"}, {"displayName": "Social Security Agencies", "required": false, "type": "String", "value": "Liability.Other Current Liability.SocialSecurityAgencies"}, {"displayName": "Staff And Related Liability Accounts", "required": false, "type": "String", "value": "Liability.Other Current Liability.StaffAndRelatedLiabilityAccounts"}, {"displayName": "Sundry Debtors And Creditors", "required": false, "type": "String", "value": "Liability.Other Current Liability.SundryDebtorsAndCreditors"}, {"displayName": "Trade And Other Payables", "required": false, "type": "String", "value": "Liability.Other Current Liability.TradeAndOtherPayables"}, {"displayName": "Opening Balance Equity", "required": false, "type": "String", "value": "Equity.Equity.OpeningBalanceEquity"}, {"displayName": "Partners Equity", "required": false, "type": "String", "value": "Equity.Equity.PartnersEquity"}, {"displayName": "Retained Earnings", "required": false, "type": "String", "value": "Equity.Equity.RetainedEarnings"}, {"displayName": "Accumulated Adjustment", "required": false, "type": "String", "value": "Equity.Equity.AccumulatedAdjustment"}, {"displayName": "Owners Equity", "required": false, "type": "String", "value": "Equity.Equity.OwnersEquity"}, {"displayName": "Paid In Capital Or Surplus", "required": false, "type": "String", "value": "Equity.Equity.PaidInCapitalOrSurplus"}, {"displayName": "Partner Contributions", "required": false, "type": "String", "value": "Equity.Equity.PartnerContributions"}, {"displayName": "Partner Distributions", "required": false, "type": "String", "value": "Equity.Equity.PartnerDistributions"}, {"displayName": "Preferred Stock", "required": false, "type": "String", "value": "Equity.Equity.PreferredStock"}, {"displayName": "Common Stock", "required": false, "type": "String", "value": "Equity.Equity.CommonStock"}, {"displayName": "Treasury Stock", "required": false, "type": "String", "value": "Equity.Equity.TreasuryStock"}, {"displayName": "Estimated Taxes", "required": false, "type": "String", "value": "Equity.Equity.EstimatedTaxes"}, {"displayName": "Healthcare", "required": false, "type": "String", "value": "Equity.Equity.Healthcare"}, {"displayName": "Personal Income", "required": false, "type": "String", "value": "Equity.Equity.PersonalIncome"}, {"displayName": "Personal Expense", "required": false, "type": "String", "value": "Equity.Equity.PersonalExpense"}, {"displayName": "Accumulated Other Comprehensive Income", "required": false, "type": "String", "value": "Equity.Equity.AccumulatedOtherComprehensiveIncome"}, {"displayName": "Called Up Share Capital", "required": false, "type": "String", "value": "Equity.Equity.CalledUpShareCapital"}, {"displayName": "Capital Reserves", "required": false, "type": "String", "value": "Equity.Equity.CapitalReserves"}, {"displayName": "Dividend Disbursed", "required": false, "type": "String", "value": "Equity.Equity.DividendDisbursed"}, {"displayName": "Equity In Earnings Of Subsiduaries", "required": false, "type": "String", "value": "Equity.Equity.EquityInEarningsOfSubsiduaries"}, {"displayName": "Investment Grants", "required": false, "type": "String", "value": "Equity.Equity.InvestmentGrants"}, {"displayName": "Money Received Against Share Warrants", "required": false, "type": "String", "value": "Equity.Equity.MoneyReceivedAgainstShareWarrants"}, {"displayName": "Other Free Reserves", "required": false, "type": "String", "value": "Equity.Equity.OtherFreeReserves"}, {"displayName": "Share Application Money Pending Allotment", "required": false, "type": "String", "value": "Equity.Equity.ShareApplicationMoneyPendingAllotment"}, {"displayName": "Share Capital", "required": false, "type": "String", "value": "Equity.Equity.ShareCapital"}, {"displayName": "Funds", "required": false, "type": "String", "value": "Equity.Equity.Funds"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String", "validation": {"information": [{"details": "If included must have a length between 1 and 7 characters", "field": "NominalCode"}], "warnings": []}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must have a length between 1 and 100 characters", "field": "Name"}]}}, "currency": {"description": "The currency of the account", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "When not specified company base currency will be used", "field": "Currency"}], "warnings": []}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Cash On Hand", "required": false, "type": "String", "value": "Asset.Bank.CashOnHand"}, {"displayName": "Checking", "required": false, "type": "String", "value": "Asset.Bank.Checking"}, {"displayName": "Money Market", "required": false, "type": "String", "value": "Asset.Bank.MoneyMarket"}, {"displayName": "Rents Held In Trust", "required": false, "type": "String", "value": "Asset.Bank.RentsHeldInTrust"}, {"displayName": "Savings", "required": false, "type": "String", "value": "Asset.Bank.Savings"}, {"displayName": "Trust Accounts", "required": false, "type": "String", "value": "Asset.Bank.TrustAccounts"}, {"displayName": "Cash And Cash Equivalents", "required": false, "type": "String", "value": "Asset.Bank.CashAndCashEquivalents"}, {"displayName": "Other Earmarked Bank Accounts", "required": false, "type": "String", "value": "Asset.Bank.OtherEarmarkedBankAccounts"}, {"displayName": "Allowance For Bad Debts", "required": false, "type": "String", "value": "Asset.Other Current Asset.AllowanceForBadDebts"}, {"displayName": "Development Costs", "required": false, "type": "String", "value": "Asset.Other Current Asset.DevelopmentCosts"}, {"displayName": "Employee Cash Advances", "required": false, "type": "String", "value": "Asset.Other Current Asset.EmployeeCashAdvances"}, {"displayName": "Other Current Assets", "required": false, "type": "String", "value": "Asset.Other Current Asset.OtherCurrentAssets"}, {"displayName": "Inventory", "required": false, "type": "String", "value": "Asset.Other Current Asset.Inventory"}, {"displayName": "Investment Mortgage Real Estate Loans", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_MortgageRealEstateLoans"}, {"displayName": "Investment Other", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_Other"}, {"displayName": "Investment Tax Exempt Securities", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_TaxExemptSecurities"}, {"displayName": "Investment US Government Obligations", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_USGovernmentObligations"}, {"displayName": "Loans To Officers", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToOfficers"}, {"displayName": "Loans To Others", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToOthers"}, {"displayName": "Loans To Stockholders", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToStockholders"}, {"displayName": "Prepaid Expenses", "required": false, "type": "String", "value": "Asset.Other Current Asset.PrepaidExpenses"}, {"displayName": "Retainage", "required": false, "type": "String", "value": "Asset.Other Current Asset.Retainage"}, {"displayName": "Undeposited Funds", "required": false, "type": "String", "value": "Asset.Other Current Asset.UndepositedFunds"}, {"displayName": "Assets Available For Sale", "required": false, "type": "String", "value": "Asset.Other Current Asset.AssetsAvailableForSale"}, {"displayName": "Balance With Govt Authorities", "required": false, "type": "String", "value": "Asset.Other Current Asset.BalWithGovtAuthorities"}, {"displayName": "Called Up Share Capital Not Paid", "required": false, "type": "String", "value": "Asset.Other Current Asset.CalledUpShareCapitalNotPaid"}, {"displayName": "Expenditure Authorisations And Letters Of Credit", "required": false, "type": "String", "value": "Asset.Other Current Asset.ExpenditureAuthorisationsAndLettersOfCredit"}, {"displayName": "Global Tax Deferred", "required": false, "type": "String", "value": "Asset.Other Current Asset.GlobalTaxDeferred"}, {"displayName": "Global Tax Refund", "required": false, "type": "String", "value": "Asset.Other Current Asset.GlobalTaxRefund"}, {"displayName": "Internal Transfers", "required": false, "type": "String", "value": "Asset.Other Current Asset.InternalTransfers"}, {"displayName": "Other Consumables", "required": false, "type": "String", "value": "Asset.Other Current Asset.OtherConsumables"}, {"displayName": "Provisions Current Assets", "required": false, "type": "String", "value": "Asset.Other Current Asset.ProvisionsCurrentAssets"}, {"displayName": "Short Term Investments In Related Parties", "required": false, "type": "String", "value": "Asset.Other Current Asset.ShortTermInvestmentsInRelatedParties"}, {"displayName": "Short Term Loans And Advances To Related Parties", "required": false, "type": "String", "value": "Asset.Other Current Asset.ShortTermLoansAndAdvancesToRelatedParties"}, {"displayName": "Trade And Other Receivables", "required": false, "type": "String", "value": "Asset.Other Current Asset.TradeAndOtherReceivables"}, {"displayName": "Accumulated Depletion", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedDepletion"}, {"displayName": "Accumulated Depreciation", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedDepreciation"}, {"displayName": "Depletable Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.DepletableAssets"}, {"displayName": "Fixed Asset Computers", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetComputers"}, {"displayName": "Fixed Asset Copiers", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetCopiers"}, {"displayName": "Fixed Asset Furniture", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetFurniture"}, {"displayName": "Fixed Asset Phone", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetPhone"}, {"displayName": "Fixed Asset Photo Video", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetPhotoVideo"}, {"displayName": "Fixed Asset Software", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetSoftware"}, {"displayName": "Fixed Asset Other Tools Equipment", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetOtherToolsEquipment"}, {"displayName": "Furniture And Fixtures", "required": false, "type": "String", "value": "Asset.Fixed Asset.FurnitureAndFixtures"}, {"displayName": "Land", "required": false, "type": "String", "value": "Asset.Fixed Asset.Land"}, {"displayName": "Leasehold Improvements", "required": false, "type": "String", "value": "Asset.Fixed Asset.LeaseholdImprovements"}, {"displayName": "Other Fixed Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.OtherFixedAssets"}, {"displayName": "Accumulated Amortization", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedAmortization"}, {"displayName": "Buildings", "required": false, "type": "String", "value": "Asset.Fixed Asset.Buildings"}, {"displayName": "Intangible Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.IntangibleAssets"}, {"displayName": "Machinery And Equipment", "required": false, "type": "String", "value": "Asset.Fixed Asset.MachineryAndEquipment"}, {"displayName": "Vehicles", "required": false, "type": "String", "value": "Asset.Fixed Asset.Vehicles"}, {"displayName": "Assets In Course Of Construction", "required": false, "type": "String", "value": "Asset.Fixed Asset.AssetsInCourseOfConstruction"}, {"displayName": "Capital Wip", "required": false, "type": "String", "value": "Asset.Fixed Asset.CapitalWip"}, {"displayName": "Cumulative Depreciation On Intangible Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.CumulativeDepreciationOnIntangibleAssets"}, {"displayName": "Intangible Assets Under Development", "required": false, "type": "String", "value": "Asset.Fixed Asset.IntangibleAssetsUnderDevelopment"}, {"displayName": "Land Asset", "required": false, "type": "String", "value": "Asset.Fixed Asset.LandAsset"}, {"displayName": "Non Current Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.NonCurrentAssets"}, {"displayName": "Participating Interests", "required": false, "type": "String", "value": "Asset.Fixed Asset.ParticipatingInterests"}, {"displayName": "Provisions Fixed Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.ProvisionsFixedAssets"}, {"displayName": "Lease Buyout", "required": false, "type": "String", "value": "Asset.Other Asset.LeaseBuyout"}, {"displayName": "Other Long Term Assets", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermAssets"}, {"displayName": "Security Deposits", "required": false, "type": "String", "value": "Asset.Other Asset.SecurityDeposits"}, {"displayName": "Accumulated Amortization Of Other Assets", "required": false, "type": "String", "value": "Asset.Other Asset.AccumulatedAmortizationOfOtherAssets"}, {"displayName": "Goodwill", "required": false, "type": "String", "value": "Asset.Other Asset.Goodwill"}, {"displayName": "Licenses", "required": false, "type": "String", "value": "Asset.Other Asset.Licenses"}, {"displayName": "Organizational Costs", "required": false, "type": "String", "value": "Asset.Other Asset.OrganizationalCosts"}, {"displayName": "Assets Held For Sale", "required": false, "type": "String", "value": "Asset.Other Asset.AssetsHeldForSale"}, {"displayName": "Available For Sale Financial Assets", "required": false, "type": "String", "value": "Asset.Other Asset.AvailableForSaleFinancialAssets"}, {"displayName": "Deferred Tax", "required": false, "type": "String", "value": "Asset.Other Asset.DeferredTax"}, {"displayName": "Investments", "required": false, "type": "String", "value": "Asset.Other Asset.Investments"}, {"displayName": "Long Term Investments", "required": false, "type": "String", "value": "Asset.Other Asset.LongTermInvestments"}, {"displayName": "Long Term Loans And Advances To Related Parties", "required": false, "type": "String", "value": "Asset.Other Asset.LongTermLoansAndAdvancesToRelatedParties"}, {"displayName": "Other Intangible Assets", "required": false, "type": "String", "value": "Asset.Other Asset.OtherIntangibleAssets"}, {"displayName": "Other Long Term Investments", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermInvestments"}, {"displayName": "Other Long Term Loans And Advances", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermLoansAndAdvances"}, {"displayName": "Prepayments And Accrued Income", "required": false, "type": "String", "value": "Asset.Other Asset.PrepaymentsAndAccruedIncome"}, {"displayName": "Provisions Non-Current Assets", "required": false, "type": "String", "value": "Asset.Other Asset.ProvisionsNonCurrentAssets"}, {"displayName": "Accounts Receivable", "required": false, "type": "String", "value": "Asset.Accounts Receivable.AccountsReceivable"}, {"displayName": "Advertising/Promotional", "required": false, "type": "String", "value": "Expense.Expense.AdvertisingPromotional"}, {"displayName": "Bad Debts", "required": false, "type": "String", "value": "Expense.Expense.BadDebts"}, {"displayName": "Bank Charges", "required": false, "type": "String", "value": "Expense.Expense.BankCharges"}, {"displayName": "Charitable Contributions", "required": false, "type": "String", "value": "Expense.Expense.CharitableContributions"}, {"displayName": "Commissions And Fees", "required": false, "type": "String", "value": "Expense.Expense.CommissionsAndFees"}, {"displayName": "Entertainment", "required": false, "type": "String", "value": "Expense.Expense.Entertainment"}, {"displayName": "Entertainment Meals", "required": false, "type": "String", "value": "Expense.Expense.EntertainmentMeals"}, {"displayName": "Equipment Rental", "required": false, "type": "String", "value": "Expense.Expense.EquipmentRental"}, {"displayName": "Finance Costs", "required": false, "type": "String", "value": "Expense.Expense.FinanceCosts"}, {"displayName": "Global Tax Expense", "required": false, "type": "String", "value": "Expense.Expense.GlobalTaxExpense"}, {"displayName": "Insurance", "required": false, "type": "String", "value": "Expense.Expense.Insurance"}, {"displayName": "Interest Paid", "required": false, "type": "String", "value": "Expense.Expense.InterestPaid"}, {"displayName": "Legal And Professional Fees", "required": false, "type": "String", "value": "Expense.Expense.LegalProfessionalFees"}, {"displayName": "Office Expenses", "required": false, "type": "String", "value": "Expense.Expense.OfficeExpenses"}, {"displayName": "Office/General Administrative Expenses", "required": false, "type": "String", "value": "Expense.Expense.OfficeGeneralAdministrativeExpenses"}, {"displayName": "Other Business Expenses", "required": false, "type": "String", "value": "Expense.Expense.OtherBusinessExpenses"}, {"displayName": "Other Miscellaneous Service Cost", "required": false, "type": "String", "value": "Expense.Expense.OtherMiscellaneousServiceCost"}, {"displayName": "Promotional Meals", "required": false, "type": "String", "value": "Expense.Expense.PromotionalMeals"}, {"displayName": "Rent Or Lease Of Buildings", "required": false, "type": "String", "value": "Expense.Expense.RentOrLeaseOfBuildings"}, {"displayName": "Repair And Maintenance", "required": false, "type": "String", "value": "Expense.Expense.RepairMaintenance"}, {"displayName": "Shipping, Freight And Delivery", "required": false, "type": "String", "value": "Expense.Expense.ShippingFreightDelivery"}, {"displayName": "Supplies And Materials", "required": false, "type": "String", "value": "Expense.Expense.SuppliesMaterials"}, {"displayName": "Travel", "required": false, "type": "String", "value": "Expense.Expense.Travel"}, {"displayName": "Travel Meals", "required": false, "type": "String", "value": "Expense.Expense.TravelMeals"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Expense.Utilities"}, {"displayName": "Auto", "required": false, "type": "String", "value": "Expense.Expense.Auto"}, {"displayName": "Cost Of Labor", "required": false, "type": "String", "value": "Expense.Expense.CostOfLabor"}, {"displayName": "Dues And Subscriptions", "required": false, "type": "String", "value": "Expense.Expense.DuesSubscriptions"}, {"displayName": "Payroll Expenses", "required": false, "type": "String", "value": "Expense.Expense.PayrollExpenses"}, {"displayName": "Taxes Paid", "required": false, "type": "String", "value": "Expense.Expense.TaxesPaid"}, {"displayName": "Unapplied Cash Bill Payment Expense", "required": false, "type": "String", "value": "Expense.Expense.UnappliedCashBillPaymentExpense"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Expense.Utilities"}, {"displayName": "Amortization Expense", "required": false, "type": "String", "value": "Expense.Expense.AmortizationExpense"}, {"displayName": "Appropriations To Depreciation", "required": false, "type": "String", "value": "Expense.Expense.AppropriationsToDepreciation"}, {"displayName": "Borrowing Cost", "required": false, "type": "String", "value": "Expense.Expense.BorrowingCost"}, {"displayName": "Commissions And Fees", "required": false, "type": "String", "value": "Expense.Expense.CommissionsAndFees"}, {"displayName": "Distribution Costs", "required": false, "type": "String", "value": "Expense.Expense.DistributionCosts"}, {"displayName": "External Services", "required": false, "type": "String", "value": "Expense.Expense.ExternalServices"}, {"displayName": "Extraordinary Charges", "required": false, "type": "String", "value": "Expense.Expense.ExtraordinaryCharges"}, {"displayName": "Income Tax Expense", "required": false, "type": "String", "value": "Expense.Expense.IncomeTaxExpense"}, {"displayName": "Loss On Discontinued Operations Net Of Tax", "required": false, "type": "String", "value": "Expense.Expense.LossOnDiscontinuedOperationsNetOfTax"}, {"displayName": "Management Compensation", "required": false, "type": "String", "value": "Expense.Expense.ManagementCompensation"}, {"displayName": "Other Current Operating Charges", "required": false, "type": "String", "value": "Expense.Expense.OtherCurrentOperatingCharges"}, {"displayName": "Other External Services", "required": false, "type": "String", "value": "Expense.Expense.OtherExternalServices"}, {"displayName": "Other Rental Costs", "required": false, "type": "String", "value": "Expense.Expense.OtherRentalCosts"}, {"displayName": "Other Selling Expenses", "required": false, "type": "String", "value": "Expense.Expense.OtherSellingExpenses"}, {"displayName": "Project Studies Surveys Assessments", "required": false, "type": "String", "value": "Expense.Expense.ProjectStudiesSurveysAssessments"}, {"displayName": "Purchases Rebates", "required": false, "type": "String", "value": "Expense.Expense.PurchasesRebates"}, {"displayName": "Shipping And Delivery Expense", "required": false, "type": "String", "value": "Expense.Expense.ShippingAndDeliveryExpense"}, {"displayName": "Staff Costs", "required": false, "type": "String", "value": "Expense.Expense.StaffCosts"}, {"displayName": "Sundry", "required": false, "type": "String", "value": "Expense.Expense.Sundry"}, {"displayName": "Travel Expenses General And Admin Expenses", "required": false, "type": "String", "value": "Expense.Expense.TravelExpensesGeneralAndAdminExpenses"}, {"displayName": "Travel Expenses Selling Expense", "required": false, "type": "String", "value": "Expense.Expense.TravelExpensesSellingExpense"}, {"displayName": "Depreciation", "required": false, "type": "String", "value": "Expense.Other Expense.Depreciation"}, {"displayName": "Exchange Gain Or Loss", "required": false, "type": "String", "value": "Expense.Other Expense.ExchangeGainOrLoss"}, {"displayName": "Other Miscellaneous Expense", "required": false, "type": "String", "value": "Expense.Other Expense.OtherMiscellaneousExpense"}, {"displayName": "Penalties And Settlements", "required": false, "type": "String", "value": "Expense.Other Expense.PenaltiesSettlements"}, {"displayName": "Amortization", "required": false, "type": "String", "value": "Expense.Other Expense.Amortization"}, {"displayName": "Gas And Fuel", "required": false, "type": "String", "value": "Expense.Other Expense.GasAndFuel"}, {"displayName": "Home Office", "required": false, "type": "String", "value": "Expense.Other Expense.HomeOffice"}, {"displayName": "Home Owner Rental Insurance", "required": false, "type": "String", "value": "Expense.Other Expense.HomeOwnerRentalInsurance"}, {"displayName": "Other Home Office Expenses", "required": false, "type": "String", "value": "Expense.Other Expense.OtherHomeOfficeExpenses"}, {"displayName": "Mortgage Interest", "required": false, "type": "String", "value": "Expense.Other Expense.MortgageInterest"}, {"displayName": "Rent And Lease", "required": false, "type": "String", "value": "Expense.Other Expense.RentAndLease"}, {"displayName": "Repairs And Maintenance", "required": false, "type": "String", "value": "Expense.Other Expense.RepairsAndMaintenance"}, {"displayName": "Parking And Tolls", "required": false, "type": "String", "value": "Expense.Other Expense.ParkingAndTolls"}, {"displayName": "Vehicle", "required": false, "type": "String", "value": "Expense.Other Expense.Vehicle"}, {"displayName": "Vehicle Insurance", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleInsurance"}, {"displayName": "Vehicle Lease", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLease"}, {"displayName": "Vehicle Loan Interest", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLoanInterest"}, {"displayName": "Vehicle Loan", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLoan"}, {"displayName": "Vehicle Registration", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleRegistration"}, {"displayName": "Vehicle Repairs", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleRepairs"}, {"displayName": "Other Vehicle Expenses", "required": false, "type": "String", "value": "Expense.Other Expense.OtherVehicleExpenses"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Other Expense.Utilities"}, {"displayName": "Wash And Road Services", "required": false, "type": "String", "value": "Expense.Other Expense.WashAndRoadServices"}, {"displayName": "Deferred Tax Expense", "required": false, "type": "String", "value": "Expense.Other Expense.DeferredTaxExpense"}, {"displayName": "Depletion", "required": false, "type": "String", "value": "Expense.Other Expense.Depletion"}, {"displayName": "Exceptional Items", "required": false, "type": "String", "value": "Expense.Other Expense.ExceptionalItems"}, {"displayName": "Extraordinary Items", "required": false, "type": "String", "value": "Expense.Other Expense.ExtraordinaryItems"}, {"displayName": "Income Tax Other Expense", "required": false, "type": "String", "value": "Expense.Other Expense.IncomeTaxOtherExpense"}, {"displayName": "Mat Credit", "required": false, "type": "String", "value": "Expense.Other Expense.MatCredit"}, {"displayName": "Prior Period Items", "required": false, "type": "String", "value": "Expense.Other Expense.PriorPeriodItems"}, {"displayName": "Tax Roundoff Gain Or Loss", "required": false, "type": "String", "value": "Expense.Other Expense.TaxRoundoffGainOrLoss"}, {"displayName": "Equipment Rental - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.EquipmentRentalCos"}, {"displayName": "Other Costs Of Sales - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.OtherCostsOfServiceCos"}, {"displayName": "Shipping, Freight And Delivery - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.ShippingFreightDeliveryCos"}, {"displayName": "Supplies And Materials - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.SuppliesMaterialsCogs"}, {"displayName": "Cost Of Labor - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.CostOfLaborCos"}, {"displayName": "Cost Of Sales", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.CostOfSales"}, {"displayName": "Freight And Delivery Cost", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.FreightAndDeliveryCost"}, {"displayName": "Non Profit Income", "required": false, "type": "String", "value": "Income.Income.NonProfitIncome"}, {"displayName": "Other Primary Income", "required": false, "type": "String", "value": "Income.Income.OtherPrimaryIncome"}, {"displayName": "Sales Of ProductIncome", "required": false, "type": "String", "value": "Income.Income.SalesOfProductIncome"}, {"displayName": "Service Fee Income", "required": false, "type": "String", "value": "Income.Income.ServiceFeeIncome"}, {"displayName": "Discounts Refunds Given", "required": false, "type": "String", "value": "Income.Income.DiscountsRefundsGiven"}, {"displayName": "Unapplied Cash Payment Income", "required": false, "type": "String", "value": "Income.Income.UnappliedCashPaymentIncome"}, {"displayName": "Cash Receipt Income", "required": false, "type": "String", "value": "Income.Income.CashReceiptIncome"}, {"displayName": "Operating Grants", "required": false, "type": "String", "value": "Income.Income.OperatingGrants"}, {"displayName": "Other Current Operating Income", "required": false, "type": "String", "value": "Income.Income.OtherCurrentOperatingIncome"}, {"displayName": "Own Work Capitalized", "required": false, "type": "String", "value": "Income.Income.OwnWorkCapitalized"}, {"displayName": "Revenue General", "required": false, "type": "String", "value": "Income.Income.RevenueGeneral"}, {"displayName": "Sales Retail", "required": false, "type": "String", "value": "Income.Income.SalesRetail"}, {"displayName": "Sales Wholesale", "required": false, "type": "String", "value": "Income.Income.SalesWholesale"}, {"displayName": "Savings By Tax Scheme", "required": false, "type": "String", "value": "Income.Income.SavingsByTaxScheme"}, {"displayName": "Dividend Income", "required": false, "type": "String", "value": "Income.Other Income.DividendIncome"}, {"displayName": "Interest Earned", "required": false, "type": "String", "value": "Income.Other Income.InterestEarned"}, {"displayName": "Other Investment Income", "required": false, "type": "String", "value": "Income.Other Income.OtherInvestmentIncome"}, {"displayName": "Other Miscellaneous Income", "required": false, "type": "String", "value": "Income.Other Income.OtherMiscellaneousIncome"}, {"displayName": "Tax Exempt Interest", "required": false, "type": "String", "value": "Income.Other Income.TaxExemptInterest"}, {"displayName": "Gain Loss On Sale Of Fixed Assets", "required": false, "type": "String", "value": "Income.Other Income.GainLossOnSaleOfFixedAssets"}, {"displayName": "Gain Loss On Sale Of Investments", "required": false, "type": "String", "value": "Income.Other Income.GainLossOnSaleOfInvestments"}, {"displayName": "Loss On Disposal Of Assets", "required": false, "type": "String", "value": "Income.Other Income.LossOnDisposalOfAssets"}, {"displayName": "Other Operating Income", "required": false, "type": "String", "value": "Income.Other Income.OtherOperatingIncome"}, {"displayName": "Unrealised Loss On Securities Net Of Tax", "required": false, "type": "String", "value": "Income.Other Income.UnrealisedLossOnSecuritiesNetOfTax"}, {"displayName": "Accounts Payable", "required": false, "type": "String", "value": "Liability.Accounts Payable.AccountsPayable"}, {"displayName": "Outstanding Dues Micro Small Enterprise", "required": false, "type": "String", "value": "Liability.Accounts Payable.OutstandingDuesMicroSmallEnterprise"}, {"displayName": "Outstanding Dues Other Than Micro Small Enterprise", "required": false, "type": "String", "value": "Liability.Accounts Payable.OutstandingDuesOtherThanMicroSmallEnterprise"}, {"displayName": "Credit Card", "required": false, "type": "String", "value": "Liability.Credit Card.CreditCard"}, {"displayName": "Notes Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.NotesPayable"}, {"displayName": "Other Long Term Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.OtherLongTermLiabilities"}, {"displayName": "Shareholder Notes Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.ShareholderNotesPayable"}, {"displayName": "Accruals And Deferred Income", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccrualsAndDeferredIncome"}, {"displayName": "Accrued Long Lerm Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccruedLongLermLiabilities"}, {"displayName": "Accrued Vacation Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccruedVacationPayable"}, {"displayName": "Bank Loans", "required": false, "type": "String", "value": "Liability.Long Term Liability.BankLoans"}, {"displayName": "Debts Related To Participating Interests", "required": false, "type": "String", "value": "Liability.Long Term Liability.DebtsRelatedToParticipatingInterests"}, {"displayName": "Deferred Tax Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.DeferredTaxLiabilities"}, {"displayName": "Government And Other Public Authorities", "required": false, "type": "String", "value": "Liability.Long Term Liability.GovernmentAndOtherPublicAuthorities"}, {"displayName": "Group And Associates", "required": false, "type": "String", "value": "Liability.Long Term Liability.GroupAndAssociates"}, {"displayName": "Liabilities Related To Assets Held For Sale", "required": false, "type": "String", "value": "Liability.Long Term Liability.LiabilitiesRelatedToAssetsHeldForSale"}, {"displayName": "Long Term Borrowings", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermBorrowings"}, {"displayName": "Long Term Debit", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermDebit"}, {"displayName": "Long Term Employee Benefit Obligations", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermEmployeeBenefitObligations"}, {"displayName": "Obligations Under Finance Leases", "required": false, "type": "String", "value": "Liability.Long Term Liability.ObligationsUnderFinanceLeases"}, {"displayName": "Other Long Term Provisions", "required": false, "type": "String", "value": "Liability.Long Term Liability.OtherLongTermProvisions"}, {"displayName": "Provision For Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.ProvisionForLiabilities"}, {"displayName": "Provisions Non Current Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.ProvisionsNonCurrentLiabilities"}, {"displayName": "Staff And Related Long Term Liability Accounts", "required": false, "type": "String", "value": "Liability.Long Term Liability.StaffAndRelatedLongTermLiabilityAccounts"}, {"displayName": "Direct Deposit Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.DirectDepositPayable"}, {"displayName": "Line Of Credit", "required": false, "type": "String", "value": "Liability.Other Current Liability.LineOfCredit"}, {"displayName": "Loan Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.LoanPayable"}, {"displayName": "Global Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.GlobalTaxPayable"}, {"displayName": "Global Tax Suspense", "required": false, "type": "String", "value": "Liability.Other Current Liability.GlobalTaxSuspense"}, {"displayName": "Other Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.OtherCurrentLiabilities"}, {"displayName": "Payroll Clearing", "required": false, "type": "String", "value": "Liability.Other Current Liability.PayrollClearing"}, {"displayName": "Payroll Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.PayrollTaxPayable"}, {"displayName": "Prepaid Expenses Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.PrepaidExpensesPayable"}, {"displayName": "Rents In Trust Liability", "required": false, "type": "String", "value": "Liability.Other Current Liability.RentsInTrustLiability"}, {"displayName": "Trust Accounts Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.TrustAccountsLiabilities"}, {"displayName": "Federal Income Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.FederalIncomeTaxPayable"}, {"displayName": "Insurance Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.InsurancePayable"}, {"displayName": "Sales Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.SalesTaxPayable"}, {"displayName": "State Local Income Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.StateLocalIncomeTaxPayable"}, {"displayName": "Accrued Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.AccruedLiabilities"}, {"displayName": "Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentLiabilities"}, {"displayName": "Current Portion EmployeeBenefits Obligations", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentPortionEmployeeBenefitsObligations"}, {"displayName": "Current Portion Of Obligations Under Finance Leases", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentPortionOfObligationsUnderFinanceLeases"}, {"displayName": "Current Tax Liability", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentTaxLiability"}, {"displayName": "Dividends Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.DividendsPayable"}, {"displayName": "Duties And Taxes", "required": false, "type": "String", "value": "Liability.Other Current Liability.DutiesAndTaxes"}, {"displayName": "Interest Payables", "required": false, "type": "String", "value": "Liability.Other Current Liability.InterestPayables"}, {"displayName": "Provision For Warranty Obligations", "required": false, "type": "String", "value": "Liability.Other Current Liability.ProvisionForWarrantyObligations"}, {"displayName": "Provisions Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.ProvisionsCurrentLiabilities"}, {"displayName": "Short Term Borrowings", "required": false, "type": "String", "value": "Liability.Other Current Liability.ShortTermBorrowings"}, {"displayName": "Social Security Agencies", "required": false, "type": "String", "value": "Liability.Other Current Liability.SocialSecurityAgencies"}, {"displayName": "Staff And Related Liability Accounts", "required": false, "type": "String", "value": "Liability.Other Current Liability.StaffAndRelatedLiabilityAccounts"}, {"displayName": "Sundry Debtors And Creditors", "required": false, "type": "String", "value": "Liability.Other Current Liability.SundryDebtorsAndCreditors"}, {"displayName": "Trade And Other Payables", "required": false, "type": "String", "value": "Liability.Other Current Liability.TradeAndOtherPayables"}, {"displayName": "Opening Balance Equity", "required": false, "type": "String", "value": "Equity.Equity.OpeningBalanceEquity"}, {"displayName": "Partners Equity", "required": false, "type": "String", "value": "Equity.Equity.PartnersEquity"}, {"displayName": "Retained Earnings", "required": false, "type": "String", "value": "Equity.Equity.RetainedEarnings"}, {"displayName": "Accumulated Adjustment", "required": false, "type": "String", "value": "Equity.Equity.AccumulatedAdjustment"}, {"displayName": "Owners Equity", "required": false, "type": "String", "value": "Equity.Equity.OwnersEquity"}, {"displayName": "Paid In Capital Or Surplus", "required": false, "type": "String", "value": "Equity.Equity.PaidInCapitalOrSurplus"}, {"displayName": "Partner Contributions", "required": false, "type": "String", "value": "Equity.Equity.PartnerContributions"}, {"displayName": "Partner Distributions", "required": false, "type": "String", "value": "Equity.Equity.PartnerDistributions"}, {"displayName": "Preferred Stock", "required": false, "type": "String", "value": "Equity.Equity.PreferredStock"}, {"displayName": "Common Stock", "required": false, "type": "String", "value": "Equity.Equity.CommonStock"}, {"displayName": "Treasury Stock", "required": false, "type": "String", "value": "Equity.Equity.TreasuryStock"}, {"displayName": "Estimated Taxes", "required": false, "type": "String", "value": "Equity.Equity.EstimatedTaxes"}, {"displayName": "Healthcare", "required": false, "type": "String", "value": "Equity.Equity.Healthcare"}, {"displayName": "Personal Income", "required": false, "type": "String", "value": "Equity.Equity.PersonalIncome"}, {"displayName": "Personal Expense", "required": false, "type": "String", "value": "Equity.Equity.PersonalExpense"}, {"displayName": "Accumulated Other Comprehensive Income", "required": false, "type": "String", "value": "Equity.Equity.AccumulatedOtherComprehensiveIncome"}, {"displayName": "Called Up Share Capital", "required": false, "type": "String", "value": "Equity.Equity.CalledUpShareCapital"}, {"displayName": "Capital Reserves", "required": false, "type": "String", "value": "Equity.Equity.CapitalReserves"}, {"displayName": "Dividend Disbursed", "required": false, "type": "String", "value": "Equity.Equity.DividendDisbursed"}, {"displayName": "Equity In Earnings Of Subsiduaries", "required": false, "type": "String", "value": "Equity.Equity.EquityInEarningsOfSubsiduaries"}, {"displayName": "Investment Grants", "required": false, "type": "String", "value": "Equity.Equity.InvestmentGrants"}, {"displayName": "Money Received Against Share Warrants", "required": false, "type": "String", "value": "Equity.Equity.MoneyReceivedAgainstShareWarrants"}, {"displayName": "Other Free Reserves", "required": false, "type": "String", "value": "Equity.Equity.OtherFreeReserves"}, {"displayName": "Share Application Money Pending Allotment", "required": false, "type": "String", "value": "Equity.Equity.ShareApplicationMoneyPendingAllotment"}, {"displayName": "Share Capital", "required": false, "type": "String", "value": "Equity.Equity.ShareCapital"}, {"displayName": "Funds", "required": false, "type": "String", "value": "Equity.Equity.Funds"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Should not be longer than 200 characters.", "field": "Name"}], "warnings": []}}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [{"details": "Should be a number between 1 and 99999999.", "field": "NominalCode"}], "warnings": []}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Sales", "required": false, "type": "String", "value": "SALES"}, {"displayName": "Other Income", "required": false, "type": "String", "value": "OTHER_INCOME"}, {"displayName": "Direct Expenses", "required": false, "type": "String", "value": "DIRECT_EXPENSES"}, {"displayName": "Overheads", "required": false, "type": "String", "value": "OVERHEADS"}, {"displayName": "Depreciation", "required": false, "type": "String", "value": "DEPRECIATION"}, {"displayName": "Current Assets", "required": false, "type": "String", "value": "CURRENT_ASSETS"}, {"displayName": "Fixed Assets", "required": false, "type": "String", "value": "FIXED_ASSETS"}, {"displayName": "Future Assets", "required": false, "type": "String", "value": "FUTURE_ASSETS"}, {"displayName": "Bank", "required": false, "type": "String", "value": "BANK"}, {"displayName": "Current Liability", "required": false, "type": "String", "value": "CURRENT_LIABILITY"}, {"displayName": "Future Liability", "required": false, "type": "String", "value": "FUTURE_LIABILITY"}, {"displayName": "Equity", "required": false, "type": "String", "value": "EQUITY"}, {"displayName": "Credit Card / Loan", "required": false, "type": "String", "value": "LINE_OF_CREDIT"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be unique within the entity.", "field": "NominalCode"}, {"details": "Must be at most 24 characters in length, although restrictions may vary between entities.", "field": "NominalCode"}]}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String"}, "status": {"description": "The status of the account", "displayName": "Account Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}, "type": {"description": "The type, or base category, of the account", "displayName": "Account Type", "options": [{"displayName": "Asset", "required": false, "type": "String", "value": "Asset"}, {"displayName": "Equity", "required": false, "type": "String", "value": "Equity"}, {"displayName": "Expense", "required": false, "type": "String", "value": "Expense"}, {"displayName": "Income", "required": false, "type": "String", "value": "Income"}, {"displayName": "Liability", "required": false, "type": "String", "value": "Liability"}], "required": true, "type": "String"}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "required": true, "type": "String", "validation": {"information": [{"details": "Any category that is part of the hierarchy of one of: 'Assets', 'Equity', 'Liabilities', 'Total Expenses' and 'Total Income' is permitted.", "field": "FullyQualifiedCategory"}], "warnings": []}}}, "required": true, "type": "Object"} + Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String"}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String"}, "description": {"description": "Description of the account", "displayName": "Description", "required": true, "type": "String"}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "required": true, "type": "String"}, "fullyQualifiedName": {"description": "The full name of the account e.g. Liability.Current.VAT or Income.Revenue.Sales", "displayName": "Fully Qualified Name", "required": true, "type": "String"}, "currency": {"description": "The currency of the account", "displayName": "Currency", "required": true, "type": "String"}, "currentBalance": {"description": "The current balance in the account", "displayName": "Current Balance", "required": true, "type": "Number"}, "type": {"description": "The type, or base category, of the account", "displayName": "Account Type", "required": true, "type": "String"}, "status": {"description": "The status of the account", "displayName": "Account Status", "required": true, "type": "String"}, "isBankAccount": {"description": "Confirms whether the nominal account represents a bank account or not", "displayName": "Is Bank Account?", "required": true, "type": "Boolean"}, "validDatatypeLinks": {"description": "Describes which fields on other data types are valid links to this account in the originating system", "displayName": "Valid Datatype Links", "required": true, "type": "Array"}, "metadata": {"description": "Miscellaneous data about the item", "displayName": "Metadata", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "Identifier for the nominal account.", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 10 characters.", "field": "NominalCode"}]}}, "name": {"description": "Name of account as it appears in the chart of accounts or general ledger.", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Payments are enabled to this account if the name ends in .PaymentsEnabled.", "field": "Name"}], "warnings": []}}, "description": {"description": "Description for the nominal account.", "displayName": "Description", "required": false, "type": "String"}, "fullyQualifiedCategory": {"description": "Account type and category for nominal account.", "displayName": "Fully Qualified Category", "options": [{"displayName": "Current Asset", "required": false, "type": "String", "value": "Asset.Current"}, {"displayName": "Fixed Asset", "required": false, "type": "String", "value": "Asset.Fixed"}, {"displayName": "Inventory", "required": false, "type": "String", "value": "Asset.Inventory"}, {"displayName": "Non-current Asset", "required": false, "type": "String", "value": "Asset.NonCurrent"}, {"displayName": "Prepayment", "required": false, "type": "String", "value": "Asset.Prepayment"}, {"displayName": "Direct Costs", "required": false, "type": "String", "value": "Expense.DirectCosts"}, {"displayName": "Expense", "required": false, "type": "String", "value": "Expense.Expense"}, {"displayName": "Overhead", "required": false, "type": "String", "value": "Expense.Overhead"}, {"displayName": "Superannuation", "required": false, "type": "String", "value": "Expense.Superannuation"}, {"displayName": "Wages", "required": false, "type": "String", "value": "Expense.Wages"}, {"displayName": "Sales", "required": false, "type": "String", "value": "Income.Sales"}, {"displayName": "Revenue", "required": false, "type": "String", "value": "Income.Revenue"}, {"displayName": "Other Income", "required": false, "type": "String", "value": "Income.Other"}, {"displayName": "Current Liability", "required": false, "type": "String", "value": "Liability.Current"}, {"displayName": "Depreciation", "required": false, "type": "String", "value": "Liability.Depreciation"}, {"displayName": "Liability", "required": false, "type": "String", "value": "Liability.Liability"}, {"displayName": "Non Current Liability", "required": false, "type": "String", "value": "Liability.NonCurrent"}, {"displayName": "Pay As You Go Liability", "required": false, "type": "String", "value": "Liability.PayAsYouGo"}, {"displayName": "Superannuation Liability", "required": false, "type": "String", "value": "Liability.Superannuation"}, {"displayName": "Wages Payable Liability", "required": false, "type": "String", "value": "Liability.WagesPayable"}, {"displayName": "Equity", "required": false, "type": "String", "value": "Equity.Equity"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-direct-cost: + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"contactRef": {"dataType": "suppliers", "id": "80000001-1671793885"}, "currency": "USD", "issueDate": "2023-03-21T10:19:52.223Z", "lineItems": [{"accountRef": {"id": "8000000D-1671793811", "name": "Purchases - Hardware for Resale"}, "description": "test description line 1", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "80000001-1674566705", "name": "item test"}, "quantity": 1, "subTotal": 99, "taxAmount": 360, "totalAmount": 70, "tracking": {"invoiceTo": {"dataType": "invoice"}, "recordRefs": []}, "trackingCategoryRefs": [{"id": "80000001-1674553252", "name": "Class 1"}], "unitAmount": 7}], "note": "directCost 21/03 09.20", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2023-01-29T10:19:52.223Z", "currency": "USD", "currencyRate": 0, "totalAmount": 88}, "payment": {"accountRef": {"id": "80000028-1671794219", "name": "Bank Account 1"}, "currency": "USD", "note": "payment allocations note", "paidOnDate": "2023-01-28T10:19:52.223Z", "reference": "payment allocations reference", "totalAmount": 54}}], "reference": "test ref", "subTotal": 362, "taxAmount": 4, "totalAmount": 366} + responses: + "200": + application/json: {"changes": [], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "41bcdd89-dc7f-4a50-8e08-333b1d5e2619", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 651985} + "400": {} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"contactRef": {"dataType": "suppliers", "id": "699f0091-b127-4796-9f15-41a2f42abeb2"}, "currency": "GBP", "issueDate": "2023-02-25", "lineItems": [{"description": "negative direct cost", "itemRef": {"id": "965cfc0e-4d80-4059-9641-4a392f9ad549"}, "quantity": -1, "subTotal": -35, "taxAmount": -7, "taxRateRef": {"id": "INPUT2"}, "totalAmount": -42, "tracking": {"invoiceTo": {"dataType": "transfer"}, "recordRefs": []}, "unitAmount": 35}], "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "totalAmount": -42}, "payment": {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4"}, "currency": "GBP", "paidOnDate": "2022-10-23T00:00:00Z"}}], "reference": "Scenario One neg DC", "subTotal": -35, "taxAmount": -7, "totalAmount": -42} + responses: + "200": + application/json: {"changes": [], "companyId": "b5efee61-3fab-4a5d-9247-de03d6eda6db", "completedOnUtc": "2022-10-23T00:00:00Z", "data": {"contactRef": {"dataType": "suppliers", "id": "699f0091-b127-4796-9f15-41a2f42abeb2"}, "currency": "GBP", "issueDate": "2023-02-25T00:00:00", "lineItems": [{"description": "negative direct cost", "itemRef": {"id": "965cfc0e-4d80-4059-9641-4a392f9ad549"}, "quantity": -1, "subTotal": -35, "taxAmount": -7, "taxRateRef": {"id": "INPUT2"}, "totalAmount": -42, "tracking": {"invoiceTo": {"dataType": "invoice"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 35}], "modifiedDate": "2022-10-23T00:00:00Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR", "totalAmount": -42}, "payment": {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4"}, "currency": "GBP", "paidOnDate": "0001-01-01T00:00:00", "totalAmount": 0}}], "reference": "Scenario One neg DC", "sourceModifiedDate": "2022-10-23T00:00:00Z", "subTotal": 0, "taxAmount": -7, "totalAmount": -42}, "dataConnectionKey": "1e355304-4476-422e-95cb-fa2a6d47fab4", "dataType": "directCosts", "pushOperationKey": "33347930-fcc5-4f95-aa13-4a0f7291b559", "requestedOnUtc": "2023-02-24T13:43:26.5109173Z", "status": "Pending", "statusCode": 202, "validation": {"errors": [], "warnings": []}} + "400": {} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"currency": "GBP", "issueDate": "2023-02-12", "lineItems": [{"accountRef": {"id": "288"}, "quantity": 1, "subTotal": 15, "tracking": {"invoiceTo": {"dataType": "transfer"}, "recordRefs": []}, "unitAmount": 15}], "paymentAllocations": [{"allocation": {}, "payment": {"accountRef": {"id": "750-1"}, "currency": "GBP", "paidOnDate": "2022-10-23T00:00:00Z"}}], "subTotal": 15, "taxAmount": 0, "totalAmount": 15} + responses: + "200": + application/json: {"changes": [], "companyId": "a23f79d6-7cc9-486c-b388-8ab88faea947", "completedOnUtc": "2023-02-12T15:15:54.7161036Z", "data": {"currency": "GBP", "currencyRate": 1, "id": "372060709", "issueDate": "2023-02-12T00:00:00", "lineItems": [{"accountRef": {"id": "288"}, "quantity": 1, "subTotal": 15, "taxAmount": 3, "totalAmount": 18, "tracking": {"invoiceTo": {"dataType": "transfer"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 15}], "modifiedDate": "2022-10-23T00:00:00Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2023-02-12T00:00:00", "currency": "GBP", "totalAmount": 18}, "payment": {"accountRef": {"id": "750-1"}, "currency": "GBP", "id": "372060709", "paidOnDate": "2023-02-12T00:00:00", "totalAmount": 18}}], "sourceModifiedDate": "2023-02-12T15:15:53Z", "subTotal": 15, "taxAmount": 3, "totalAmount": 18}, "dataConnectionKey": "35e38cd5-66ea-41b8-b555-9efd5b792b68", "dataType": "directCosts", "pushOperationKey": "0659a24d-2b66-4979-971e-4b98c3ed7f61", "requestedOnUtc": "2023-02-12T15:15:51.1723204Z", "status": "Success", "statusCode": 200} + "400": {} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"currency": "USD", "currencyRate": 0.5, "issueDate": "2023-03-31T00:00:00", "lineItems": [{"accountRef": {"id": "195"}, "quantity": 1, "subTotal": 9.99, "taxAmount": 2, "totalAmount": 11.99, "tracking": {"invoiceTo": {"dataType": "transfer"}, "recordRefs": []}, "unitAmount": 9.99}], "note": "Test 1", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2023-03-31T00:00:00", "currency": "USD", "totalAmount": 11.99}, "payment": {"accountRef": {"id": "348", "name": "CMRR Renewal"}, "currency": "USD", "id": "4355", "note": "test note", "paidOnDate": "2023-03-31T00:00:00", "reference": "test reference", "totalAmount": 11.99}}], "reference": "test ref", "subTotal": 9.99, "taxAmount": 2, "totalAmount": 11.99} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "directCosts"}, "type": "Created"}], "companyId": "d7f743a9-1804-4116-8c8a-e606f7e2f66c", "completedOnUtc": "2022-10-23T00:00:00Z", "data": {"currency": "USD", "currencyRate": 0.5, "issueDate": "2023-03-31T00:00:00", "lineItems": [{"accountRef": {"id": "195"}, "quantity": 1, "subTotal": 9.99, "taxAmount": 2, "taxRateRef": {"id": "95"}, "totalAmount": 11.99, "tracking": {"invoiceTo": {"dataType": "journalEntry"}, "recordRefs": []}, "trackingCategoryRefs": [], "unitAmount": 9.99}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Test 1", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2023-03-31T00:00:00", "currency": "USD", "totalAmount": 11.99}, "payment": {"accountRef": {"id": "348", "name": "CMRR Renewal"}, "currency": "USD", "id": "4355", "note": "test note", "paidOnDate": "2023-03-31T00:00:00", "reference": "test reference", "totalAmount": 11.99}}], "reference": "test ref", "sourceModifiedDate": "2022-10-23T00:00:00Z", "subTotal": 9.99, "taxAmount": 2, "totalAmount": 11.99}, "dataConnectionKey": "fa139396-523a-4a58-bf2b-8da82c8a673f", "dataType": "directCosts", "pushOperationKey": "0d74c1ad-00ad-4731-9e6e-98a86056959a", "requestedOnUtc": "2023-03-31T12:49:51.6503324Z", "status": "Pending", "statusCode": 202} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"currency": "USD", "issueDate": "2022-10-23T00:00:00Z", "lineItems": [], "paymentAllocations": [], "subTotal": "8915.1", "taxAmount": "0.86", "totalAmount": "4552.22"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-create-directCosts-model: + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "", "displayName": "Direct Cost", "properties": {"reference": {"description": "User friendly reference for the direct transaction", "displayName": "Reference", "required": false, "type": "String"}, "note": {"description": "The note attached to the direct transaction", "displayName": "Note", "required": false, "type": "String", "validation": {"information": [{"details": "is not supported and will be ignored", "field": "Note"}], "warnings": []}}, "contactRef": {"description": "The contact associated with the direct transaction, if known", "displayName": "Contact Ref", "required": false, "type": "Object", "validation": {"information": [{"details": "is not supported and will be ignored", "field": "ContactRef"}], "warnings": []}}, "issueDate": {"description": "The date the direct transaction was issued", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "currency": {"description": "The currency of the direct transaction", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If unspecified, base currency is assumed. Must agree with the bank account in PaymentAllocations", "field": "Currency"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the direct transaction and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [{"details": "Required if the currency is not the base currency", "field": "CurrencyRate"}], "warnings": []}}, "subTotal": {"description": "The total amount of the direct transaction excluding any taxes", "displayName": "Sub Total Amount", "required": false, "type": "Number", "validation": {"information": [{"details": "is not supported and will be ignored", "field": "SubTotal"}], "warnings": []}}, "taxAmount": {"description": "The total amount of tax on the direct transaction", "displayName": "Tax Amount", "required": false, "type": "Number", "validation": {"information": [{"details": "is not supported and will be ignored", "field": "TaxAmount"}], "warnings": []}}, "totalAmount": {"description": "The amount of the direct transaction, inclusive of tax", "displayName": "Total Amount", "required": false, "type": "Number", "validation": {"information": [{"details": "is not supported and will be ignored", "field": "TotalAmount"}], "warnings": []}}, "lineItems": {"description": "A collection of lines that detail items related to the direct transaction", "displayName": "Direct Transaction Lines", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Only one line is supported", "field": "LineItems"}]}}, "paymentAllocations": {"description": "A collection of payments allocated to the direct transaction", "displayName": "Payment Allocations", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Only one line is supported", "field": "PaymentAllocations"}]}}}, "required": true, "type": "Object"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "", "displayName": "Direct Cost", "properties": {"id": {"description": "The identifier for the direct transaction, unique to the company", "displayName": "Unique Direct Transaction ID", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "will be ignored on push. ", "field": "Id"}]}}, "reference": {"description": "User friendly reference for the direct transaction", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "is not supported by FreeAgent and will not be mapped. ", "field": "Reference"}]}}, "note": {"description": "The note attached to the direct transaction", "displayName": "Note", "required": true, "type": "String", "validation": {"information": [{"details": "must be provided", "field": "Note"}], "warnings": []}}, "contactRef": {"description": "The contact associated with the direct transaction, if known", "displayName": "Contact Ref", "required": false, "type": "Object"}, "issueDate": {"description": "The date the direct transaction was issued", "displayName": "Issue Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "must be provided", "field": "IssueDate"}], "warnings": []}}, "currency": {"description": "The currency of the direct transaction", "displayName": "Currency", "required": false, "type": "String"}, "currencyRate": {"description": "The exchange rate between the currency of the direct transaction and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [], "warnings": [{"details": "will be ignored on push. ", "field": "CurrencyRate"}]}}, "lineItems": {"description": "A collection of lines that detail items related to the direct transaction", "displayName": "Direct Transaction Lines", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Exactly one line item must be specified", "field": "LineItems"}]}}, "paymentAllocations": {"description": "A collection of payments allocated to the direct transaction", "displayName": "Payment Allocations", "required": true, "type": "Array"}, "subTotal": {"description": "The total amount of the direct transaction excluding any taxes", "displayName": "Sub Total Amount", "required": false, "type": "Number"}, "taxAmount": {"description": "The total amount of tax on the direct transaction", "displayName": "Tax Amount", "required": false, "type": "Number"}, "totalAmount": {"description": "The amount of the direct transaction, inclusive of tax", "displayName": "Total Amount", "required": false, "type": "Number"}, "modifiedDate": {"description": "The date the record was last updated in the system cache", "displayName": "Modified Date", "required": false, "type": "DateTime", "validation": {"information": [], "warnings": [{"details": "will be ignored on push. ", "field": "ModifiedDate"}]}}, "sourceModifiedDate": {"description": "The date the record was last changed in the originating system", "displayName": "Source Modified Date", "required": false, "type": "DateTime", "validation": {"information": [], "warnings": [{"details": "will be ignored on push. ", "field": "SourceModifiedDate"}]}}}, "required": true, "type": "Object"} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Direct Cost", "displayName": "Direct Cost", "properties": {"note": {"description": "The note attached to the direct transaction", "displayName": "Note", "required": false, "type": "String"}, "contactRef": {"description": "The contact associated with the direct transaction, if known", "displayName": "Contact Ref", "required": true, "type": "Object"}, "issueDate": {"description": "The date the direct transaction was issued", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "currency": {"description": "The currency of the direct transaction", "displayName": "Currency", "required": true, "type": "String"}, "currencyRate": {"description": "The exchange rate between the currency of the direct transaction and the base currency of the company", "displayName": "Currency Exchange Rate", "required": true, "type": "Number"}, "lineItems": {"description": "A collection of lines that detail items related to the direct transaction", "displayName": "Direct Transaction Lines", "required": true, "type": "Array"}, "paymentAllocations": {"description": "A collection of payments allocated to the direct transaction", "displayName": "Payment Allocations", "required": true, "type": "Array", "validation": {"information": [{"details": "Must contain a single allocation", "field": "PaymentAllocations"}], "warnings": []}}}, "required": true, "type": "Object"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Direct Cost", "displayName": "Direct Cost", "properties": {"reference": {"description": "User friendly reference for the direct transaction", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Represents the check number", "field": "Reference"}]}}, "note": {"description": "The note attached to the direct transaction", "displayName": "Note", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 4096 characters.", "field": "Note"}]}}, "contactRef": {"description": "The contact associated with the direct transaction, if known", "displayName": "Contact Ref", "required": false, "type": "Object"}, "currency": {"description": "The currency of the direct transaction", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If not set, will default to the default currency", "field": "Currency"}], "warnings": [{"details": "Must be a three letter ISO code", "field": "Currency"}, {"details": "Can only be set if the Quickbooks Desktop company has Multicurrency enabled.", "field": "Currency"}]}}, "currencyRate": {"description": "The exchange rate between the currency of the direct transaction and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [{"details": "If not set, will default to the rate set within QuickBooks Desktop, if no rate is set in QuickBooks Desktop, it will default to 1.", "field": "CurrencyRate"}, {"details": "Can only be set if the Quickbooks Desktop company has Multicurrency enabled.", "field": "CurrencyRate"}], "warnings": []}}, "issueDate": {"description": "The date the direct transaction was issued", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "lineItems": {"description": "A collection of lines that detail items related to the direct transaction", "displayName": "Direct Transaction Lines", "required": true, "type": "Array"}, "paymentAllocations": {"description": "A collection of payments allocated to the direct transaction", "displayName": "Payment Allocations", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Must contain a single payment allocation", "field": "PaymentAllocations"}]}}, "taxAmount": {"description": "The total amount of tax on the direct transaction", "displayName": "Tax Amount", "required": true, "type": "Number"}, "subTotal": {"description": "The total amount of the direct transaction excluding any taxes", "displayName": "Sub Total Amount", "required": false, "type": "Number"}, "totalAmount": {"description": "The amount of the direct transaction, inclusive of tax", "displayName": "Total Amount", "required": false, "type": "Number"}, "sourceModifiedDate": {"description": "The date the record was last changed in the originating system", "displayName": "Source Modified Date", "required": false, "type": "DateTime"}, "modifiedDate": {"description": "The date the record was last updated in the system cache", "displayName": "Modified Date", "required": false, "type": "DateTime"}}, "required": true, "type": "Object"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Direct Cost", "displayName": "Direct Cost", "properties": {"contactRef": {"description": "The contact associated with the direct transaction, if known", "displayName": "Contact Ref", "required": true, "type": "Object"}, "issueDate": {"description": "The date the direct transaction was issued", "displayName": "Issue Date", "required": false, "type": "DateTime", "validation": {"information": [{"details": "If the issue date is not supplied, the current date on the server is used.", "field": "IssueDate"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the direct transaction and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number"}, "reference": {"description": "User friendly reference for the direct transaction", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be less than 22 characters.", "field": "Reference"}]}}, "currency": {"description": "The currency of the direct transaction", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "Required if multi-currency is enabled for the company.", "field": "Currency"}], "warnings": []}}, "note": {"description": "The note attached to the direct transaction", "displayName": "Note", "required": false, "type": "String"}, "paymentAllocations": {"description": "A collection of payments allocated to the direct transaction", "displayName": "Payment Allocations", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Must have exactly one payment allocation.", "field": "PaymentAllocations"}]}}, "lineItems": {"description": "A collection of lines that detail items related to the direct transaction", "displayName": "Direct Transaction Lines", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Direct Cost", "displayName": "Direct Cost", "properties": {"contactRef": {"description": "The contact associated with the direct transaction, if known", "displayName": "Contact Ref", "required": true, "type": "Object"}, "issueDate": {"description": "The date the direct transaction was issued", "displayName": "Issue Date", "required": false, "type": "DateTime", "validation": {"information": [{"details": "If the issue date is not supplied, the current date on the server is used.", "field": "IssueDate"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the direct transaction and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number"}, "reference": {"description": "User friendly reference for the direct transaction", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be less than 22 characters.", "field": "Reference"}]}}, "currency": {"description": "The currency of the direct transaction", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "Required if multi-currency is enabled for the company.", "field": "Currency"}], "warnings": []}}, "note": {"description": "The note attached to the direct transaction", "displayName": "Note", "required": false, "type": "String"}, "paymentAllocations": {"description": "A collection of payments allocated to the direct transaction", "displayName": "Payment Allocations", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Must have exactly one payment allocation.", "field": "PaymentAllocations"}]}}, "lineItems": {"description": "A collection of lines that detail items related to the direct transaction", "displayName": "Direct Transaction Lines", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Direct Cost", "displayName": "Direct Cost", "properties": {"reference": {"description": "The user reference for this direct cost.", "displayName": "Reference", "required": false, "type": "String"}, "issueDate": {"description": "The date this payment was issued.", "displayName": "Issue Date", "required": true, "type": "Number"}, "currency": {"description": "The currency in which the direct cost is issued in.", "displayName": "Currency", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "This must match the target account's default currency.", "field": "currency"}]}}, "currencyRate": {"description": "The currency rate associated with this transaction.", "displayName": "Currency Rate", "required": true, "type": "Number"}, "accountRef": {"description": "The bank account to pay this direct cost from.", "displayName": "Bank Account", "required": true, "type": "Object"}, "subTotal": {"description": "The net amount being paid in this direct cost.", "displayName": "Sub Total", "required": true, "type": "Number", "validation": {"information": [{"details": "This must equal the sum of the line net amounts"}], "warnings": []}}, "taxAmount": {"description": "The tax amount being paid in this direct cost.", "displayName": "Tax Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "This must equal the sum of the line tax amounts"}], "warnings": []}}, "totalAmount": {"description": "The total amount being paid in this direct cost.", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "This must equal the sum of the line amounts"}], "warnings": []}}, "lineItems": {"description": "Line items of the direct cost.", "displayName": "Line Items", "required": true, "type": "Array"}}, "required": true, "type": "Object", "validation": {"information": [{"details": "Pushing to Sage 50 2015 (v21) or below is not supported. To enable push, please upgrade to at least Sage 50 2016 (v22) and re-sync the company."}], "warnings": []}} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Direct Cost", "displayName": "Direct Cost", "properties": {"note": {"description": "The note attached to the direct transaction", "displayName": "Note", "required": true, "type": "String", "validation": {"information": [{"details": "Must be used to provide payee's name and contain no more than 80 characters.", "field": "Note"}], "warnings": []}}, "lineItems": {"description": "A collection of lines that detail items related to the direct transaction", "displayName": "Direct Transaction Lines", "required": true, "type": "Array", "validation": {"information": [{"details": "Must contain at least one line item.", "field": "LineItems"}], "warnings": []}}, "paymentAllocations": {"description": "A collection of payments allocated to the direct transaction", "displayName": "Payment Allocations", "required": true, "type": "Array", "validation": {"information": [{"details": "Must contain a single allocation.", "field": "PaymentAllocations"}], "warnings": []}}, "currency": {"description": "The currency of the direct transaction", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "When supplying a currency ensure that it exists in your Sage Intacct entity otherwise the request will fail.", "field": "Currency"}]}}, "reference": {"description": "User friendly reference for the direct transaction", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [{"details": "Must not contain no more than 45 characters.", "field": "Reference"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the direct transaction and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number"}, "totalAmount": {"description": "The amount of the direct transaction, inclusive of tax", "displayName": "Total Amount", "required": false, "type": "Number", "validation": {"information": [{"details": "If provided, must match the sum of the line items.", "field": "TotalAmount"}], "warnings": []}}}, "required": true, "type": "Object"} + Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Direct Cost", "displayName": "Direct Cost", "properties": {"reference": {"description": "User friendly reference for the direct transaction", "displayName": "Reference", "required": true, "type": "String"}, "note": {"description": "The note attached to the direct transaction", "displayName": "Note", "required": true, "type": "String"}, "contactRef": {"description": "The contact associated with the direct transaction, if known", "displayName": "Contact Ref", "required": true, "type": "Object"}, "issueDate": {"description": "The date the direct transaction was issued", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "currency": {"description": "The currency of the direct transaction", "displayName": "Currency", "required": true, "type": "String"}, "currencyRate": {"description": "The exchange rate between the currency of the direct transaction and the base currency of the company", "displayName": "Currency Exchange Rate", "required": true, "type": "Number"}, "lineItems": {"description": "A collection of lines that detail items related to the direct transaction", "displayName": "Direct Transaction Lines", "required": true, "type": "Array"}, "paymentAllocations": {"description": "A collection of payments allocated to the direct transaction", "displayName": "Payment Allocations", "required": true, "type": "Array"}, "subTotal": {"description": "The total amount of the direct transaction excluding any taxes", "displayName": "Sub Total Amount", "required": true, "type": "Number"}, "taxAmount": {"description": "The total amount of tax on the direct transaction", "displayName": "Tax Amount", "required": true, "type": "Number"}, "totalAmount": {"description": "The amount of the direct transaction, inclusive of tax", "displayName": "Total Amount", "required": true, "type": "Number"}, "metadata": {"description": "Miscellaneous data about the item", "displayName": "Metadata", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Direct Cost", "displayName": "Direct Cost", "properties": {"issueDate": {"description": "The date the direct transaction was issued", "displayName": "Issue Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must be provided.", "field": "IssueDate"}], "warnings": []}}, "reference": {"description": "User friendly reference for the direct transaction", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [{"details": "Must not exceed 255 characters.", "field": "Reference"}], "warnings": []}}, "currency": {"description": "The currency of the direct transaction", "displayName": "Currency", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Currency"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the direct transaction and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number"}, "taxAmount": {"description": "The total amount of tax on the direct transaction", "displayName": "Tax Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "Must be provided.", "field": "TaxAmount"}], "warnings": []}}, "totalAmount": {"description": "The amount of the direct transaction, inclusive of tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "Must be provided.", "field": "TotalAmount"}], "warnings": []}}, "contactRef": {"description": "The contact associated with the direct transaction, if known", "displayName": "Contact Ref", "required": true, "type": "Object", "validation": {"information": [{"details": "Must be provided.", "field": "ContactRef"}], "warnings": []}}, "paymentAllocations": {"description": "A collection of payments allocated to the direct transaction", "displayName": "Payment Allocations", "required": true, "type": "Array", "validation": {"information": [{"details": "Must be provided.", "field": "PaymentAllocations"}], "warnings": []}}, "lineItems": {"description": "A collection of lines that detail items related to the direct transaction", "displayName": "Direct Transaction Lines", "required": true, "type": "Array", "validation": {"information": [{"details": "Must be provided.", "field": "LineItems"}], "warnings": []}}}, "required": true, "type": "Object", "validation": {"information": [], "warnings": [{"details": "When negative, the push item will be converted to a DirectIncome and will be pushed accordingly."}]}} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Direct Cost", "displayName": "Direct Cost", "properties": {"reference": {"description": "User friendly reference for the direct transaction", "displayName": "Reference", "required": false, "type": "String"}, "note": {"description": "The note attached to the direct transaction", "displayName": "Note", "required": false, "type": "String"}, "issueDate": {"description": "The date the direct transaction was issued", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "currencyRate": {"description": "The exchange rate between the currency of the direct transaction and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number"}, "contactRef": {"description": "The contact associated with the direct transaction, if known", "displayName": "Contact Ref", "required": false, "type": "Object", "validation": {"information": [{"details": "Required when pushing a negative direct cost & should reference either a Customer or Supplier when provided", "field": "ContactRef"}], "warnings": []}}, "lineItems": {"description": "A collection of lines that detail items related to the direct transaction", "displayName": "Direct Transaction Lines", "required": true, "type": "Array"}, "currency": {"description": "The currency of the direct transaction", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "Is required when pushing a negative direct cost", "field": "Currency"}], "warnings": []}}, "paymentAllocations": {"description": "A collection of payments allocated to the direct transaction", "displayName": "Payment Allocations", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-payment: + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"accountRef": {"id": "8000002E-1675267199", "name": "Undeposited Funds"}, "currency": "USD", "currencyRate": 1, "customerRef": {"companyName": "string", "id": "80000002-1674552702"}, "date": "2023-02-10T11:47:04.792Z", "lines": [{"allocatedOnDate": "2023-02-11T11:47:04.792Z", "amount": 28, "links": [{"amount": -28, "currencyRate": 1, "id": "181-1676374586", "type": "Invoice"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "note 14/02 1147", "paymentMethodRef": {"id": "string", "name": "string"}, "reference": "ref 14/02 1147", "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 28} + responses: + "200": + application/json: {"changes": [], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "7241bcdd-89dc-47fa-904e-08333b1d5e26", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Success", "statusCode": 100966} + "400": {} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"accountRef": {"id": "1200", "name": "Bank Current Account"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"id": "CUST1"}, "date": "2023-03-17T11:47:04.792Z", "lines": [{"allocatedOnDate": "2023-02-11T11:47:04.792Z", "amount": 4, "links": [{"amount": -4, "currencyRate": 1, "id": "INV-31", "type": "Invoice"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "note 07/03 14.31", "paymentMethodRef": {"id": "4405"}, "reference": "ref", "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 4} + responses: + "200": + application/json: {"changes": [], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "a25d0d9e-a132-40e8-904a-a8ce67b7c49c", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 273446} + "400": {} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "customerRef": {"companyName": "Stanley test customer", "id": "30444c5bd4964fd787c7f8e2e5301ce1"}, "date": "2023-03-20T11:47:04.792Z", "lines": [{"allocatedOnDate": "2023-02-11T11:47:04.792Z", "amount": 0.17, "links": [{"amount": -0.17, "currencyRate": 1, "id": "bb85db9226d7450fb99eb83e7fb37505", "type": "Invoice"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Need to send products asap.", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "normal payment 20/03 17.05", "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 0.17} + responses: + "200": + application/json: {"changes": [], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "debcfc23-e7d6-4f94-9574-7251ef092548", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 519359} + "400": {} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"accountRef": {"id": "81"}, "currency": "GBP", "customerRef": {"id": "19"}, "date": "2022-03-12T00:00:00", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -1.1, "id": "246", "type": "Invoice"}, {"amount": 1.1, "id": "280", "type": "CreditNote"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 0} + responses: + "200": + application/json: {"changes": [], "companyId": "ffa6368e-fde4-4165-9a0a-4bda1a6f916e", "completedOnUtc": "2022-10-23T00:00:00Z", "data": {"accountRef": {"id": "81"}, "currency": "GBP", "customerRef": {"id": "19"}, "date": "2022-03-12T00:00:00", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -1.1, "id": "246", "type": "Invoice"}, {"amount": 1.1, "id": "280", "type": "CreditNote"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 0}, "dataConnectionKey": "bbecdbf3-913a-43ae-9c91-e830b3686657", "dataType": "payments", "pushOperationKey": "673f5d97-1c53-41ef-b9c8-cc9a8415d17c", "requestedOnUtc": "0001-01-01T00:00:00", "status": "Pending", "statusCode": 202} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"currency": "EUR", "date": "2022-10-23T00:00:00Z", "lines": [], "modifiedDate": "2022-10-23T00:00:00Z", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-create-payment-model: + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A payment represents an allocation of transactions across an 'accounts receivable' account (customer)", "displayName": "Payment", "properties": {"accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": true, "type": "Object"}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime"}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Must match the sum of the line amounts.", "field": "TotalAmount"}]}}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": true, "type": "String"}, "currencyRate": {"description": "The exchange rate between the currency of the payment and the base currency of the company", "displayName": "Currency Exchange Rate", "required": true, "type": "Number"}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Only one line may be specified", "field": "Lines"}]}}}, "required": true, "type": "Object"} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A payment represents an allocation of transactions across an 'accounts receivable' account (customer)", "displayName": "Payment", "properties": {"date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime"}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Only one line is supported", "field": "Lines"}]}}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "options": [{"displayName": "AED", "required": false, "type": "Array", "value": "AED"}, {"displayName": "AFN", "required": false, "type": "Array", "value": "AFN"}, {"displayName": "ALL", "required": false, "type": "Array", "value": "ALL"}, {"displayName": "AMD", "required": false, "type": "Array", "value": "AMD"}, {"displayName": "ANG", "required": false, "type": "Array", "value": "ANG"}, {"displayName": "AOA", "required": false, "type": "Array", "value": "AOA"}, {"displayName": "ARS", "required": false, "type": "Array", "value": "ARS"}, {"displayName": "AUD", "required": false, "type": "Array", "value": "AUD"}, {"displayName": "AWG", "required": false, "type": "Array", "value": "AWG"}, {"displayName": "AZN", "required": false, "type": "Array", "value": "AZN"}, {"displayName": "BAM", "required": false, "type": "Array", "value": "BAM"}, {"displayName": "BBD", "required": false, "type": "Array", "value": "BBD"}, {"displayName": "BDT", "required": false, "type": "Array", "value": "BDT"}, {"displayName": "BGN", "required": false, "type": "Array", "value": "BGN"}, {"displayName": "BHD", "required": false, "type": "Array", "value": "BHD"}, {"displayName": "BIF", "required": false, "type": "Array", "value": "BIF"}, {"displayName": "BMD", "required": false, "type": "Array", "value": "BMD"}, {"displayName": "BND", "required": false, "type": "Array", "value": "BND"}, {"displayName": "BOB", "required": false, "type": "Array", "value": "BOB"}, {"displayName": "BRL", "required": false, "type": "Array", "value": "BRL"}, {"displayName": "BSD", "required": false, "type": "Array", "value": "BSD"}, {"displayName": "BTN", "required": false, "type": "Array", "value": "BTN"}, {"displayName": "BWP", "required": false, "type": "Array", "value": "BWP"}, {"displayName": "BYR", "required": false, "type": "Array", "value": "BYR"}, {"displayName": "BZD", "required": false, "type": "Array", "value": "BZD"}, {"displayName": "CAD", "required": false, "type": "Array", "value": "CAD"}, {"displayName": "CDF", "required": false, "type": "Array", "value": "CDF"}, {"displayName": "CHF", "required": false, "type": "Array", "value": "CHF"}, {"displayName": "CLP", "required": false, "type": "Array", "value": "CLP"}, {"displayName": "CNY", "required": false, "type": "Array", "value": "CNY"}, {"displayName": "COP", "required": false, "type": "Array", "value": "COP"}, {"displayName": "CRC", "required": false, "type": "Array", "value": "CRC"}, {"displayName": "CUC", "required": false, "type": "Array", "value": "CUC"}, {"displayName": "CUP", "required": false, "type": "Array", "value": "CUP"}, {"displayName": "CVE", "required": false, "type": "Array", "value": "CVE"}, {"displayName": "CZK", "required": false, "type": "Array", "value": "CZK"}, {"displayName": "DJF", "required": false, "type": "Array", "value": "DJF"}, {"displayName": "DKK", "required": false, "type": "Array", "value": "DKK"}, {"displayName": "DOP", "required": false, "type": "Array", "value": "DOP"}, {"displayName": "DZD", "required": false, "type": "Array", "value": "DZD"}, {"displayName": "EGP", "required": false, "type": "Array", "value": "EGP"}, {"displayName": "ERN", "required": false, "type": "Array", "value": "ERN"}, {"displayName": "ETB", "required": false, "type": "Array", "value": "ETB"}, {"displayName": "EUR", "required": false, "type": "Array", "value": "EUR"}, {"displayName": "FJD", "required": false, "type": "Array", "value": "FJD"}, {"displayName": "FKP", "required": false, "type": "Array", "value": "FKP"}, {"displayName": "GBP", "required": false, "type": "Array", "value": "GBP"}, {"displayName": "GEL", "required": false, "type": "Array", "value": "GEL"}, {"displayName": "GGP", "required": false, "type": "Array", "value": "GGP"}, {"displayName": "GHS", "required": false, "type": "Array", "value": "GHS"}, {"displayName": "GIP", "required": false, "type": "Array", "value": "GIP"}, {"displayName": "GMD", "required": false, "type": "Array", "value": "GMD"}, {"displayName": "GNF", "required": false, "type": "Array", "value": "GNF"}, {"displayName": "GTQ", "required": false, "type": "Array", "value": "GTQ"}, {"displayName": "GYD", "required": false, "type": "Array", "value": "GYD"}, {"displayName": "HKD", "required": false, "type": "Array", "value": "HKD"}, {"displayName": "HNL", "required": false, "type": "Array", "value": "HNL"}, {"displayName": "HRK", "required": false, "type": "Array", "value": "HRK"}, {"displayName": "HTG", "required": false, "type": "Array", "value": "HTG"}, {"displayName": "HUF", "required": false, "type": "Array", "value": "HUF"}, {"displayName": "IDR", "required": false, "type": "Array", "value": "IDR"}, {"displayName": "ILS", "required": false, "type": "Array", "value": "ILS"}, {"displayName": "IMP", "required": false, "type": "Array", "value": "IMP"}, {"displayName": "INR", "required": false, "type": "Array", "value": "INR"}, {"displayName": "IQD", "required": false, "type": "Array", "value": "IQD"}, {"displayName": "IRR", "required": false, "type": "Array", "value": "IRR"}, {"displayName": "ISK", "required": false, "type": "Array", "value": "ISK"}, {"displayName": "JEP", "required": false, "type": "Array", "value": "JEP"}, {"displayName": "JMD", "required": false, "type": "Array", "value": "JMD"}, {"displayName": "JOD", "required": false, "type": "Array", "value": "JOD"}, {"displayName": "JPY", "required": false, "type": "Array", "value": "JPY"}, {"displayName": "KES", "required": false, "type": "Array", "value": "KES"}, {"displayName": "KGS", "required": false, "type": "Array", "value": "KGS"}, {"displayName": "KHR", "required": false, "type": "Array", "value": "KHR"}, {"displayName": "KMF", "required": false, "type": "Array", "value": "KMF"}, {"displayName": "KPW", "required": false, "type": "Array", "value": "KPW"}, {"displayName": "KRW", "required": false, "type": "Array", "value": "KRW"}, {"displayName": "KWD", "required": false, "type": "Array", "value": "KWD"}, {"displayName": "KYD", "required": false, "type": "Array", "value": "KYD"}, {"displayName": "KZT", "required": false, "type": "Array", "value": "KZT"}, {"displayName": "LAK", "required": false, "type": "Array", "value": "LAK"}, {"displayName": "LBP", "required": false, "type": "Array", "value": "LBP"}, {"displayName": "LKR", "required": false, "type": "Array", "value": "LKR"}, {"displayName": "LRD", "required": false, "type": "Array", "value": "LRD"}, {"displayName": "LSL", "required": false, "type": "Array", "value": "LSL"}, {"displayName": "LYD", "required": false, "type": "Array", "value": "LYD"}, {"displayName": "MAD", "required": false, "type": "Array", "value": "MAD"}, {"displayName": "MDL", "required": false, "type": "Array", "value": "MDL"}, {"displayName": "MGA", "required": false, "type": "Array", "value": "MGA"}, {"displayName": "MKD", "required": false, "type": "Array", "value": "MKD"}, {"displayName": "MMK", "required": false, "type": "Array", "value": "MMK"}, {"displayName": "MNT", "required": false, "type": "Array", "value": "MNT"}, {"displayName": "MOP", "required": false, "type": "Array", "value": "MOP"}, {"displayName": "MRO", "required": false, "type": "Array", "value": "MRO"}, {"displayName": "MUR", "required": false, "type": "Array", "value": "MUR"}, {"displayName": "MVR", "required": false, "type": "Array", "value": "MVR"}, {"displayName": "MWK", "required": false, "type": "Array", "value": "MWK"}, {"displayName": "MXN", "required": false, "type": "Array", "value": "MXN"}, {"displayName": "MYR", "required": false, "type": "Array", "value": "MYR"}, {"displayName": "MZN", "required": false, "type": "Array", "value": "MZN"}, {"displayName": "NAD", "required": false, "type": "Array", "value": "NAD"}, {"displayName": "NGN", "required": false, "type": "Array", "value": "NGN"}, {"displayName": "NIO", "required": false, "type": "Array", "value": "NIO"}, {"displayName": "NOK", "required": false, "type": "Array", "value": "NOK"}, {"displayName": "NPR", "required": false, "type": "Array", "value": "NPR"}, {"displayName": "NZD", "required": false, "type": "Array", "value": "NZD"}, {"displayName": "OMR", "required": false, "type": "Array", "value": "OMR"}, {"displayName": "PAB", "required": false, "type": "Array", "value": "PAB"}, {"displayName": "PEN", "required": false, "type": "Array", "value": "PEN"}, {"displayName": "PGK", "required": false, "type": "Array", "value": "PGK"}, {"displayName": "PHP", "required": false, "type": "Array", "value": "PHP"}, {"displayName": "PKR", "required": false, "type": "Array", "value": "PKR"}, {"displayName": "PLN", "required": false, "type": "Array", "value": "PLN"}, {"displayName": "PYG", "required": false, "type": "Array", "value": "PYG"}, {"displayName": "QAR", "required": false, "type": "Array", "value": "QAR"}, {"displayName": "RON", "required": false, "type": "Array", "value": "RON"}, {"displayName": "RSD", "required": false, "type": "Array", "value": "RSD"}, {"displayName": "RUB", "required": false, "type": "Array", "value": "RUB"}, {"displayName": "RWF", "required": false, "type": "Array", "value": "RWF"}, {"displayName": "SAR", "required": false, "type": "Array", "value": "SAR"}, {"displayName": "SBD", "required": false, "type": "Array", "value": "SBD"}, {"displayName": "SCR", "required": false, "type": "Array", "value": "SCR"}, {"displayName": "SDG", "required": false, "type": "Array", "value": "SDG"}, {"displayName": "SEK", "required": false, "type": "Array", "value": "SEK"}, {"displayName": "SGD", "required": false, "type": "Array", "value": "SGD"}, {"displayName": "SHP", "required": false, "type": "Array", "value": "SHP"}, {"displayName": "SLL", "required": false, "type": "Array", "value": "SLL"}, {"displayName": "SOS", "required": false, "type": "Array", "value": "SOS"}, {"displayName": "SPL", "required": false, "type": "Array", "value": "SPL"}, {"displayName": "SRD", "required": false, "type": "Array", "value": "SRD"}, {"displayName": "STD", "required": false, "type": "Array", "value": "STD"}, {"displayName": "SVC", "required": false, "type": "Array", "value": "SVC"}, {"displayName": "SYP", "required": false, "type": "Array", "value": "SYP"}, {"displayName": "SZL", "required": false, "type": "Array", "value": "SZL"}, {"displayName": "THB", "required": false, "type": "Array", "value": "THB"}, {"displayName": "TJS", "required": false, "type": "Array", "value": "TJS"}, {"displayName": "TMT", "required": false, "type": "Array", "value": "TMT"}, {"displayName": "TND", "required": false, "type": "Array", "value": "TND"}, {"displayName": "TOP", "required": false, "type": "Array", "value": "TOP"}, {"displayName": "TRY", "required": false, "type": "Array", "value": "TRY"}, {"displayName": "TTD", "required": false, "type": "Array", "value": "TTD"}, {"displayName": "TVD", "required": false, "type": "Array", "value": "TVD"}, {"displayName": "TWD", "required": false, "type": "Array", "value": "TWD"}, {"displayName": "TZS", "required": false, "type": "Array", "value": "TZS"}, {"displayName": "UAH", "required": false, "type": "Array", "value": "UAH"}, {"displayName": "UGX", "required": false, "type": "Array", "value": "UGX"}, {"displayName": "USD", "required": false, "type": "Array", "value": "USD"}, {"displayName": "UYU", "required": false, "type": "Array", "value": "UYU"}, {"displayName": "UZS", "required": false, "type": "Array", "value": "UZS"}, {"displayName": "VEF", "required": false, "type": "Array", "value": "VEF"}, {"displayName": "VND", "required": false, "type": "Array", "value": "VND"}, {"displayName": "VUV", "required": false, "type": "Array", "value": "VUV"}, {"displayName": "WST", "required": false, "type": "Array", "value": "WST"}, {"displayName": "XAF", "required": false, "type": "Array", "value": "XAF"}, {"displayName": "XCD", "required": false, "type": "Array", "value": "XCD"}, {"displayName": "XDR", "required": false, "type": "Array", "value": "XDR"}, {"displayName": "XOF", "required": false, "type": "Array", "value": "XOF"}, {"displayName": "XPF", "required": false, "type": "Array", "value": "XPF"}, {"displayName": "YER", "required": false, "type": "Array", "value": "YER"}, {"displayName": "ZAR", "required": false, "type": "Array", "value": "ZAR"}, {"displayName": "ZMW", "required": false, "type": "Array", "value": "ZMW"}, {"displayName": "ZWD", "required": false, "type": "Array", "value": "ZWD"}], "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Can be used for Payments on Account only", "field": "Currency"}]}}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String"}}, "required": true, "type": "Object"} + MYOB AccountRight and Essentials: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A payment represents an allocation of transactions across an 'accounts receivable' account (customer)", "displayName": "Payment", "properties": {"customerRef": {"description": "Reference to the customer the payment has been sent by", "displayName": "Customer Reference", "required": true, "type": "Object", "validation": {"information": [{"details": "Must be provided.", "field": "CustomerRef"}], "warnings": []}}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": true, "type": "Object", "validation": {"information": [{"details": "Must be provided.", "field": "AccountRef"}], "warnings": []}}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "Must be provided and must equal the sum of the link items amount.", "field": "TotalAmount"}], "warnings": [{"details": "Precision must be maximum of two decimal places.", "field": "TotalAmount"}, {"details": "Must be greater than zero.", "field": "TotalAmount"}]}}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must be provided.", "field": "Date"}], "warnings": []}}, "reference": {"description": "A user friendly reference for the payment", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [{"details": "Must not be greater than 8 characters long.", "field": "Reference"}], "warnings": []}}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "options": [{"displayName": "Australian Dollar", "required": false, "type": "String", "value": "AUD"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Currency"}], "warnings": []}}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array", "validation": {"information": [{"details": "Must be provided.", "field": "Lines"}], "warnings": []}}}, "required": true, "type": "Object"} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A payment represents an allocation of transactions across an 'accounts receivable' account (customer)", "displayName": "Payment", "properties": {"customerRef": {"description": "Reference to the customer the payment has been sent by", "displayName": "Customer Reference", "required": true, "type": "Object"}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": false, "type": "Object"}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Must be greater than zero", "field": "TotalAmount"}, {"details": "Must be provided and must be equal to the sum of the lines amounts", "field": "TotalAmount"}]}}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime"}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "If the currency is set make sure it's the same as the 'Invoice' and/or 'CreditMemo' currency", "field": "Currency"}]}}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String"}, "reference": {"description": "A user friendly reference for the payment", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [{"details": "This field can be used to provide a tracking category id (Location only)", "field": "Reference"}], "warnings": [{"details": "The id format should be 'location-'", "field": "Reference"}]}}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A payment represents an allocation of transactions across an 'accounts receivable' account (customer)", "displayName": "Payment", "properties": {"customerRef": {"description": "Reference to the customer the payment has been sent by", "displayName": "Customer Reference", "required": true, "type": "Object"}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": true, "type": "Object"}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime"}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String"}, "reference": {"description": "A user friendly reference for the payment", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 20 characters.", "field": "Reference"}]}}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If not set, will default to the default currency of the customer.", "field": "Currency"}], "warnings": [{"details": "Must be a three letter ISO code that matches the currency of the customer.", "field": "Currency"}, {"details": "Can only be set if the Quickbooks Desktop company has Multicurrency enabled.", "field": "Currency"}]}}, "currencyRate": {"description": "The exchange rate between the currency of the payment and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [{"details": "If not set, will default to the rate set within QuickBooks Desktop, if no rate is set in QuickBooks Desktop, it will default to 1.", "field": "CurrencyRate"}, {"details": "Can only be set if the Quickbooks Desktop company has Multicurrency enabled.", "field": "CurrencyRate"}], "warnings": []}}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Must match the sum of amounts in the lines", "field": "TotalAmount"}]}}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A payment represents an allocation of transactions across an 'accounts receivable' account (customer)", "displayName": "Payment", "properties": {"customerRef": {"description": "Reference to the customer the payment has been sent by", "displayName": "Customer Reference", "required": true, "type": "Object", "validation": {"information": [{"details": "Must be the ID of the Customer associated with the Invoice, Credit Note or Payment On Account.", "field": "CustomerRef"}], "warnings": []}}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": false, "type": "Object", "validation": {"information": [{"details": "Must match the ID of an existing Account.", "field": "AccountRef"}], "warnings": []}}, "paymentMethodRef": {"description": "Reference to the method of this payment", "displayName": "Payment Method Reference", "required": false, "type": "Object"}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number"}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "Required if multi-currency is enabled for the company", "field": "Currency"}], "warnings": []}}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime"}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String"}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": false, "type": "Array"}}, "required": true, "type": "Object"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A payment represents an allocation of transactions across an 'accounts receivable' account (customer)", "displayName": "Payment", "properties": {"customerRef": {"description": "Reference to the customer the payment has been sent by", "displayName": "Customer Reference", "required": true, "type": "Object", "validation": {"information": [{"details": "Must be the ID of the Customer associated with the Invoice, Credit Note or Payment On Account.", "field": "CustomerRef"}], "warnings": []}}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": false, "type": "Object", "validation": {"information": [{"details": "Must match the ID of an existing Account.", "field": "AccountRef"}], "warnings": []}}, "paymentMethodRef": {"description": "Reference to the method of this payment", "displayName": "Payment Method Reference", "required": false, "type": "Object"}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number"}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "Required if multi-currency is enabled for the company", "field": "Currency"}], "warnings": []}}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime"}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String"}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": false, "type": "Array"}}, "required": true, "type": "Object"} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A payment represents an allocation of transactions across an 'accounts receivable' account (customer)", "displayName": "Payment", "properties": {"accountRef": {"description": "The bank account to pay this invoice from.", "displayName": "Bank Account", "required": true, "type": "Object"}, "customerRef": {"description": "Customer to be paid.", "displayName": "Customer", "required": true, "type": "Object"}, "totalAmount": {"description": "The total amount being paid to the customer.", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "This must equal the sum of the line amounts"}], "warnings": []}}, "reference": {"description": "The user reference for this invoice payment.", "displayName": "Reference", "required": false, "type": "Number"}, "date": {"description": "The date this payment was issued.", "displayName": "Issue Date", "required": true, "type": "Number"}, "note": {"description": "A description of the payment.", "displayName": "Note", "required": false, "type": "Number"}, "lines": {"description": "Line items of the payment.", "displayName": "Line Items", "required": true, "type": "Array", "validation": {"information": [{"details": "Sage 50 only supports one line item per invoice payment so all lines will be merged together in the response."}], "warnings": []}}}, "required": true, "type": "Object", "validation": {"information": [{"details": "Pushing to Sage 50 2015 (v21) or below is not supported. To enable push, please upgrade to at least Sage 50 2016 (v22) and re-sync the company."}], "warnings": []}} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A payment represents an allocation of transactions across an 'accounts receivable' account (customer)", "displayName": "Payment", "properties": {"accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": false, "type": "Object", "validation": {"information": [], "warnings": [{"details": "Required unless the Payment is only allocating a Credit Note.", "field": "AccountRef"}]}}, "customerRef": {"description": "Reference to the customer the payment has been sent by", "displayName": "Customer Reference", "required": true, "type": "Object"}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must be provided.", "field": "Date"}], "warnings": []}}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "Must be provided.", "field": "TotalAmount"}], "warnings": [{"details": "Must be zero when allocating against Invoices using a Credit Note only.", "field": "TotalAmount"}, {"details": "Must equal the sum of the link items amount.", "field": "TotalAmount"}]}}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Should not be longer than 25 characters.", "field": "Note"}]}}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If supplied, must match the currency of the customer.", "field": "Currency"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the payment and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number"}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A payment represents an allocation of transactions across an 'accounts receivable' account (customer)", "displayName": "Payment", "properties": {"totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "Must equal the sum of Lines.Amount.", "field": "TotalAmount"}], "warnings": []}}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String", "validation": {"information": [{"details": "Must be less than 1000 characters.", "field": "Note"}], "warnings": []}}, "paymentMethodRef": {"description": "Reference to the method of this payment", "displayName": "Payment Method Reference", "required": true, "type": "Object"}, "reference": {"description": "A user friendly reference for the payment", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [{"details": "Can be used to set the Document/Check No. in Sage Intacct.", "field": "Reference"}], "warnings": []}}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": false, "type": "String"}, "currencyRate": {"description": "The exchange rate between the currency of the payment and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [{"details": "Is required if currency is provided.", "field": "CurrencyRate"}], "warnings": []}}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must occur after the date the invoice was created.", "field": "Date"}], "warnings": []}}, "customerRef": {"description": "Reference to the customer the payment has been sent by", "displayName": "Customer Reference", "required": true, "type": "Object"}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": true, "type": "Object"}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array", "validation": {"information": [{"details": "Must contain at least one payment line.", "field": "Lines"}], "warnings": []}}}, "required": true, "type": "Object", "validation": {"information": [{"details": "Sage Intacct handles allocated payments only."}], "warnings": []}} + Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A payment represents an allocation of transactions across an 'accounts receivable' account (customer)", "displayName": "Payment", "properties": {"customerRef": {"description": "Reference to the customer the payment has been sent by", "displayName": "Customer Reference", "required": true, "type": "Object"}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": true, "type": "Object"}, "paymentMethodRef": {"description": "Reference to the method of this payment", "displayName": "Payment Method Reference", "required": true, "type": "Object"}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number"}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": true, "type": "String"}, "currencyRate": {"description": "The exchange rate between the currency of the payment and the base currency of the company", "displayName": "Currency Exchange Rate", "required": true, "type": "Number"}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime"}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": true, "type": "String"}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array"}, "reference": {"description": "A user friendly reference for the payment", "displayName": "Reference", "required": true, "type": "String"}, "metadata": {"description": "Miscellaneous data about the item", "displayName": "Metadata", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A payment represents an allocation of transactions across an 'accounts receivable' account (customer)", "displayName": "Payment", "properties": {"customerRef": {"description": "Reference to the customer the payment has been sent by", "displayName": "Customer Reference", "required": true, "type": "Object", "validation": {"information": [{"details": "Must be provided.", "field": "CustomerRef"}], "warnings": []}}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": true, "type": "Object", "validation": {"information": [{"details": "Must be provided.", "field": "AccountRef"}], "warnings": []}}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "Must be provided and must equal the sum of the link items amount.", "field": "TotalAmount"}], "warnings": [{"details": "Must be greater than 0, unless the payment is a credit note allocation.", "field": "TotalAmount"}]}}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must be provided.", "field": "Date"}], "warnings": []}}, "reference": {"description": "A user friendly reference for the payment", "displayName": "Reference", "required": false, "type": "String"}, "currencyRate": {"description": "The exchange rate between the currency of the payment and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number"}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Currency"}], "warnings": []}}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array", "validation": {"information": [{"details": "Must be provided.", "field": "Lines"}], "warnings": []}}}, "required": true, "type": "Object"} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A payment represents an allocation of transactions across an 'accounts receivable' account (customer)", "displayName": "Payment", "properties": {"accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": true, "type": "Object"}, "customerRef": {"description": "Reference to the customer the payment has been sent by", "displayName": "Customer Reference", "required": true, "type": "Object"}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "must match the currency of any invoices or credit notes", "field": "Currency"}]}}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime"}, "currencyRate": {"description": "The exchange rate between the currency of the payment and the base currency of the company", "displayName": "Currency Exchange Rate", "required": true, "type": "Number"}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String"}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [], "warnings": [{"details": "must be greater than or equal to 0", "field": "TotalAmount"}]}}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-supplier: + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"contactName": "Joe Bloggs", "id": "73593", "modifiedDate": "2022-10-23T00:00:00Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "supplierName": "test 20230420 1004"} + responses: + "200": + application/json: {"changes": [], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "642c1fc6-fe07-4241-bcdd-89dc7fa504e0", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 207565} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"addresses": [{"city": "Bakersfield", "country": "USA", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "region": "California", "type": "Billing"}], "contactName": "Kelly's Industrial Supplies", "defaultCurrency": "string", "emailAddress": "sales@kellysupplies.com", "id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-23T00:00:00Z", "phone": "07999 999999", "registrationNumber": "string", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown", "supplementalData": {"content": {"property1": {"property1": "", "property2": ""}, "property2": {"property1": "", "property2": ""}}}, "supplierName": "Kelly's Industrial Supplies", "taxNumber": "string"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-create-update-suppliers-model: + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String"}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String"}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String"}, "defaultCurrency": {"description": "The default currency for transactions recorded against the supplier", "displayName": "Default Currency", "required": false, "type": "String"}, "registrationNumber": {"description": "The supplier's registration number", "displayName": "Registration Number", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Only for Exact Netherlands, if provided, must be exactly 20 characters in length", "field": "RegistrationNumber"}]}}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String"}, "contactName": {"description": "The name of the main contact for the supplier", "displayName": "Contact Name", "required": false, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array", "validation": {"information": [{"details": "Only the first address provided will be considered, all other entries will be not be recorded", "field": "Addresses"}], "warnings": []}}}, "required": true, "type": "Object"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String"}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String"}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String"}, "defaultCurrency": {"description": "The default currency for transactions recorded against the supplier", "displayName": "Default Currency", "required": false, "type": "String"}, "registrationNumber": {"description": "The supplier's registration number", "displayName": "Registration Number", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Only for Exact Netherlands, if provided, must be exactly 20 characters in length", "field": "RegistrationNumber"}]}}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String"}, "contactName": {"description": "The name of the main contact for the supplier", "displayName": "Contact Name", "required": false, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array", "validation": {"information": [{"details": "Only the first address provided will be considered, all other entries will be not be recorded", "field": "Addresses"}], "warnings": []}}}, "required": true, "type": "Object"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String"}, "status": {"description": "The current state of the supplier", "displayName": "Supplier Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array", "validation": {"information": [{"details": "Only one address may be specified", "field": "Addresses"}], "warnings": []}}, "contactName": {"description": "The name of the main contact for the supplier", "displayName": "Contact Name", "required": false, "type": "String"}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String"}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String"}}, "required": true, "type": "Object"} + MYOB AccountRight and Essentials: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided and must contain a First and Last name separated by a ' '(space).", "field": "SupplierName"}], "warnings": [{"details": "Must not have the part after the first name longer than 30 characters.", "field": "SupplierName"}, {"details": "Must not have its first part (i.e. the first name) longer than 20 characters.", "field": "SupplierName"}]}}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String", "validation": {"information": [{"details": "Must not be longer than 255 characters.", "field": "EmailAddress"}], "warnings": []}}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String", "validation": {"information": [{"details": "Must not be longer than 21 characters.", "field": "Phone"}], "warnings": []}}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String", "validation": {"information": [{"details": "Must not be longer than 19 characters.", "field": "TaxNumber"}], "warnings": []}}, "registrationNumber": {"description": "The supplier's registration number", "displayName": "Registration Number", "required": false, "type": "String", "validation": {"information": [{"details": "Must not be longer than 14 characters.", "field": "RegistrationNumber"}], "warnings": []}}, "status": {"description": "The current state of the supplier", "displayName": "Supplier Status", "options": [{"required": false, "type": "String", "value": "Active"}, {"required": false, "type": "String", "value": "Unknown"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Status"}], "warnings": []}}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": true, "type": "Array", "validation": {"information": [{"details": "Must be provided.", "field": "Addresses"}], "warnings": [{"details": "Must only have 5 address entries at most.", "field": "Addresses"}]}}}, "required": true, "type": "Object"} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String"}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String"}, "defaultCurrency": {"description": "The default currency for transactions recorded against the supplier", "displayName": "Default Currency", "required": false, "type": "String"}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String"}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String"}, "status": {"description": "The current state of the supplier", "displayName": "Supplier Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array", "validation": {"information": [{"details": "Multiple addresses of Unknown type may be provided", "field": "Addresses"}], "warnings": [{"details": "Only one each of Billing and Delivery addresses can be provided", "field": "Addresses"}]}}}, "required": true, "type": "Object"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 41 characters.", "field": "SupplierName"}]}}, "contactName": {"description": "The name of the main contact for the supplier", "displayName": "Contact Name", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 25 characters for first and last names", "field": "ContactName"}]}}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String"}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String"}, "registrationNumber": {"description": "The supplier's registration number", "displayName": "Registration Number", "required": false, "type": "String"}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 30 characters.", "field": "TaxNumber"}]}}, "defaultCurrency": {"description": "The default currency for transactions recorded against the supplier", "displayName": "Default Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If not set, will default to the base currency of the QuickBooks Desktop company", "field": "DefaultCurrency"}], "warnings": [{"details": "Must be a three letter ISO code that matches an existing, active currency in the QuickBooks Desktop company", "field": "DefaultCurrency"}, {"details": "Can only be set if Multicurrency is enabled within the QuickBooks Desktop company", "field": "DefaultCurrency"}]}}, "status": {"description": "The current state of the supplier", "displayName": "Supplier Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array"}}, "required": true, "type": "Object"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String"}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Country, area, and number are space separated", "field": "Phone"}]}}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String"}, "registrationNumber": {"description": "The supplier's registration number", "displayName": "Registration Number", "required": false, "type": "String"}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String"}, "status": {"description": "The current state of the supplier", "displayName": "Supplier Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array"}, "defaultCurrency": {"description": "The default currency for transactions recorded against the supplier", "displayName": "Default Currency", "required": false, "type": "String"}}, "required": true, "type": "Object"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String"}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Country, area, and number are space separated", "field": "Phone"}]}}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String"}, "registrationNumber": {"description": "The supplier's registration number", "displayName": "Registration Number", "required": false, "type": "String"}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String"}, "status": {"description": "The current state of the supplier", "displayName": "Supplier Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array"}, "defaultCurrency": {"description": "The default currency for transactions recorded against the supplier", "displayName": "Default Currency", "required": false, "type": "String"}}, "required": true, "type": "Object"} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"id": {"description": "ID of the supplier.", "displayName": "Id", "required": true, "type": "String", "validation": {"information": [{"details": "The supplier ID must be all Uppercase, if it is not, it will be converted to Uppercase before pushing.", "field": "id"}], "warnings": [{"details": "The supplier ID must be unique, contain no spaces and have a maximum of 8 characters.", "field": "id"}]}}, "supplierName": {"description": "Name of the supplier.", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "The supplier name can have a maximum of 60 characters", "field": "supplierName"}]}}, "contactName": {"description": "The name of the main contact for the supplier.", "displayName": "Contact Name", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "The contact name can have a maximum of 30 characters", "field": "contactName"}]}}, "emailAddress": {"description": "The email address that the supplier may be contacted on.", "displayName": "Email Address", "required": false, "type": "String"}, "phone": {"description": "The telephone number that the supplier may be contacted on.", "displayName": "Telephone", "required": false, "type": "String"}, "defaultCurrency": {"description": "If not provided, the currency will default to the company's base currency.", "displayName": "Default Currency", "required": false, "type": "String"}, "status": {"description": "The status of the supplier.", "displayName": "Status", "options": [{"displayName": "Active Status", "required": false, "type": "String", "value": "Active"}], "required": false, "type": "String"}, "addresses": {"description": "Contact addresses for the supplier.", "displayName": "Addresses", "required": false, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Only one address can be included in the Addresses array.", "field": "addresses"}]}}, "taxNumber": {"description": "Legal company registration identifier.", "displayName": "Tax Number", "required": false, "type": "String"}}, "required": true, "type": "Object", "validation": {"information": [{"details": "Pushing to Sage 50 2015 (v21) or below is not supported. To enable push, please upgrade to at least Sage 50 2016 (v22) and re-sync the company."}], "warnings": []}} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String"}, "contactName": {"description": "The name of the main contact for the supplier", "displayName": "Contact Name", "required": false, "type": "String"}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String"}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String"}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array", "validation": {"information": [{"details": "Can contain a maximum of one address", "field": "Addresses"}], "warnings": []}}}, "required": true, "type": "Object"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be between 1 and 100 characters", "field": "SupplierName"}]}}, "contactName": {"description": "The name of the main contact for the supplier", "displayName": "Contact Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be between 1 and 200 characters", "field": "ContactName"}]}}, "status": {"description": "The current state of the supplier", "displayName": "Supplier Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be no greater than 30 characters", "field": "Phone"}]}}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be no greater than 200 characters", "field": "EmailAddress"}]}}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be no greater than 20 characters", "field": "TaxNumber"}]}}, "registrationNumber": {"description": "The supplier's registration number", "displayName": "Registration Number", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be no greater than 100 characters", "field": "RegistrationNumber"}]}}, "defaultCurrency": {"description": "The default currency for transactions recorded against the supplier", "displayName": "Default Currency", "options": [{"displayName": "Australian Dollar", "required": false, "type": "String", "value": "AUD"}, {"displayName": "Canadian Dollar", "required": false, "type": "String", "value": "CAD"}, {"displayName": "Pound Sterling", "required": false, "type": "String", "value": "GBP"}, {"displayName": "US Dollar", "required": false, "type": "String", "value": "USD"}, {"displayName": "Rand", "required": false, "type": "String", "value": "ZAR"}], "required": false, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array", "validation": {"information": [], "warnings": [{"details": "If supplied, must contain only 1 address", "field": "Addresses"}, {"details": "If TaxNumber is supplied, an Address with a Country is required", "field": "Addresses"}]}}}, "required": true, "type": "Object"} + Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String"}, "contactName": {"description": "The name of the main contact for the supplier", "displayName": "Contact Name", "required": true, "type": "String"}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": true, "type": "String"}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": true, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": true, "type": "Array"}, "registrationNumber": {"description": "The supplier's registration number", "displayName": "Registration Number", "required": true, "type": "String"}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": true, "type": "String"}, "status": {"description": "The current state of the supplier", "displayName": "Supplier Status", "required": true, "type": "String"}, "defaultCurrency": {"description": "The default currency for transactions recorded against the supplier", "displayName": "Default Currency", "required": true, "type": "String"}, "metadata": {"description": "Miscellaneous data about the item", "displayName": "Metadata", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An accounts payable contact that supplies good or services, also referred to as a vendor.", "displayName": "Suppliers", "properties": {"supplierName": {"description": "Name of the supplier.", "displayName": "Name", "required": true, "type": "String"}, "phone": {"description": "Main contact phone number for the supplier.", "displayName": "Phone", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Country, area, and number are space separated", "field": "phone"}]}}, "emailAddress": {"description": "Main contact email for the supplier.", "displayName": "Email", "required": false, "type": "String"}, "registrationNumber": {"description": "Legal company registration identifier.", "displayName": "Registration Number", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 50 characters", "field": "registrationNumber"}]}}, "taxNumber": {"description": "Legal tax registration identifier.", "displayName": "Tax Number", "required": false, "type": "String"}, "status": {"description": "Status of the supplier account.", "displayName": "Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Inactive", "required": false, "type": "String", "value": "InActive"}], "required": false, "type": "String"}, "addresses": {"description": "Contact addresses for the supplier.", "displayName": "Addresses", "required": false, "type": "Array"}}, "required": true, "type": "Object"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-transfer: + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"contactRef": {"dataType": "customers", "id": "80000028-167239230944"}, "date": "2023-01-26T11:51:18.104Z", "depositedRecordRefs": [], "description": "test transfers push 20230126 12.08", "from": {"accountRef": {"id": "80000028-1671794219"}, "amount": 12, "currency": "USD"}, "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "to": {"accountRef": {"id": "80000004-1671793811"}, "amount": 12, "currency": "EUR"}, "trackingCategoryRefs": [{"id": "80000001-1674553252", "name": "Class 1"}]} + responses: + "200": + application/json: {"changes": [], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "c6fe0724-1bcd-4d89-9c7f-a504e08333b1", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 894695} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"date": "2022-10-23T00:00:00Z", "depositedRecordRefs": [], "from": {"currency": "GBP"}, "modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "to": {"currency": "GBP"}} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-create-transfers-model: + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Transfers to or from a bank account", "displayName": "Transfer", "properties": {"description": {"description": "The description of the transfer", "displayName": "Transfer Description", "required": false, "type": "String"}, "contactRef": {"description": "The customer or supplier for this transfer if known", "displayName": "Contact Reference", "required": false, "type": "Object"}, "date": {"description": "The date the transfer occurred", "displayName": "Transfer Date", "required": true, "type": "DateTime"}, "from": {"description": "The account and amount that money was transfered from", "displayName": "Transfered From", "required": true, "type": "Object"}, "to": {"description": "The account and amount that money was transfered to", "displayName": "Transfered To", "required": true, "type": "Object"}, "trackingCategoryRefs": {"description": "A collection of categories this transfer is being tracked against", "displayName": "Tracking Category References", "required": false, "type": "Array"}}, "required": true, "type": "Object"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Transfers to or from a bank account", "displayName": "Transfer", "properties": {"description": {"description": "The description of the transfer", "displayName": "Transfer Description", "required": false, "type": "String"}, "contactRef": {"description": "The customer or supplier for this transfer if known", "displayName": "Contact Reference", "required": false, "type": "Object"}, "date": {"description": "The date the transfer occurred", "displayName": "Transfer Date", "required": true, "type": "DateTime"}, "from": {"description": "The account and amount that money was transfered from", "displayName": "Transfered From", "required": true, "type": "Object"}, "to": {"description": "The account and amount that money was transfered to", "displayName": "Transfered To", "required": true, "type": "Object"}, "trackingCategoryRefs": {"description": "A collection of categories this transfer is being tracked against", "displayName": "Tracking Category References", "required": false, "type": "Array"}}, "required": true, "type": "Object"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Transfers to or from a bank account", "displayName": "Transfer", "properties": {"date": {"description": "The date the transfer occurred", "displayName": "Transfer Date", "required": true, "type": "DateTime"}, "from": {"description": "The account and amount that money was transfered from", "displayName": "Transfered From", "required": true, "type": "Object"}, "to": {"description": "The account and amount that money was transfered to", "displayName": "Transfered To", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Transfers to or from a bank account", "displayName": "Transfer", "properties": {"description": {"description": "The description of the transfer", "displayName": "Transfer Description", "required": false, "type": "String"}, "date": {"description": "The date the transfer occurred", "displayName": "Transfer Date", "required": false, "type": "DateTime", "validation": {"information": [{"details": "Will default to today's date if not provided", "field": "Date"}], "warnings": []}}, "from": {"description": "The account and amount that money was transfered from", "displayName": "Transfered From", "required": true, "type": "Object"}, "to": {"description": "The account and amount that money was transfered to", "displayName": "Transfered To", "required": true, "type": "Object"}, "depositedRecordRefs": {"description": "A collection of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the undeposited funds (or other holding) account within this transfer.", "displayName": "Deposited Record References", "required": true, "type": "Array"}, "trackingCategoryRefs": {"description": "A collection of categories this transfer is being tracked against", "displayName": "Tracking Category References", "required": false, "type": "Array"}}, "required": true, "type": "Object", "validation": {"information": [], "warnings": [{"details": "Currently only transfers between bank accounts and undeposited funds accounts are supported"}]}} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Transfers to or from a bank account", "displayName": "Transfer", "properties": {"from": {"description": "The account and amount that money was transfered from", "displayName": "Transfered From", "required": true, "type": "Object"}, "to": {"description": "The account and amount that money was transfered to", "displayName": "Transfered To", "required": true, "type": "Object"}, "trackingCategoryRefs": {"description": "A collection of categories this transfer is being tracked against", "displayName": "Tracking Category References", "required": false, "type": "Array"}, "description": {"description": "The description of the transfer", "displayName": "Transfer Description", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 4096 characters.", "field": "Description"}]}}, "date": {"description": "The date the transfer occurred", "displayName": "Transfer Date", "required": true, "type": "DateTime"}, "contactRef": {"description": "The customer or supplier for this transfer if known", "displayName": "Contact Reference", "required": false, "type": "Object", "validation": {"information": [], "warnings": [{"details": "This value is not used in the push, and will be ignored.", "field": "ContactRef"}]}}, "sourceModifiedDate": {"description": "The date the record was last changed in the originating system", "displayName": "Source Modified Date", "required": true, "type": "DateTime"}}, "required": true, "type": "Object"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Transfers to or from a bank account", "displayName": "Transfer", "properties": {"description": {"description": "The description of the transfer", "displayName": "Transfer Description", "required": false, "type": "String"}, "from": {"description": "The account and amount that money was transfered from", "displayName": "Transfered From", "required": true, "type": "Object"}, "to": {"description": "The account and amount that money was transfered to", "displayName": "Transfered To", "required": true, "type": "Object"}, "depositedRecordRefs": {"description": "A collection of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the undeposited funds (or other holding) account within this transfer.", "displayName": "Deposited Record References", "required": false, "type": "Array"}}, "required": true, "type": "Object", "validation": {"information": [], "warnings": [{"details": "When pushing a transfer using two different currencies, the exchange rate will be calculated and passed to QuickBooks, QuickBooks performs rounding on this value which may affect the values in the transfer"}, {"details": "Transfers between accounts in different currencies can only be made if multi-currency is enabled for company"}, {"details": "The currency of at least one of the accounts used must be the same as the company's currency"}]}} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Transfers to or from a bank account", "displayName": "Transfer", "properties": {"description": {"description": "The description of the transfer", "displayName": "Transfer Description", "required": false, "type": "String"}, "from": {"description": "The account and amount that money was transfered from", "displayName": "Transfered From", "required": true, "type": "Object"}, "to": {"description": "The account and amount that money was transfered to", "displayName": "Transfered To", "required": true, "type": "Object"}, "depositedRecordRefs": {"description": "A collection of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the undeposited funds (or other holding) account within this transfer.", "displayName": "Deposited Record References", "required": false, "type": "Array"}}, "required": true, "type": "Object", "validation": {"information": [], "warnings": [{"details": "When pushing a transfer using two different currencies, the exchange rate will be calculated and passed to QuickBooks, QuickBooks performs rounding on this value which may affect the values in the transfer"}, {"details": "Transfers between accounts in different currencies can only be made if multi-currency is enabled for company"}, {"details": "The currency of at least one of the accounts used must be the same as the company's currency"}]}} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Transfers to or from a bank account", "displayName": "Transfer", "properties": {"description": {"description": "The description of the transfer", "displayName": "Transfer Description", "required": false, "type": "String", "validation": {"information": [{"details": "Must not be longer than 2000 characters.", "field": "Description"}], "warnings": [{"details": "Must be provided if pushing a bank deposit.", "field": "Description"}]}}, "date": {"description": "The date the transfer occurred", "displayName": "Transfer Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must be provided.", "field": "Date"}], "warnings": []}}, "from": {"description": "The account and amount that money was transfered from", "displayName": "Transfered From", "required": true, "type": "Object"}, "to": {"description": "The account and amount that money was transfered to", "displayName": "Transfered To", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Transfers to or from a bank account", "displayName": "Transfer", "properties": {"description": {"description": "The description of the transfer", "displayName": "Transfer Description", "required": true, "type": "String"}, "contactRef": {"description": "The customer or supplier for this transfer if known", "displayName": "Contact Reference", "required": true, "type": "Object"}, "date": {"description": "The date the transfer occurred", "displayName": "Transfer Date", "required": true, "type": "DateTime"}, "from": {"description": "The account and amount that money was transfered from", "displayName": "Transfered From", "required": true, "type": "Object"}, "to": {"description": "The account and amount that money was transfered to", "displayName": "Transfered To", "required": true, "type": "Object"}, "trackingCategoryRefs": {"description": "A collection of categories this transfer is being tracked against", "displayName": "Tracking Category References", "required": true, "type": "Array"}, "depositedRecordRefs": {"description": "A collection of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the undeposited funds (or other holding) account within this transfer.", "displayName": "Deposited Record References", "required": true, "type": "Array"}, "metadata": {"description": "Miscellaneous data about the item", "displayName": "Metadata", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Transfers to or from a bank account", "displayName": "Transfer", "properties": {"date": {"description": "The date the transfer occurred", "displayName": "Transfer Date", "required": true, "type": "DateTime"}, "from": {"description": "The account and amount that money was transfered from", "displayName": "Transfered From", "required": true, "type": "Object"}, "to": {"description": "The account and amount that money was transfered to", "displayName": "Transfered To", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-create-operation: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + pushOperationKey: "b18d8d81-fd7b-4764-a31e-475cb1f36591" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-create-operations: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-accounting-account: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Current", "fullyQualifiedName": "Asset.Current.Accounts Receivable", "id": "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", "isBankAccount": false, "modifiedDate": "2023-04-26T12:38:15Z", "name": "Accounts Receivable", "nominalCode": "610", "sourceModifiedDate": "2022-12-10T16:39:00", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": " .", "fullyQualifiedName": "..", "id": "8eaed16d-c69f-ec11-80f1-0022481b4546", "isBankAccount": false, "modifiedDate": "2023-03-27T14:21:18Z", "name": "", "nominalCode": "45422026-68CA-4EF2-9", "sourceModifiedDate": "2022-03-09T16:31:54Z", "status": "Active", "type": "Unknown", "validDatatypeLinks": [{"links": ["DirectCost.LineItems.AccountRef.Id"], "property": "Id"}]} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "EUR", "currentBalance": 864435.44, "description": "Debiteuren", "fullyQualifiedCategory": "Asset.Assets.AccountsReceivable", "fullyQualifiedName": "Asset.Assets.AccountsReceivable.Debiteuren.PaymentsEnabled", "id": "ef2fde36-4416-4bc5-b239-315b2929348c", "isBankAccount": false, "modifiedDate": "2022-10-26T13:36:17Z", "name": "Debiteuren", "nominalCode": "1300", "sourceModifiedDate": "2020-01-08T09:42:54Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Transfer.To.AccountRef.Id", "Transfer.From.AccountRef.Id", "Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 0, "description": "Some thing account", "fullyQualifiedCategory": "Asset.Assets.AccountsReceivable", "fullyQualifiedName": "Asset.Assets.AccountsReceivable.Some thing account.PaymentsEnabled", "id": "ca2b96b7-cc45-4e35-9fa3-82a2ba1eec40", "isBankAccount": false, "modifiedDate": "2022-10-26T13:35:15Z", "name": "Some thing account", "nominalCode": "THING", "sourceModifiedDate": "2017-08-01T17:31:12Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Transfer.To.AccountRef.Id", "Transfer.From.AccountRef.Id", "Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Capital", "fullyQualifiedName": "Asset.Capital.Capital Asset Brought Forward", "id": "601", "isBankAccount": false, "modifiedDate": "2023-04-25T14:19:12Z", "name": "Capital Asset Brought Forward", "nominalCode": "601", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 51445.53, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset", "fullyQualifiedName": "Asset.Accounts Receivable", "id": "67357", "isBankAccount": false, "modifiedDate": "2023-03-24T16:07:24Z", "name": "Accounts Receivable", "nominalCode": "1200", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.BankAccount", "fullyQualifiedName": "Asset.BankAccount.16th Account", "id": "27840056", "isBankAccount": true, "modifiedDate": "2022-09-30T10:29:16Z", "name": "16th Account", "nominalCode": "70700", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "EUR", "currentBalance": -635.55, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "AcctPay.AcctPay", "fullyQualifiedName": "AcctPay.AcctPay.Accounts Payable", "id": "111", "isBankAccount": false, "modifiedDate": "2023-01-30T14:48:33Z", "name": "Accounts Payable", "nominalCode": "610", "sourceModifiedDate": "2021-08-11T12:51:21", "status": "Active", "type": "Liability", "validDatatypeLinks": []} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 93007.93, "description": "Accounts Receivable", "fullyQualifiedCategory": "Asset.CurrentAsset.AccountsReceivable", "fullyQualifiedName": "Asset.CurrentAsset.AccountsReceivable.Accounts Receivable", "id": "40000-933270541", "isBankAccount": false, "modifiedDate": "2023-04-26T09:06:23Z", "name": "Accounts Receivable", "nominalCode": "11000", "sourceModifiedDate": "2023-12-16T05:06:45", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 41289.37, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Accounts Receivable.AccountsReceivable", "fullyQualifiedName": "Asset.Accounts Receivable.AccountsReceivable.Debtors", "id": "62", "isBankAccount": false, "modifiedDate": "2023-01-18T11:02:34Z", "name": "Debtors", "nominalCode": "246", "sourceModifiedDate": "2022-12-08T15:42:59Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 3041173.77, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Accounts Receivable.AccountsReceivable", "fullyQualifiedName": "Asset.Accounts Receivable.AccountsReceivable.Debtors", "id": "70", "isBankAccount": false, "modifiedDate": "2023-04-26T09:35:55Z", "name": "Debtors", "nominalCode": "610", "sourceModifiedDate": "2023-04-26T01:18:15Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "USD", "currentBalance": 0, "description": "Bank Account", "fullyQualifiedCategory": "Asset.Bank Account", "fullyQualifiedName": "Asset.Bank Account.Bank Account", "id": "2864", "isBankAccount": false, "modifiedDate": "2022-10-14T09:35:52Z", "name": "Bank Account", "nominalCode": "1200", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Archived", "type": "Asset", "validDatatypeLinks": []} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 90640.61, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.CurrentAssets.Debtors", "fullyQualifiedName": "Asset.CurrentAssets.Debtors.Debtors Control Account", "id": "1100", "isBankAccount": false, "modifiedDate": "2023-03-30T14:42:44Z", "name": "Debtors Control Account", "nominalCode": "1100", "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 49.61, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Bank", "fullyQualifiedName": "Asset.Bank.Abdi Internet Bank", "id": "e5889b459f544926ac5b8e6756df2ad4", "isBankAccount": true, "modifiedDate": "2022-10-24T14:52:53Z", "name": "Abdi Internet Bank", "nominalCode": "1560", "sourceModifiedDate": "2020-01-27T10:53:26Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Assets.Current Assets.Account Receivable, Net of Allowance.Accounts Receivable.Accounts Receivable", "fullyQualifiedName": "Assets.Current Assets.Account Receivable, Net of Allowance.Accounts Receivable.Accounts Receivable.Accounts Receivable", "id": "2", "isBankAccount": false, "modifiedDate": "2023-04-04T16:31:51Z", "name": "Accounts Receivable", "nominalCode": "12100", "sourceModifiedDate": "2020-01-29T01:42:43", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 0, "description": "Test Balance Sheet", "fullyQualifiedCategory": "Asset.CashAndBank", "fullyQualifiedName": "Asset.CashAndBank.Abdi Bank", "id": "QWNjb3VudDo5MjIzNDE3NjkzMzk3NjA2MzM7QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2", "isBankAccount": true, "modifiedDate": "2022-11-16T18:15:17Z", "name": "Abdi Bank", "nominalCode": "610", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 924.25, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Bank", "fullyQualifiedName": "Asset.Bank.Business Bank Account", "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "isBankAccount": true, "modifiedDate": "2023-03-15T20:35:08Z", "name": "Business Bank Account", "nominalCode": "A090", "sourceModifiedDate": "2023-02-17T11:10:49", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Payment.AccountRef.Id", "BillPayment.AccountRef.Id", "DirectIncome.LineItems.AccountRef.Id", "DirectCost.LineItems.AccountRef.Id"], "property": "Id"}]} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": -959.64, "description": "The money that customers owe you becomes the accounts receivable. A good example of this is a payment expected from an invoice sent to your customer.", "fullyQualifiedCategory": "Asset.accounts_receivable", "fullyQualifiedName": "Asset.accounts_receivable.Accounts Receivable", "id": "104957000000000352", "isBankAccount": false, "modifiedDate": "2022-10-03T08:40:43Z", "name": "Accounts Receivable", "nominalCode": "", "sourceModifiedDate": "2020-02-05T14:58:44", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounting-accounts: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Current", "fullyQualifiedName": "Asset.Current.Accounts Receivable", "id": "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:15Z", "name": "Accounts Receivable", "nominalCode": "610", "sourceModifiedDate": "2022-12-10T16:39:00", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 0, "description": "A provision anticipating that a portion of accounts receivable will never be collected.", "fullyQualifiedCategory": "Asset.Current", "fullyQualifiedName": "Asset.Current.Accounts Receivable", "id": "76d5f23b-9623-4e3b-89cd-da57228764d3", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:15Z", "name": "Accounts Receivable", "nominalCode": "611", "sourceModifiedDate": "2022-10-19T05:49:00", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 98} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": " .", "fullyQualifiedName": "..", "id": "8eaed16d-c69f-ec11-80f1-0022481b4546", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:18Z", "name": "", "nominalCode": "45422026-68CA-4EF2-9", "sourceModifiedDate": "2022-03-09T16:31:54Z", "status": "Active", "type": "Unknown", "validDatatypeLinks": [{"links": ["DirectCost.LineItems.AccountRef.Id"], "property": "Id"}]}, {"currency": "GBP", "currentBalance": 27.34, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": " .", "fullyQualifiedName": "..Account no cat Balance Sheet", "id": "c0861a65-c69f-ec11-80f1-0022481b4546", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:18Z", "name": "Account no cat Balance Sheet", "nominalCode": "10", "sourceModifiedDate": "2022-09-13T14:45:01Z", "status": "Active", "type": "Unknown", "validDatatypeLinks": [{"links": ["DirectCost.LineItems.AccountRef.Id"], "property": "Id"}]}], "totalResults": 122} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "EUR", "currentBalance": 864435.44, "description": "Debiteuren", "fullyQualifiedCategory": "Asset.Assets.AccountsReceivable", "fullyQualifiedName": "Asset.Assets.AccountsReceivable.Debiteuren.PaymentsEnabled", "id": "ef2fde36-4416-4bc5-b239-315b2929348c", "isBankAccount": false, "modifiedDate": "2022-10-26T13:36:17Z", "name": "Debiteuren", "nominalCode": "1300", "sourceModifiedDate": "2020-01-08T09:42:54Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Transfer.To.AccountRef.Id", "Transfer.From.AccountRef.Id", "Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]}, {"currency": "EUR", "currentBalance": 2174.82, "description": "One more AR account", "fullyQualifiedCategory": "Asset.Assets.AccountsReceivable", "fullyQualifiedName": "Asset.Assets.AccountsReceivable.One more AR account.PaymentsEnabled", "id": "2052b65b-20e9-4da1-85d8-fd5ca0ea3d38", "isBankAccount": false, "modifiedDate": "2022-10-26T13:36:17Z", "name": "One more AR account", "nominalCode": "888777888", "sourceModifiedDate": "2021-06-10T11:00:20Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Transfer.To.AccountRef.Id", "Transfer.From.AccountRef.Id", "Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]}], "totalResults": 230} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 0, "description": "Some thing account", "fullyQualifiedCategory": "Asset.Assets.AccountsReceivable", "fullyQualifiedName": "Asset.Assets.AccountsReceivable.Some thing account.PaymentsEnabled", "id": "ca2b96b7-cc45-4e35-9fa3-82a2ba1eec40", "isBankAccount": false, "modifiedDate": "2022-10-26T13:35:15Z", "name": "Some thing account", "nominalCode": "THING", "sourceModifiedDate": "2017-08-01T17:31:12Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Transfer.To.AccountRef.Id", "Transfer.From.AccountRef.Id", "Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]}, {"currency": "GBP", "currentBalance": 4484655.39, "description": "Trade Debtors", "fullyQualifiedCategory": "Asset.Assets.AccountsReceivable", "fullyQualifiedName": "Asset.Assets.AccountsReceivable.Trade Debtors.PaymentsEnabled", "id": "cf9572e7-8afa-4339-9113-af32a66d9df9", "isBankAccount": false, "modifiedDate": "2022-10-26T13:35:15Z", "name": "Trade Debtors", "nominalCode": "15400", "sourceModifiedDate": "2020-01-08T13:48:38Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Transfer.To.AccountRef.Id", "Transfer.From.AccountRef.Id", "Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]}], "totalResults": 121} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Capital", "fullyQualifiedName": "Asset.Capital.Capital Asset Brought Forward", "id": "601", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "name": "Capital Asset Brought Forward", "nominalCode": "601", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Capital", "fullyQualifiedName": "Asset.Capital.Capital Asset Depreciation Brought Forward", "id": "605", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "name": "Capital Asset Depreciation Brought Forward", "nominalCode": "605", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 292} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 51445.53, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset", "fullyQualifiedName": "Asset.Accounts Receivable", "id": "67357", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:24Z", "name": "Accounts Receivable", "nominalCode": "1200", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 51445.53, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Accounts Receivable", "fullyQualifiedName": "Asset.Accounts Receivable.Accounts Receivable", "id": "128611", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:24Z", "name": "Accounts Receivable", "nominalCode": "1200-1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 96} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.BankAccount", "fullyQualifiedName": "Asset.BankAccount.16th Account", "id": "27840056", "isBankAccount": true, "modifiedDate": "2022-09-30T10:29:16Z", "name": "16th Account", "nominalCode": "70700", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.BankAccount", "fullyQualifiedName": "Asset.BankAccount.1a1a", "id": "27840049", "isBankAccount": true, "modifiedDate": "2022-09-30T10:29:16Z", "name": "1a1a", "nominalCode": "70600", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 157} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": -635.55, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "AcctPay.AcctPay", "fullyQualifiedName": "AcctPay.AcctPay.Accounts Payable", "id": "111", "isBankAccount": false, "modifiedDate": "2023-01-30T14:48:33Z", "name": "Accounts Payable", "nominalCode": "610", "sourceModifiedDate": "2021-08-11T12:51:21", "status": "Active", "type": "Liability", "validDatatypeLinks": []}, {"currency": "USD", "currentBalance": -565, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "AcctRec.AcctRec", "fullyQualifiedName": "AcctRec.AcctRec.Accounts Receivable", "id": "119", "isBankAccount": false, "modifiedDate": "2023-01-30T14:48:33Z", "name": "Accounts Receivable", "nominalCode": "610", "sourceModifiedDate": "2021-09-08T15:23:31", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 44} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 93007.93, "description": "Accounts Receivable", "fullyQualifiedCategory": "Asset.CurrentAsset.AccountsReceivable", "fullyQualifiedName": "Asset.CurrentAsset.AccountsReceivable.Accounts Receivable", "id": "40000-933270541", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:06:23Z", "name": "Accounts Receivable", "nominalCode": "11000", "sourceModifiedDate": "2023-12-16T05:06:45", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 46954.1, "description": "Cash", "fullyQualifiedCategory": "Asset.CurrentAsset.Bank", "fullyQualifiedName": "Asset.CurrentAsset.Bank.Checking", "id": "20000-933270541", "isBankAccount": true, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:06:23Z", "name": "Checking", "nominalCode": "10100", "sourceModifiedDate": "2023-12-16T05:06:45", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["BillLineItem.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]}], "totalResults": 116} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 41289.37, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Accounts Receivable.AccountsReceivable", "fullyQualifiedName": "Asset.Accounts Receivable.AccountsReceivable.Debtors", "id": "62", "isBankAccount": false, "modifiedDate": "2023-01-18T11:02:34Z", "name": "Debtors", "nominalCode": "246", "sourceModifiedDate": "2022-12-08T15:42:59Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "AED", "currentBalance": -1533.44, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Accounts Receivable.AccountsReceivable", "fullyQualifiedName": "Asset.Accounts Receivable.AccountsReceivable.Debtors - AED", "id": "92", "isBankAccount": false, "modifiedDate": "2023-01-18T11:02:34Z", "name": "Debtors - AED", "nominalCode": "247", "sourceModifiedDate": "2021-02-19T14:04:45Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 234} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 3041173.77, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Accounts Receivable.AccountsReceivable", "fullyQualifiedName": "Asset.Accounts Receivable.AccountsReceivable.Debtors", "id": "70", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:55Z", "name": "Debtors", "nominalCode": "610", "sourceModifiedDate": "2023-04-26T01:18:15Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "USD", "currentBalance": 54822.37, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Accounts Receivable.AccountsReceivable", "fullyQualifiedName": "Asset.Accounts Receivable.AccountsReceivable.Debtors - USD", "id": "80", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:55Z", "name": "Debtors - USD", "nominalCode": "610", "sourceModifiedDate": "2023-04-12T15:10:38Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 186} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 0, "description": "Bank Account", "fullyQualifiedCategory": "Asset.Bank Account", "fullyQualifiedName": "Asset.Bank Account.Bank Account", "id": "2864", "isBankAccount": false, "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-14T09:35:52Z", "name": "Bank Account", "nominalCode": "1200", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Archived", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 0, "description": "Bank Current Account", "fullyQualifiedCategory": "Asset.Bank Account", "fullyQualifiedName": "Asset.Bank Account.Bank Current Account", "id": "2368", "isBankAccount": true, "modifiedDate": "2022-10-14T09:35:52Z", "name": "Bank Current Account", "nominalCode": "1200", "sourceModifiedDate": "2020-09-11T13:53:12Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 344} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 90640.61, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.CurrentAssets.Debtors", "fullyQualifiedName": "Asset.CurrentAssets.Debtors.Debtors Control Account", "id": "1100", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:44Z", "name": "Debtors Control Account", "nominalCode": "1100", "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.CurrentAssets.Debtors", "fullyQualifiedName": "Asset.CurrentAssets.Debtors.Other Debtors", "id": "1102", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:44Z", "name": "Other Debtors", "nominalCode": "1102", "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 155} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 49.61, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Bank", "fullyQualifiedName": "Asset.Bank.Abdi Internet Bank", "id": "e5889b459f544926ac5b8e6756df2ad4", "isBankAccount": true, "modifiedDate": "2022-10-24T14:52:53Z", "name": "Abdi Internet Bank", "nominalCode": "1560", "sourceModifiedDate": "2020-01-27T10:53:26Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]}, {"currency": "GBP", "currentBalance": 225830.75, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Bank", "fullyQualifiedName": "Asset.Bank.Abdi Live Test", "id": "b17083bc9b2748b4ab321b024e260eda", "isBankAccount": true, "modifiedDate": "2022-10-24T14:52:53Z", "name": "Abdi Live Test", "nominalCode": "147852", "sourceModifiedDate": "2020-01-28T14:00:20Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]}], "totalResults": 283} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Assets.Current Assets.Account Receivable, Net of Allowance.Accounts Receivable.Accounts Receivable", "fullyQualifiedName": "Assets.Current Assets.Account Receivable, Net of Allowance.Accounts Receivable.Accounts Receivable.Accounts Receivable", "id": "2", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:51Z", "name": "Accounts Receivable", "nominalCode": "12100", "sourceModifiedDate": "2020-01-29T01:42:43", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Assets.Current Assets.Account Receivable, Net of Allowance.Accounts Receivable.Accounts Receivable", "fullyQualifiedName": "Assets.Current Assets.Account Receivable, Net of Allowance.Accounts Receivable.Accounts Receivable.AR - Retainage", "id": "155", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:51Z", "name": "AR - Retainage", "nominalCode": "12710", "sourceModifiedDate": "2020-10-15T15:33:15", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 181} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 0, "description": "Test Balance Sheet", "fullyQualifiedCategory": "Asset.CashAndBank", "fullyQualifiedName": "Asset.CashAndBank.Abdi Bank", "id": "QWNjb3VudDo5MjIzNDE3NjkzMzk3NjA2MzM7QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2", "isBankAccount": true, "modifiedDate": "2022-11-16T18:15:17Z", "name": "Abdi Bank", "nominalCode": "610", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 0, "description": "Cash you haven�t deposited in the bank. Add your bank and credit card accounts to accurately categorize transactions that aren't cash.", "fullyQualifiedCategory": "Asset.CashAndBank", "fullyQualifiedName": "Asset.CashAndBank.Cash on Hand", "id": "QWNjb3VudDo3OTE3NTA1OTcwOTQxNzQ3MTU7QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2", "isBankAccount": true, "modifiedDate": "2022-11-16T18:15:17Z", "name": "Cash on Hand", "nominalCode": "610", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 85} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 924.25, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Bank", "fullyQualifiedName": "Asset.Bank.Business Bank Account", "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "isBankAccount": true, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:35:08Z", "name": "Business Bank Account", "nominalCode": "A090", "sourceModifiedDate": "2023-02-17T11:10:49", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Payment.AccountRef.Id", "BillPayment.AccountRef.Id", "DirectIncome.LineItems.AccountRef.Id", "DirectCost.LineItems.AccountRef.Id"], "property": "Id"}]}, {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Bank", "fullyQualifiedName": "Asset.Bank.Business Savings Account", "id": "a8d6fb1a-8c5d-4683-90ce-bf9d28fc62ba", "isBankAccount": true, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:35:08Z", "name": "Business Savings Account", "nominalCode": "A091", "sourceModifiedDate": "2023-02-17T11:10:49", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Payment.AccountRef.Id", "BillPayment.AccountRef.Id", "DirectIncome.LineItems.AccountRef.Id", "DirectCost.LineItems.AccountRef.Id"], "property": "Id"}]}], "totalResults": 90} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": -959.64, "description": "The money that customers owe you becomes the accounts receivable. A good example of this is a payment expected from an invoice sent to your customer.", "fullyQualifiedCategory": "Asset.accounts_receivable", "fullyQualifiedName": "Asset.accounts_receivable.Accounts Receivable", "id": "104957000000000352", "isBankAccount": false, "modifiedDate": "2022-10-03T08:40:43Z", "name": "Accounts Receivable", "nominalCode": "", "sourceModifiedDate": "2020-02-05T14:58:44", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 69858.44, "description": "", "fullyQualifiedCategory": "Asset.bank", "fullyQualifiedName": "Asset.bank.Abdi Test", "id": "104957000000060010", "isBankAccount": true, "modifiedDate": "2022-10-03T08:40:43Z", "name": "Abdi Test", "nominalCode": "", "sourceModifiedDate": "2020-02-17T12:19:47", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 68} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-accounting-balance-sheet: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2018-04-01T00:00:00", "mostRecentAvailableMonth": "2023-03-31T00:00:00", "reports": [{"assets": {"accountId": "", "name": "Assets", "value": 4643976.27}, "date": "2023-03-31T00:00:00", "equity": {"accountId": "", "name": "Equity", "value": 3460178.96}, "liabilities": {"accountId": "", "name": "Liabilities", "value": 1183797.31}, "netAssets": 3460178.96}, {"assets": {"accountId": "", "name": "Assets", "value": 4599890.71}, "date": "2023-02-28T00:00:00", "equity": {"accountId": "", "name": "Equity", "value": 3449628.19}, "liabilities": {"accountId": "", "name": "Liabilities", "value": 1150262.51}, "netAssets": 3449628.2}]} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2022-09-01T00:00:00", "mostRecentAvailableMonth": "2023-03-31T00:00:00", "reports": [{"assets": {"name": "Assets", "value": 260454.26}, "date": "2023-03-27T00:00:00", "equity": {"name": "Equity", "value": 160732.41}, "liabilities": {"name": "Liabilities", "value": 99721.85}, "netAssets": 160732.41}, {"assets": {"name": "Assets", "value": 262531.32}, "date": "2023-02-28T00:00:00", "equity": {"name": "Equity", "value": 162851.32}, "liabilities": {"name": "Liabilities", "value": 99680}, "netAssets": 162851.32}]} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2022-10-23T00:00:00Z", "mostRecentAvailableMonth": "2022-10-23T00:00:00Z", "reports": []} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2022-04-01T00:00:00", "mostRecentAvailableMonth": "2022-10-31T00:00:00", "reports": [{"assets": {"name": "Assets", "value": -2}, "date": "2022-10-31T00:00:00Z", "equity": {"name": "Equities", "value": -2}, "liabilities": {"items": [], "name": "Liabilities", "value": 0}, "netAssets": -2}, {"assets": {"name": "Assets", "value": 208}, "date": "2022-09-30T00:00:00Z", "equity": {"name": "Equities", "value": 208}, "liabilities": {"name": "Liabilities", "value": 0}, "netAssets": 208}]} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2022-10-01T00:00:00", "mostRecentAvailableMonth": "2023-04-30T00:00:00", "reports": [{"assets": {"name": "assets", "value": 38416.28}, "date": "2023-04-30T00:00:00", "equity": {"name": "equity", "value": 29105.56}, "liabilities": {"name": "liabilities", "value": 9310.72}, "netAssets": 29105.56}, {"assets": {"name": "assets", "value": 38416.28}, "date": "2023-03-31T00:00:00", "equity": {"name": "equity", "value": 29105.56}, "liabilities": {"name": "liabilities", "value": 9310.72}, "netAssets": 29105.56}]} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2022-03-01T00:00:00", "mostRecentAvailableMonth": "2022-09-30T00:00:00", "reports": [{"assets": {"name": "Assets", "value": 109979.14}, "date": "2022-09-30T00:00:00", "equity": {"name": "Equity", "value": 29792.05}, "liabilities": {"name": "Liabilities", "value": 80187.1}, "netAssets": 29792.04}, {"assets": {"name": "Assets", "value": 109979.14}, "date": "2022-08-31T00:00:00", "equity": {"name": "Equity", "value": 29792.05}, "liabilities": {"name": "Liabilities", "value": 80187.1}, "netAssets": 29792.04}]} + MYOB AccountRight and Essentials: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2022-05-01T00:00:00", "mostRecentAvailableMonth": "2022-11-30T00:00:00", "reports": [{"assets": {"items": [], "name": "Assets", "value": 0}, "date": "2022-11-30T00:00:00", "equity": {"items": [], "name": "Equity", "value": 0}, "liabilities": {"items": [], "name": "Liabilities", "value": 0}, "netAssets": 0}, {"assets": {"items": [], "name": "Assets", "value": 0}, "date": "2022-10-31T00:00:00", "equity": {"items": [], "name": "Equity", "value": 0}, "liabilities": {"items": [], "name": "Liabilities", "value": 0}, "netAssets": 0}]} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2022-11-01T00:00:00", "mostRecentAvailableMonth": "2023-05-31T00:00:00", "reports": [{"assets": {"accountId": "", "name": "Assets", "value": 703}, "date": "2023-05-31T00:00:00", "equity": {"accountId": "", "name": "Equity", "value": 67.45}, "liabilities": {"accountId": "", "name": "Liabilities", "value": 635.55}, "netAssets": 67.45}, {"assets": {"accountId": "", "name": "Assets", "value": 703}, "date": "2023-04-30T00:00:00", "equity": {"accountId": "", "name": "Equity", "value": 67.45}, "liabilities": {"accountId": "", "name": "Liabilities", "value": 635.55}, "netAssets": 67.45}]} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2022-10-01T00:00:00", "mostRecentAvailableMonth": "2023-04-30T00:00:00", "reports": [{"assets": {"name": "ASSETS", "value": 549695.86}, "date": "2023-04-30T00:00:00", "equity": {"name": "Equity", "value": 98196.66}, "liabilities": {"name": "Liabilities", "value": 451499.2}, "netAssets": 98196.66}, {"assets": {"name": "ASSETS", "value": 547971.05}, "date": "2023-03-31T00:00:00", "equity": {"name": "Equity", "value": 94670.3}, "liabilities": {"name": "Liabilities", "value": 453300.75}, "netAssets": 94670.3}]} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2022-10-01T00:00:00", "mostRecentAvailableMonth": "2023-04-30T00:00:00", "reports": [{"assets": {"name": "Assets", "value": 3856584.88}, "date": "2023-04-30T00:00:00", "equity": {"name": "Equity", "value": 3687115.17}, "liabilities": {"name": "Liabilities", "value": 169469.71}, "netAssets": 3687115.17}, {"assets": {"name": "Assets", "value": 4385453.25}, "date": "2023-03-31T00:00:00", "equity": {"name": "Equity", "value": 3686084.31}, "liabilities": {"name": "Liabilities", "value": 699368.94}, "netAssets": 3686084.31}]} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "USD", "earliestAvailableMonth": "2022-10-23T00:00:00Z", "mostRecentAvailableMonth": "2022-10-23T00:00:00Z", "reports": []} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2021-04-01T00:00:00", "mostRecentAvailableMonth": "2023-03-31T00:00:00", "reports": [{"assets": {"name": "Assets", "value": 239322.69}, "date": "2023-03-31T00:00:00", "equity": {"name": "Equity", "value": 141326.64}, "liabilities": {"name": "Liabilities", "value": 97996.05}, "netAssets": 141326.64}, {"assets": {"name": "Assets", "value": 239322.69}, "date": "2023-02-28T00:00:00", "equity": {"name": "Equity", "value": 141326.64}, "liabilities": {"name": "Liabilities", "value": 97996.05}, "netAssets": 141326.64}]} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2022-04-01T00:00:00", "mostRecentAvailableMonth": "2022-10-31T00:00:00", "reports": [{"assets": {"name": "Assets", "value": 1740591.73}, "date": "2022-10-31T00:00:00", "equity": {"name": "Equities", "value": -171344025.76}, "liabilities": {"name": "Liabilities", "value": 173084617.49}, "netAssets": -171344025.76}, {"assets": {"name": "Assets", "value": 1748139.93}, "date": "2022-09-30T00:00:00", "equity": {"name": "Equities", "value": -159734278.59}, "liabilities": {"name": "Liabilities", "value": 161482418.52}, "netAssets": -159734278.59}]} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2022-05-01T00:00:00", "mostRecentAvailableMonth": "2022-11-30T00:00:00", "reports": [{"assets": {"name": "Assets", "value": 2220.87}, "date": "2022-11-30T00:00:00", "equity": {"name": "Equity", "value": -2420.28}, "liabilities": {"name": "Liabilities", "value": 4641.15}, "netAssets": -2420.28}, {"assets": {"name": "Assets", "value": 2222.22}, "date": "2022-10-31T00:00:00", "equity": {"name": "Equity", "value": -1863.93}, "liabilities": {"name": "Liabilities", "value": 4086.15}, "netAssets": -1863.93}]} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2022-09-01T00:00:00", "mostRecentAvailableMonth": "2023-03-31T00:00:00", "reports": [{"assets": {"name": "Assets", "value": 24166.8}, "date": "2023-03-31T23:59:59", "equity": {"name": "Equity", "value": 9901.07}, "liabilities": {"name": "Liabilities", "value": 14265.73}, "netAssets": 9901.07}, {"assets": {"name": "Assets", "value": 24166.8}, "date": "2023-02-28T23:59:59", "equity": {"name": "Equity", "value": 9901.07}, "liabilities": {"name": "Liabilities", "value": 14265.73}, "netAssets": 9901.07}]} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2022-04-01T00:00:00", "mostRecentAvailableMonth": "2022-10-31T00:00:00", "reports": [{"assets": {"name": "Assets", "value": 63170.61}, "date": "2022-10-31T00:00:00", "equity": {"name": "Equities", "value": 54555.22}, "liabilities": {"name": "Liabilities", "value": 8615.39}, "netAssets": 54555.22}, {"assets": {"name": "Assets", "value": 63170.61}, "date": "2022-09-01T00:00:00", "equity": {"name": "Equities", "value": 54555.22}, "liabilities": {"name": "Liabilities", "value": 8615.39}, "netAssets": 54555.22}]} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-categorized-balance-sheet-statement: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "29-09-2020" + responses: + "200": + application/json: {"reportInfo": {"companyName": "Biscuits", "currency": "GBP", "generatedDate": "2023-03-24T16:42:09.2973105Z", "reportName": "EnhancedBalanceSheetAccounts"}, "reportItems": [{"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Asset"}, {"confidence": 99.99, "levelName": "Current"}, {"confidence": 99.99, "levelName": "AccruedDeferredAssets"}, {"confidence": 99.99, "levelName": "PrepaidExpenses"}], "status": "Suggested"}, "accountId": "22de1660-d745-4809-a363-16b134607e66", "accountName": "Prepayments", "balance": 12973.03, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Asset"}, {"confidence": 99.99, "levelName": "Current"}, {"confidence": 99.99, "levelName": "Bank"}], "status": "Suggested"}, "accountId": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "accountName": "Business Current Account", "balance": 316065.92, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Asset"}, {"confidence": 99.99, "levelName": "Current"}, {"confidence": 99.99, "levelName": "Inventory"}], "status": "Suggested"}, "accountId": "e5d7612c-1671-47b4-b733-5db48363fcd0", "accountName": "Inventory", "balance": 65945.07, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Asset"}, {"confidence": 99.99, "levelName": "Current"}, {"confidence": 99.99, "levelName": "Receivables"}, {"confidence": 99.99, "levelName": "AccountsReceivables"}], "status": "Suggested"}, "accountId": "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", "accountName": "Accounts Receivable", "balance": 71937.95, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Asset"}, {"confidence": 99.99, "levelName": "NonCurrent"}, {"confidence": 99.99, "levelName": "AccumulatedDepreciationDepletionAmortization"}], "status": "Suggested"}, "accountId": "724ca578-8b5d-4bdb-ad45-e3820eee9de9", "accountName": "Office Equipment", "balance": 2180148.56, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Asset"}, {"confidence": 99.99, "levelName": "NonCurrent"}, {"confidence": 99.99, "levelName": "AccumulatedDepreciationDepletionAmortization"}], "status": "Suggested"}, "accountId": "be3eb911-034b-42de-95db-0d58ac978b7f", "accountName": "Computer Equipment", "balance": 1804674.9, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Equity"}, {"confidence": 99.99, "levelName": "RetainedEarnings"}, {"confidence": 99.99, "levelName": "CapitalIncomeReserve"}], "status": "Suggested"}, "accountId": "39225d6f-3722-4508-ac3f-a2f6ec96ad31", "accountName": "Retained Earnings", "balance": 3417424.16, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Equity"}, {"confidence": 99.99, "levelName": "ShareCapital"}, {"confidence": 99.99, "levelName": "CommonStock"}], "status": "Suggested"}, "accountId": "78828dd9-6008-4662-b43c-e9d87907fd2b", "accountName": "Current Year Earnings", "balance": 44252.52, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Liability"}, {"confidence": 99.99, "levelName": "Current"}, {"confidence": 99.99, "levelName": "AccountsPayable"}], "status": "Suggested"}, "accountId": "53bf27a7-7497-4c61-9887-dfaad5c6d80a", "accountName": "Accounts Payable", "balance": 75835.64, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Liability"}, {"confidence": 99.99, "levelName": "Current"}, {"confidence": 99.99, "levelName": "AccruedLiabilities"}], "status": "Suggested"}, "accountId": "e2530acd-91c8-48f8-a35f-935dbd7432e2", "accountName": "Accruals", "balance": 208264.65, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Liability"}, {"confidence": 99.99, "levelName": "Current"}, {"confidence": 99.99, "levelName": "Bank"}], "status": "Suggested"}, "accountId": "d19852a2-e292-4eb9-a909-9dadb95c0e76", "accountName": "Rounding", "balance": 0, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Liability"}, {"confidence": 99.99, "levelName": "Current"}, {"confidence": 99.99, "levelName": "Debt"}, {"confidence": 99.99, "levelName": "CreditCards"}], "status": "Suggested"}, "accountId": "62060aae-e5a6-4db5-a3bb-6abec6d47959", "accountName": "Credit Card Control Account", "balance": 25184.57, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Liability"}, {"confidence": 99.99, "levelName": "Current"}, {"confidence": 99.99, "levelName": "Debt"}, {"confidence": 99.99, "levelName": "LoansPayable"}], "status": "Suggested"}, "accountId": "9be6382f-6b33-402d-b448-0db1dbf67a98", "accountName": "Historical Adjustment", "balance": 9650.58, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Liability"}, {"confidence": 99.99, "levelName": "Current"}, {"confidence": 99.99, "levelName": "Debt"}, {"confidence": 99.99, "levelName": "LoansPayable"}], "status": "Suggested"}, "accountId": "8636effc-50fb-45ba-8b2b-18336fa29b6b", "accountName": "John Smith", "balance": 2022.41, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Liability"}, {"confidence": 99.99, "levelName": "Current"}, {"confidence": 99.99, "levelName": "Personnel"}, {"confidence": 99.99, "levelName": "PensionPayable"}], "status": "Confirmed"}, "accountId": "3a872b81-d1af-4d31-9bfa-a37280b8f68c", "accountName": "VAT", "balance": 29034.75, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Liability"}, {"confidence": 99.99, "levelName": "Current"}, {"confidence": 99.99, "levelName": "Personnel"}, {"confidence": 99.99, "levelName": "PensionPayable"}], "status": "Confirmed"}, "accountId": "3b58f7ff-fa16-453a-9931-f020816d76e7", "accountName": "Interest Payables", "balance": 1076.55, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Liability"}, {"confidence": 99.99, "levelName": "NonCurrent"}], "status": "Suggested"}, "accountId": "8852a857-aa9d-4706-839f-638e9d6b5a66", "accountName": "Unpaid Expense Claims", "balance": 0, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Liability"}, {"confidence": 99.99, "levelName": "NonCurrent"}], "status": "Suggested"}, "accountId": "55008233-40e7-41ac-84af-2255fa028c2e", "accountName": "Loan", "balance": 638999.6, "date": "2022-08-31T00:00:00"}]} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "29-09-2020" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-accounting-cash-flow-statement: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2019-03-01T00:00:00", "mostRecentAvailableMonth": "2021-02-28T00:00:00", "reportBasis": "Cash", "reportInput": "Direct", "reports": [{"cashPayments": {"accountId": "cashPayments", "name": "Cash Payments", "value": 12377.81}, "cashReceipts": {"accountId": "cashReceipts", "name": "Cash Receipts", "value": 18377.72}, "fromDate": "2021-02-01T00:00:00", "toDate": "2021-02-28T00:00:00"}, {"cashPayments": {"accountId": "cashPayments", "name": "Cash Payments", "value": 18902.85}, "cashReceipts": {"accountId": "cashReceipts", "name": "Cash Receipts", "value": 14508.56}, "fromDate": "2021-01-01T00:00:00", "toDate": "2021-01-31T00:00:00"}]} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2021-05-01T00:00:00", "mostRecentAvailableMonth": "2023-04-30T00:00:00", "reportBasis": "Cash", "reportInput": "Indirect", "reports": [{"cashPayments": {"accountId": "CashPayments", "items": [], "name": "CashPayments", "value": 0}, "cashReceipts": {"accountId": "CashReceipts", "items": [], "name": "CashReceipts", "value": 0}, "fromDate": "2023-04-01T00:00:00", "toDate": "2023-04-30T00:00:00"}, {"cashPayments": {"accountId": "CashPayments", "items": [], "name": "CashPayments", "value": 0}, "cashReceipts": {"accountId": "CashReceipts", "items": [], "name": "CashReceipts", "value": 0}, "fromDate": "2023-03-01T00:00:00", "toDate": "2023-03-31T00:00:00"}]} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2021-05-01T00:00:00", "mostRecentAvailableMonth": "2023-04-30T00:00:00", "reportBasis": "Cash", "reportInput": "Direct", "reports": [{"cashPayments": {"accountId": "cashPayments", "name": "Cash Payments", "value": -987.94}, "cashReceipts": {"accountId": "cashReceipts", "name": "Cash Receipts", "value": 754.59}, "fromDate": "2023-04-01T00:00:00", "toDate": "2023-04-30T00:00:00"}, {"cashPayments": {"accountId": "cashPayments", "name": "Cash Payments", "value": 2494.43}, "cashReceipts": {"accountId": "cashReceipts", "name": "Cash Receipts", "value": 1776.25}, "fromDate": "2023-03-01T00:00:00", "toDate": "2023-03-31T00:00:00"}]} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2021-02-01T00:00:00", "mostRecentAvailableMonth": "2023-01-31T00:00:00", "reportBasis": "Cash", "reportInput": "Direct", "reports": [{"cashPayments": {"accountId": "cashPayments", "name": "Cash Payments", "value": 4300}, "cashReceipts": {"accountId": "cashReceipts", "items": [], "name": "Cash Receipts", "value": 0}, "fromDate": "2023-01-01T00:00:00", "toDate": "2023-01-31T00:00:00"}, {"cashPayments": {"accountId": "cashPayments", "name": "Cash Payments", "value": 10}, "cashReceipts": {"accountId": "cashReceipts", "items": [], "name": "Cash Receipts", "value": 0}, "fromDate": "2022-12-01T00:00:00", "toDate": "2022-12-31T00:00:00"}]} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2021-04-01T00:00:00", "mostRecentAvailableMonth": "2023-03-31T00:00:00", "reportBasis": "Cash", "reportInput": "Direct", "reports": [{"cashPayments": {"accountId": "cashPayment", "items": [], "name": "Cash Payments", "value": 0}, "cashReceipts": {"accountId": "cashReceipt", "items": [], "name": "Cash Receipts", "value": 0}, "fromDate": "2023-03-01T00:00:00", "toDate": "2023-03-31T23:59:59.9999999"}, {"cashPayments": {"accountId": "cashPayment", "items": [], "name": "Cash Payments", "value": 0}, "cashReceipts": {"accountId": "cashReceipt", "items": [], "name": "Cash Receipts", "value": 0}, "fromDate": "2023-02-01T00:00:00", "toDate": "2023-02-28T23:59:59.9999999"}]} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2019-11-01T00:00:00", "mostRecentAvailableMonth": "2022-10-31T00:00:00", "reportBasis": "Accrual", "reportInput": "Indirect", "reports": [{"cashPayments": {"accountId": "payments", "name": "Cash Payments", "value": 0}, "cashReceipts": {"accountId": "receipts", "name": "Cash Receipts", "value": 0}, "fromDate": "2022-10-01T00:00:00", "toDate": "2022-10-31T00:00:00"}, {"cashPayments": {"accountId": "payments", "name": "Cash Payments", "value": 7}, "cashReceipts": {"accountId": "receipts", "name": "Cash Receipts", "value": -5}, "fromDate": "2022-09-01T00:00:00", "toDate": "2022-09-30T00:00:00"}]} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-profit-and-loss: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2018-04-01T00:00:00", "mostRecentAvailableMonth": "2023-03-01T00:00:00", "reportBasis": "Unknown", "reports": [{"costOfSales": {"accountId": "", "name": "Cost of Sales", "value": 29955.45}, "expenses": {"accountId": "", "name": "Expenses", "value": 62407.18}, "fromDate": "2023-03-01T00:00:00", "grossProfit": 116884.97, "income": {"accountId": "", "name": "Income", "value": 146840.42}, "netOperatingProfit": 54477.79, "netOtherIncome": 499.78, "netProfit": 54977.57, "otherExpenses": {"accountId": "", "name": "Other Expenses", "value": 350.44}, "otherIncome": {"accountId": "", "name": "Other Income", "value": 850.22}, "toDate": "2023-03-31T00:00:00"}, {"costOfSales": {"accountId": "", "name": "Cost of Sales", "value": 18438.51}, "expenses": {"accountId": "", "name": "Expenses", "value": 46096.28}, "fromDate": "2023-02-01T00:00:00", "grossProfit": 90023.3, "income": {"accountId": "", "name": "Income", "value": 108461.81}, "netOperatingProfit": 43927.02, "netOtherIncome": 499.78, "netProfit": 44426.8, "otherExpenses": {"accountId": "", "name": "Other Expenses", "value": 350.44}, "otherIncome": {"accountId": "", "name": "Other Income", "value": 850.22}, "toDate": "2023-02-28T00:00:00"}]} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2021-04-01T00:00:00", "mostRecentAvailableMonth": "2023-03-01T00:00:00", "reportBasis": "Accrual", "reports": [{"costOfSales": {"name": "Cost of Goods Sold", "value": 2735.64}, "expenses": {"name": "Expense", "value": 41.77}, "fromDate": "2023-03-01T00:00:00", "grossProfit": -2077.14, "income": {"name": "Income", "value": 658.5}, "netOperatingProfit": -2118.91, "netOtherIncome": 0, "netProfit": -2118.91, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2023-03-31T00:00:00"}, {"costOfSales": {"name": "Cost of Goods Sold", "value": 328}, "expenses": {"name": "Expense", "value": 1482.02}, "fromDate": "2023-02-01T00:00:00", "grossProfit": 86.51, "income": {"name": "Income", "value": 414.51}, "netOperatingProfit": -1395.51, "netOtherIncome": 0, "netProfit": -1395.51, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2023-02-28T00:00:00"}]} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "EUR", "earliestAvailableMonth": "2020-11-01T00:00:00", "mostRecentAvailableMonth": "2022-09-01T00:00:00", "reportBasis": "Unknown", "reports": [{"costOfSales": {"items": [], "name": "Cost of Sales", "value": 0}, "expenses": {"items": [], "name": "Expenses", "value": 0}, "fromDate": "2022-09-01T00:00:00Z", "grossProfit": -286, "income": {"name": "Income", "value": -286}, "netOperatingProfit": -286, "netOtherIncome": -5.25, "netProfit": -291.25, "otherExpenses": {"name": "Other Expenses", "value": 5.25}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2022-09-30T00:00:00Z"}, {"costOfSales": {"items": [], "name": "Cost of Sales", "value": 0}, "expenses": {"name": "Expenses", "value": 13.6}, "fromDate": "2022-08-01T00:00:00Z", "grossProfit": 664.73, "income": {"name": "Income", "value": 664.73}, "netOperatingProfit": 651.13, "netOtherIncome": -45, "netProfit": 606.13, "otherExpenses": {"name": "Other Expenses", "value": 45}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2022-08-31T00:00:00Z"}]} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2020-11-01T00:00:00", "mostRecentAvailableMonth": "2022-10-01T00:00:00", "reportBasis": "Unknown", "reports": [{"costOfSales": {"items": [], "name": "Cost of Sales", "value": 0}, "expenses": {"items": [], "name": "Expenses", "value": 0}, "fromDate": "2022-10-01T00:00:00Z", "grossProfit": -2, "income": {"name": "Income", "value": -2}, "netOperatingProfit": -2, "netOtherIncome": 0, "netProfit": -2, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2022-10-31T00:00:00Z"}, {"costOfSales": {"items": [], "name": "Cost of Sales", "value": 0}, "expenses": {"items": [], "name": "Expenses", "value": 0}, "fromDate": "2022-09-01T00:00:00Z", "grossProfit": 208, "income": {"name": "Income", "value": 208}, "netOperatingProfit": 208, "netOtherIncome": 0, "netProfit": 208, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2022-09-30T00:00:00Z"}]} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2021-05-01T00:00:00", "mostRecentAvailableMonth": "2023-04-01T00:00:00", "reportBasis": "Cash", "reports": [{"costOfSales": {"items": [], "name": "Cost of Sales", "value": 0}, "expenses": {"items": [], "name": "Expenses", "value": 0}, "fromDate": "2023-04-01T00:00:00", "grossProfit": 0, "income": {"items": [], "name": "Income", "value": 0}, "netOperatingProfit": 0, "netOtherIncome": 0, "netProfit": 0, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2023-04-30T00:00:00"}, {"costOfSales": {"items": [], "name": "Cost of Sales", "value": 0}, "expenses": {"name": "Expenses", "value": 24.05}, "fromDate": "2023-03-01T00:00:00", "grossProfit": 0, "income": {"items": [], "name": "Income", "value": 0}, "netOperatingProfit": -24.05, "netOtherIncome": 0, "netProfit": -24.04, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2023-03-31T00:00:00"}]} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2020-10-01T00:00:00", "mostRecentAvailableMonth": "2022-09-01T00:00:00", "reportBasis": "Unknown", "reports": [{"costOfSales": {"items": [], "name": "Cost Of Sales", "value": 0}, "expenses": {"items": [], "name": "Expenses", "value": 0}, "fromDate": "2022-09-01T00:00:00", "grossProfit": 0, "income": {"items": [], "name": "Income", "value": 0}, "netOperatingProfit": 0, "netOtherIncome": 0, "netProfit": 0, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2022-09-30T00:00:00"}, {"costOfSales": {"items": [], "name": "Cost Of Sales", "value": 0}, "expenses": {"items": [], "name": "Expenses", "value": 0}, "fromDate": "2022-08-01T00:00:00", "grossProfit": 0, "income": {"items": [], "name": "Income", "value": 0}, "netOperatingProfit": 0, "netOtherIncome": 0, "netProfit": 0, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2022-08-31T00:00:00"}]} + MYOB AccountRight and Essentials: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2020-12-01T00:00:00", "mostRecentAvailableMonth": "2022-11-01T00:00:00", "reportBasis": "Accrual", "reports": [{"costOfSales": {"items": [], "name": "Cost of Sales", "value": 0}, "expenses": {"items": [], "name": "Expenses", "value": 0}, "fromDate": "2022-11-01T00:00:00", "grossProfit": 0, "income": {"items": [], "name": "Income", "value": 0}, "netOperatingProfit": 0, "netOtherIncome": 0, "netProfit": 0, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2022-11-30T00:00:00"}, {"costOfSales": {"items": [], "name": "Cost of Sales", "value": 0}, "expenses": {"items": [], "name": "Expenses", "value": 0}, "fromDate": "2022-10-01T00:00:00", "grossProfit": 0, "income": {"items": [], "name": "Income", "value": 0}, "netOperatingProfit": 0, "netOtherIncome": 0, "netProfit": 0, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2022-10-31T00:00:00"}]} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2022-11-01T00:00:00", "mostRecentAvailableMonth": "2023-03-01T00:00:00", "reportBasis": "Accrual", "reports": [{"costOfSales": {"items": [], "name": "Cost of Sales", "value": 0}, "expenses": {"name": "Expenses", "value": -123.45}, "fromDate": "2023-03-01T00:00:00", "grossProfit": 0, "income": {"items": [], "name": "Income", "value": 0}, "netOperatingProfit": 123.45, "netOtherIncome": 0, "netProfit": 123.45, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2023-03-31T00:00:00"}, {"costOfSales": {"items": [], "name": "Cost of Sales", "value": 0}, "expenses": {"name": "Expenses", "value": 11}, "fromDate": "2023-01-01T00:00:00", "grossProfit": 11, "income": {"name": "Income", "value": 11}, "netOperatingProfit": 0, "netOtherIncome": 0, "netProfit": 0, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2023-01-31T00:00:00"}]} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2021-05-01T00:00:00", "mostRecentAvailableMonth": "2023-04-01T00:00:00", "reportBasis": "Accrual", "reports": [{"costOfSales": {"name": "Cost of Goods Sold", "value": 1729.85}, "expenses": {"name": "Expense", "value": 2417.29}, "fromDate": "2023-04-01T00:00:00", "grossProfit": 5943.65, "income": {"name": "Income", "value": 7673.5}, "netOperatingProfit": 3526.36, "netOtherIncome": 0, "netProfit": 3526.36, "otherExpenses": {"items": [], "name": "Other Expense", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2023-04-30T00:00:00"}, {"costOfSales": {"name": "Cost of Goods Sold", "value": 7500}, "expenses": {"name": "Expense", "value": 3159.99}, "fromDate": "2023-03-01T00:00:00", "grossProfit": 9000, "income": {"name": "Income", "value": 16500}, "netOperatingProfit": 5840.01, "netOtherIncome": 93.42, "netProfit": 5933.43, "otherExpenses": {"items": [], "name": "Other Expense", "value": 0}, "otherIncome": {"name": "Other Income", "value": 93.42}, "toDate": "2023-03-31T00:00:00"}]} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2021-05-01T00:00:00", "mostRecentAvailableMonth": "2023-04-01T00:00:00", "reportBasis": "Accrual", "reports": [{"costOfSales": {"name": "Cost of Sales", "value": -8.16}, "expenses": {"name": "Expenses", "value": -987}, "fromDate": "2023-04-01T00:00:00", "grossProfit": 43.86, "income": {"name": "Income", "value": 35.7}, "netOperatingProfit": 1030.86, "netOtherIncome": 0, "netProfit": 1030.86, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2023-04-30T00:00:00"}, {"costOfSales": {"name": "Cost of Sales", "value": 2568.09}, "expenses": {"name": "Expenses", "value": 397.62}, "fromDate": "2023-03-01T00:00:00", "grossProfit": -903.16, "income": {"name": "Income", "value": 1664.93}, "netOperatingProfit": -1300.78, "netOtherIncome": 17.49, "netProfit": -1283.29, "otherExpenses": {"name": "Other Expenses", "value": 11.92}, "otherIncome": {"name": "Other Income", "value": 29.41}, "toDate": "2023-03-31T00:00:00"}]} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2021-02-01T00:00:00", "mostRecentAvailableMonth": "2023-01-01T00:00:00", "reportBasis": "Accrual", "reports": [{"costOfSales": {"items": [], "name": "Cost of Sales", "value": 0}, "expenses": {"name": "Expenses", "value": 4300}, "fromDate": "2023-01-01T00:00:00", "grossProfit": 0, "income": {"items": [], "name": "Income", "value": 0}, "netOperatingProfit": -4300, "netOtherIncome": 0, "netProfit": -4300, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2023-01-31T00:00:00"}, {"costOfSales": {"items": [], "name": "Cost of Sales", "value": 0}, "expenses": {"name": "Expenses", "value": 10}, "fromDate": "2022-12-01T00:00:00", "grossProfit": 0, "income": {"items": [], "name": "Income", "value": 0}, "netOperatingProfit": -10, "netOtherIncome": 0, "netProfit": -10, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2022-12-31T00:00:00"}]} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2015-01-01T00:00:00", "mostRecentAvailableMonth": "2020-12-01T00:00:00", "reportBasis": "Accrual", "reports": [{"costOfSales": {"name": "Cost of Sales", "value": 0}, "expenses": {"name": "Expenses", "value": 0}, "fromDate": "2020-12-01T00:00:00Z", "grossProfit": 0, "income": {"name": "Income", "value": 0}, "netOperatingProfit": 0, "netOtherIncome": 0, "netProfit": 0, "otherExpenses": {"name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2020-12-31T00:00:00Z"}, {"costOfSales": {"name": "Cost of Sales", "value": 0}, "expenses": {"name": "Expenses", "value": 0}, "fromDate": "2020-11-01T00:00:00Z", "grossProfit": 0, "income": {"name": "Income", "value": 0}, "netOperatingProfit": 0, "netOtherIncome": 0, "netProfit": 0, "otherExpenses": {"name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2020-11-30T00:00:00Z"}]} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2021-04-01T00:00:00", "mostRecentAvailableMonth": "2023-03-01T00:00:00", "reportBasis": "Unknown", "reports": [{"costOfSales": {"items": [], "name": "Cost of Sales", "value": 0}, "expenses": {"items": [], "name": "Expenses", "value": 0}, "fromDate": "2023-03-01T00:00:00", "grossProfit": 0, "income": {"items": [], "name": "Income", "value": 0}, "netOperatingProfit": 0, "netOtherIncome": 0, "netProfit": 0, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2023-03-31T00:00:00"}, {"costOfSales": {"items": [], "name": "Cost of Sales", "value": 0}, "expenses": {"items": [], "name": "Expenses", "value": 0}, "fromDate": "2023-02-01T00:00:00", "grossProfit": 0, "income": {"items": [], "name": "Income", "value": 0}, "netOperatingProfit": 0, "netOtherIncome": 0, "netProfit": 0, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2023-02-28T00:00:00"}]} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2020-11-01T00:00:00", "mostRecentAvailableMonth": "2022-10-01T00:00:00", "reportBasis": "Unknown", "reports": [{"costOfSales": {"name": "Cost of Sales", "value": 11602000}, "expenses": {"name": "Expenses", "value": -1.83}, "fromDate": "2022-10-01T00:00:00", "grossProfit": -11609749, "income": {"name": "Income", "value": -7749}, "netOperatingProfit": -11609747.17, "netOtherIncome": 0, "netProfit": -11609747.17, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2022-10-31T00:00:00"}, {"costOfSales": {"name": "Cost of Sales", "value": 13220073.7}, "expenses": {"items": [], "name": "Expenses", "value": 0}, "fromDate": "2022-09-01T00:00:00", "grossProfit": -13219572.7, "income": {"name": "Income", "value": 501}, "netOperatingProfit": -13219572.7, "netOtherIncome": -148.34, "netProfit": -13219721.04, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"name": "Other Income", "value": -148.34}, "toDate": "2022-09-30T00:00:00"}]} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2020-12-01T00:00:00", "mostRecentAvailableMonth": "2022-11-01T00:00:00", "reportBasis": "Accrual", "reports": [{"costOfSales": {"items": [], "name": "Cost of Goods Sold", "value": 0}, "expenses": {"name": "Operating Expenses", "value": 555}, "fromDate": "2022-11-01T00:00:00", "grossProfit": 7.01, "income": {"name": "Income", "value": 7.01}, "netOperatingProfit": -547.99, "netOtherIncome": 0, "netProfit": -547.99, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2022-11-30T00:00:00"}, {"costOfSales": {"items": [], "name": "Cost of Goods Sold", "value": 0}, "expenses": {"items": [], "name": "Operating Expenses", "value": 0}, "fromDate": "2022-10-01T00:00:00", "grossProfit": 8.36, "income": {"name": "Income", "value": 8.36}, "netOperatingProfit": 8.36, "netOtherIncome": 0, "netProfit": 8.36, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2022-10-31T00:00:00"}]} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2021-04-01T00:00:00", "mostRecentAvailableMonth": "2023-03-01T00:00:00", "reportBasis": "Accrual", "reports": [{"costOfSales": {"items": [], "name": "Cost of Sales", "value": 0}, "expenses": {"items": [], "name": "Expenses", "value": 0}, "fromDate": "2023-03-01T00:00:00", "grossProfit": 0, "income": {"items": [], "name": "Income", "value": 0}, "netOperatingProfit": 0, "netOtherIncome": 0, "netProfit": 0, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2023-03-31T00:00:00"}, {"costOfSales": {"name": "Cost of Sales", "value": 700}, "expenses": {"name": "Expenses", "value": 2026.92}, "fromDate": "2023-02-01T00:00:00", "grossProfit": 13796.51, "income": {"name": "Income", "value": 14496.51}, "netOperatingProfit": 11769.59, "netOtherIncome": 0, "netProfit": 11769.59, "otherExpenses": {"items": [], "name": "Other Expenses", "value": 0}, "otherIncome": {"items": [], "name": "Other Income", "value": 0}, "toDate": "2023-02-28T00:00:00"}]} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "200": + application/json: {"currency": "GBP", "earliestAvailableMonth": "2020-11-01T00:00:00", "mostRecentAvailableMonth": "2022-10-01T00:00:00", "reportBasis": "Accrual", "reports": [{"costOfSales": {"name": "Cost of Goods Sold", "value": 0}, "expenses": {"name": "Operating Expense", "value": 0}, "fromDate": "2022-10-01T00:00:00", "grossProfit": 0, "income": {"name": "Operating Income", "value": 0}, "netOperatingProfit": 0, "netOtherIncome": 0, "netProfit": 0, "otherExpenses": {"name": "Non Operating Expense", "value": 0}, "otherIncome": {"name": "Non Operating Income", "value": 0}, "toDate": "2022-10-31T00:00:00"}, {"costOfSales": {"name": "Cost of Goods Sold", "value": 35}, "expenses": {"name": "Operating Expense", "value": 69}, "fromDate": "2022-09-01T00:00:00", "grossProfit": 34, "income": {"name": "Operating Income", "value": 69}, "netOperatingProfit": -35, "netOtherIncome": 0, "netProfit": -35, "otherExpenses": {"name": "Non Operating Expense", "value": 0}, "otherIncome": {"name": "Non Operating Income", "value": 0}, "toDate": "2022-09-30T00:00:00"}]} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + periodLength: 4 + periodsToCompare: 20 + startMonth: "2022-10-23T00:00:00Z" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-categorized-profit-and-loss-statement: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "29-09-2020" + responses: + "200": + application/json: {"reportInfo": {"companyName": "Biscuits", "currency": "GBP", "generatedDate": "2023-03-24T16:40:59.0847354Z", "reportName": "EnhancedProfitAndLossAccounts"}, "reportItems": [{"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}], "status": "Suggested"}, "accountId": "04f7111b-55d4-4efc-b329-1bd5c791933a", "accountName": "Repairs & Maintenance", "balance": 830.93, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "CostOfSales"}], "status": "Suggested"}, "accountId": "7f6a0e92-65be-4333-9a0a-d981b03bedd1", "accountName": "Wages", "balance": 12000, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "CostOfSales"}, {"confidence": 99.99, "levelName": "Inventory"}], "status": "Suggested"}, "accountId": "7403e960-5b72-42ff-abf4-c870ad8910bd", "accountName": "Purchases", "balance": 28937.71, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "CostOfSales"}, {"confidence": 99.99, "levelName": "Inventory"}], "status": "Suggested"}, "accountId": "e8a0a24e-2dab-46b1-bfe1-6e92551c04e8", "accountName": "Purchase Discounts", "balance": 582.4, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "NonOperating"}, {"confidence": 99.99, "levelName": "Donations"}], "status": "Suggested"}, "accountId": "cbf82e0d-87a7-464d-b567-9274ea94a1c0", "accountName": "Charitable and Political Donations", "balance": 350.44, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "NonOperating"}, {"confidence": 99.99, "levelName": "Interest"}], "status": "Suggested"}, "accountId": "78785fd7-f197-4c34-aa17-6e76b9255d34", "accountName": "Interest Paid (operating)", "balance": 535.81, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "NonOperating"}, {"confidence": 99.99, "levelName": "Taxes"}, {"confidence": 99.99, "levelName": "CorporationTaxes"}], "status": "Suggested"}, "accountId": "fb3210ef-edeb-48af-bb49-b85d40c1e6bb", "accountName": "Corporation Tax", "balance": 633.05, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "Operating"}, {"confidence": 99.99, "levelName": "BankCharges"}], "status": "Suggested"}, "accountId": "f3aa84fe-5c31-4107-b207-7e0419f636d7", "accountName": "Bank Fees", "balance": 782.61, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "Operating"}, {"confidence": 99.99, "levelName": "Leases"}, {"confidence": 99.99, "levelName": "BuildingRentLease"}], "status": "Suggested"}, "accountId": "9cbe5fe4-ca60-4792-8bf1-de01fb7010aa", "accountName": "Rent", "balance": 8000, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "Operating"}, {"confidence": 99.99, "levelName": "Leases"}, {"confidence": 99.99, "levelName": "EquipmentRentLease"}], "status": "Suggested"}, "accountId": "138a8eb3-5c08-4e59-a3bc-892119694447", "accountName": "Motor Vehicle Expenses", "balance": 1090.68, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "Operating"}, {"confidence": 99.99, "levelName": "Marketing"}], "status": "Suggested"}, "accountId": "868591ad-f9c2-4956-a5ec-c32c1d48c6f3", "accountName": "Advertising & Marketing", "balance": 26307.02, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "Operating"}, {"confidence": 99.99, "levelName": "Marketing"}], "status": "Suggested"}, "accountId": "1734ff00-2a17-45b4-8db6-2dc2e832c460", "accountName": "Postage, Freight & Courier", "balance": 1128.85, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "Operating"}, {"confidence": 99.99, "levelName": "Marketing"}], "status": "Suggested"}, "accountId": "7d8d0322-f452-47de-a8e8-54b0130e6f38", "accountName": "Subscriptions", "balance": 40, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "Operating"}, {"confidence": 99.99, "levelName": "NonCash"}, {"confidence": 99.99, "levelName": "Amortization"}], "status": "Suggested"}, "accountId": "4378ddba-36b4-4b35-9970-bd972b20d137", "accountName": "Amortization", "balance": 5.72, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "Operating"}, {"confidence": 99.99, "levelName": "NonCash"}, {"confidence": 99.99, "levelName": "Depreciation"}], "status": "Suggested"}, "accountId": "940c8a59-3348-4a0b-a1b1-781d9f29cc8b", "accountName": "Depreciation Expense", "balance": 1539.18, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "Operating"}, {"confidence": 99.99, "levelName": "Personnel"}, {"confidence": 99.99, "levelName": "EmployeeBenefits"}], "status": "Suggested"}, "accountId": "e7ac3baa-cfbe-40c1-a172-83d22e84435b", "accountName": "Entertainment-100% business", "balance": 1416.05, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "Operating"}, {"confidence": 99.99, "levelName": "SalesGeneralAdministrative"}], "status": "Suggested"}, "accountId": "b5e801e8-8dbc-4390-ac99-3b0fff54a89f", "accountName": "General Expenses", "balance": 1465.61, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "Operating"}, {"confidence": 99.99, "levelName": "SalesGeneralAdministrative"}], "status": "Suggested"}, "accountId": "5360066d-1474-49f6-a7a5-c66d5f6032ba", "accountName": "Light, Power, Heating", "balance": 7347.35, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "Operating"}, {"confidence": 99.99, "levelName": "SalesGeneralAdministrative"}], "status": "Suggested"}, "accountId": "7aa7988a-ff61-4cb8-bef3-15395355d108", "accountName": "Printing & Stationery", "balance": 1027.25, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "Operating"}, {"confidence": 99.99, "levelName": "SalesGeneralAdministrative"}], "status": "Suggested"}, "accountId": "043b6bcb-dfe6-4c97-9b4c-f9b300fe3f03", "accountName": "Telephone & Internet", "balance": 45, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "Operating"}, {"confidence": 99.99, "levelName": "SalesGeneralAdministrative"}], "status": "Suggested"}, "accountId": "eef78ed1-dfed-447c-bdba-3a49fb2c044b", "accountName": "Audit & Accountancy fees", "balance": 0, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "Operating"}, {"confidence": 99.99, "levelName": "SalesGeneralAdministrative"}], "status": "Suggested"}, "accountId": "c16f5c35-8283-47da-9d09-5fecb183b0cb", "accountName": "Cleaning", "balance": 130, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Expense"}, {"confidence": 99.99, "levelName": "Operating"}, {"confidence": 99.99, "levelName": "Travel"}], "status": "Suggested"}, "accountId": "df62060b-41cc-4bf2-9de7-c7e537b5663a", "accountName": "Travel - National", "balance": 860.02, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Income"}, {"confidence": 99.99, "levelName": "Revenue"}, {"confidence": 99.99, "levelName": "Online"}], "status": "Suggested"}, "accountId": "68794a8f-b22d-4520-b97b-025b7cb10f94", "accountName": "Other Revenue", "balance": 850.22, "date": "2022-08-31T00:00:00"}, {"accountCategory": {"levels": [{"confidence": 99.99, "levelName": "Income"}, {"confidence": 99.99, "levelName": "Revenue"}, {"confidence": 99.99, "levelName": "Wholesale"}], "status": "Suggested"}, "accountId": "72df89d2-512b-4455-af51-a6b563733842", "accountName": "Sales", "balance": 138457.98, "date": "2022-08-31T00:00:00"}]} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportDate: "29-09-2020" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-data-status: + Example: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"accountTransactions": {"currentStatus": "Complete", "dataType": "accountTransactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "balanceSheet": {"currentStatus": "Complete", "dataType": "balanceSheet", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "bankAccounts": {"currentStatus": "Complete", "dataType": "bankAccounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "bankTransactions": {"currentStatus": "Complete", "dataType": "bankTransactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "banking-accountBalances": {"currentStatus": "Complete", "dataType": "banking-accountBalances", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "banking-accounts": {"currentStatus": "Complete", "dataType": "banking-accounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "banking-transactionCategories": {"currentStatus": "Complete", "dataType": "banking-transactionCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "banking-transactions": {"currentStatus": "Complete", "dataType": "banking-transactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "billCreditNotes": {"currentStatus": "Complete", "dataType": "billCreditNotes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "billPayments": {"currentStatus": "Complete", "dataType": "billPayments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "bills": {"currentStatus": "Complete", "dataType": "bills", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "cashFlowStatement": {"currentStatus": "Complete", "dataType": "cashFlowStatement", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "chartOfAccounts": {"currentStatus": "Complete", "dataType": "chartOfAccounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-companyInfo": {"currentStatus": "Complete", "dataType": "commerce-companyInfo", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-customers": {"currentStatus": "Complete", "dataType": "commerce-customers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-disputes": {"currentStatus": "Complete", "dataType": "commerce-disputes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-locations": {"currentStatus": "Complete", "dataType": "commerce-locations", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-orders": {"currentStatus": "Complete", "dataType": "commerce-orders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-paymentMethods": {"currentStatus": "Complete", "dataType": "commerce-paymentMethods", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-payments": {"currentStatus": "Complete", "dataType": "commerce-payments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-productCategories": {"currentStatus": "Complete", "dataType": "commerce-productCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-products": {"currentStatus": "Complete", "dataType": "commerce-products", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-taxComponents": {"currentStatus": "Complete", "dataType": "commerce-taxComponents", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-transactions": {"currentStatus": "Complete", "dataType": "commerce-transactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "company": {"currentStatus": "Complete", "dataType": "company", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "creditNotes": {"currentStatus": "Complete", "dataType": "creditNotes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "customers": {"currentStatus": "Complete", "dataType": "customers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "directCosts": {"currentStatus": "Complete", "dataType": "directCosts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "directIncomes": {"currentStatus": "Complete", "dataType": "directIncomes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "invoices": {"currentStatus": "Complete", "dataType": "invoices", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "itemReceipts": {"currentStatus": "Complete", "dataType": "itemReceipts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "items": {"currentStatus": "Complete", "dataType": "items", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "journalEntries": {"currentStatus": "Complete", "dataType": "journalEntries", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "journals": {"currentStatus": "Complete", "dataType": "journals", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "paymentMethods": {"currentStatus": "Complete", "dataType": "paymentMethods", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "payments": {"currentStatus": "Complete", "dataType": "payments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "profitAndLoss": {"currentStatus": "Complete", "dataType": "profitAndLoss", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "purchaseOrders": {"currentStatus": "Complete", "dataType": "purchaseOrders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "salesOrders": {"currentStatus": "Complete", "dataType": "salesOrders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "suppliers": {"currentStatus": "Complete", "dataType": "suppliers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "taxRates": {"currentStatus": "Complete", "dataType": "taxRates", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "trackingCategories": {"currentStatus": "Complete", "dataType": "trackingCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "transfers": {"currentStatus": "Complete", "dataType": "transfers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + refresh-all-data-types: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + refresh-data-type: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + dataType: "invoices" + query: {} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-pull-operation: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + datasetId: "b18d8d81-fd7b-4764-a31e-475cb1f36591" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-pull-operations: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "completed": "2022-10-23T00:00:00Z", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "isCompleted": false, "isErrored": false, "progress": 10, "requested": "2022-11-14T11:18:37.2798351Z", "status": "Initial", "statusDescription": "Paused until 2022-10-23T00:00:00.000Z"}], "totalResults": 1} + "400": {} + Example: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history?page=1&pageSize=2"}, "next": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history?page=2&pageSize=2"}, "self": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history"}}, "pageNumber": 0, "pageSize": 0, "results": [{"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "completed": "2022-10-23T00:00:00Z", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "isCompleted": false, "isErrored": false, "progress": 10, "requested": "2022-11-14T11:18:37.2798351Z", "status": "Initial", "statusDescription": "Paused until 2022-10-23T00:00:00.000Z"}], "totalResults": 0} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + generate-loan-summary: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + sourceType: "accounting" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + generate-loan-transactions: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + sourceType: "accounting" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-loan-summary: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + sourceType: "banking" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-loan-transactions: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + sourceType: "commerce" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + list-data-integrity-details: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + dataType: "banking-accounts" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + dataType: "banking-accounts" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + dataType: "banking-accounts" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-data-integrity-status: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + dataType: "banking-accounts" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-data-integrity-summaries: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + dataType: "banking-accounts" + query: + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + responses: + "200": + application/json: {"summaries": []} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + dataType: "banking-accounts" + query: + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + dataType: "banking-accounts" + query: + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + download-excel-report: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportType: "enhancedFinancials" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + generate-excel-report: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportType: "enhancedInvoices" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-excel-report-generation-status: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportType: "enhancedCashFlow" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + reportType: "enhancedFinancials" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} diff --git a/lending/.speakeasy/gen.yaml b/lending/.speakeasy/gen.yaml index c607fa283..881ca0ed5 100644 --- a/lending/.speakeasy/gen.yaml +++ b/lending/.speakeasy/gen.yaml @@ -7,9 +7,13 @@ generation: nameResolutionDec2023: false parameterOrderingFeb2024: false requestResponseComponentNamesFeb2024: false + auth: + oAuth2ClientCredentialsEnabled: false telemetryEnabled: true go: - version: 5.3.0 + version: 5.4.0 + additionalDependencies: {} + allowUnknownFieldsInWeakUnions: false clientServerStatusCodesAsErrors: true flattenGlobalSecurity: false imports: @@ -22,5 +26,7 @@ go: webhooks: pkg/models/webhooks inputModelSuffix: input maxMethodParams: 0 + methodArguments: require-security-and-request outputModelSuffix: output packageName: github.com/codatio/client-sdk-go/lending + responseFormat: envelope diff --git a/lending/CONTRIBUTING.md b/lending/CONTRIBUTING.md new file mode 100644 index 000000000..d585717fc --- /dev/null +++ b/lending/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# Contributing to This Repository + +Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements. + +## How to Report Issues + +If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes: + +- A clear and descriptive title +- Steps to reproduce the issue +- Expected and actual behavior +- Any relevant logs, screenshots, or error messages +- Information about your environment (e.g., operating system, software versions) + - For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed + +## Issue Triage and Upstream Fixes + +We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code. + +## Contact + +If you have any questions or need further assistance, please feel free to reach out by opening an issue. + +Thank you for your understanding and cooperation! + +The Maintainers diff --git a/lending/README.md b/lending/README.md index 845a9a619..e29580da9 100644 --- a/lending/README.md +++ b/lending/README.md @@ -4,9 +4,56 @@ Lending 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. + +## Summary + +Lending API: Our Lending API helps you make smarter credit decisions on small businesses by enabling you to pull your customers' latest data from accounting, banking, and commerce software they are already using. It also includes features to help providers verify the accuracy of data and process it more efficiently. + +The Lending API is built on top of the latest accounting, commerce, and banking data, providing you with the most important data points you need to get a full picture of SMB creditworthiness and make a comprehensive assessment of your customers. + +[Explore product](https://docs.codat.io/lending/overview) | [See OpenAPI spec](https://github.com/codatio/oas) + + +## Endpoints + +| Endpoints | Description | +| :- |:- | +| Companies | Create and manage your SMB users' companies. | +| Connections | Create new and manage existing data connections for a company. | +| Bank statements | Retrieve banking data from linked bank accounts. | +| Sales | Retrieve standardized sales data from a linked commerce software. | +| Financial statements | Financial data and reports from a linked accounting software. | +| Liabilities | Debt and other liabilities. | +| Accounts payable | Data from a linked accounting software representing money the business owes money to its suppliers. | +| Accounts receivable | Data from a linked accounting software representing money owed to the business for sold goods or services. | +| Transactions | Data from a linked accounting software representing transactions. | +| Company info | View company information fetched from the source platform. | +| Data integrity | Match mutable accounting data with immutable banking data to increase confidence in financial data. | +| Excel reports | Download reports in Excel format. | +| Manage data | Control how data is retrieved from an integration. | +| File upload | Endpoints to manage uploaded files. | +| Loan writeback | Implement the [loan writeback](https://docs.codat.io/lending/guides/loan-writeback/introduction) procedure in your lending process to maintain an accurate position of a loan during the entire lending cycle. | + + + + +## Table of Contents + +* [SDK Installation](#sdk-installation) +* [SDK Example Usage](#sdk-example-usage) +* [Available Resources and Operations](#available-resources-and-operations) +* [Retries](#retries) +* [Error Handling](#error-handling) +* [Server Selection](#server-selection) +* [Custom HTTP Client](#custom-http-client) +* [Authentication](#authentication) +* [Special Types](#special-types) + + ## SDK Installation +To add the SDK as a dependency to your project: ```bash go get github.com/codatio/client-sdk-go/lending ``` @@ -38,12 +85,16 @@ func main() { ctx := context.Background() res, err := s.Companies.Create(ctx, &shared.CompanyRequestBody{ Description: lending.String("Requested early access to the new financing scheme."), - Name: "Bank of Dave", + Groups: []shared.GroupReference{ + shared.GroupReference{ + ID: lending.String("60d2fa12-8a04-11ee-b9d1-0242ac120002"), + }, + }, + Name: "Technicalium", }) if err != nil { log.Fatal(err) } - if res.Company != nil { // handle response } @@ -55,86 +106,32 @@ func main() { ## Available Resources and Operations -### [Companies](docs/sdks/companies/README.md) - -* [Create](docs/sdks/companies/README.md#create) - Create company -* [Delete](docs/sdks/companies/README.md#delete) - Delete a company -* [Get](docs/sdks/companies/README.md#get) - Get company -* [List](docs/sdks/companies/README.md#list) - List companies -* [Update](docs/sdks/companies/README.md#update) - Update company - -### [Connections](docs/sdks/connections/README.md) - -* [Create](docs/sdks/connections/README.md#create) - Create connection -* [Delete](docs/sdks/connections/README.md#delete) - Delete connection -* [Get](docs/sdks/connections/README.md#get) - Get connection -* [List](docs/sdks/connections/README.md#list) - List connections -* [Unlink](docs/sdks/connections/README.md#unlink) - Unlink connection - - -### [Transactions.AccountTransactions](docs/sdks/accounttransactions/README.md) - -* [Get](docs/sdks/accounttransactions/README.md#get) - Get account transaction -* [List](docs/sdks/accounttransactions/README.md#list) - List account transactions - -### [Transactions.DirectCosts](docs/sdks/codatlendingdirectcosts/README.md) - -* [DownloadAttachment](docs/sdks/codatlendingdirectcosts/README.md#downloadattachment) - Download direct cost attachment -* [Get](docs/sdks/codatlendingdirectcosts/README.md#get) - Get direct cost -* [GetAttachment](docs/sdks/codatlendingdirectcosts/README.md#getattachment) - Get direct cost attachment -* [List](docs/sdks/codatlendingdirectcosts/README.md#list) - List direct costs -* [ListAttachments](docs/sdks/codatlendingdirectcosts/README.md#listattachments) - List direct cost attachments - -### [Transactions.Transfers](docs/sdks/codatlendingtransfers/README.md) - -* [Get](docs/sdks/codatlendingtransfers/README.md#get) - Get transfer -* [List](docs/sdks/codatlendingtransfers/README.md#list) - List transfers - -### [Transactions.JournalEntries](docs/sdks/journalentries/README.md) - -* [Get](docs/sdks/journalentries/README.md#get) - Get journal entry -* [List](docs/sdks/journalentries/README.md#list) - List journal entries - -### [Transactions.Journals](docs/sdks/journals/README.md) - -* [Get](docs/sdks/journals/README.md#get) - Get journal -* [List](docs/sdks/journals/README.md#list) - List journals +
+Available methods ### [AccountingBankData](docs/sdks/codatlendingaccountingbankdata/README.md) * [ListTransactions](docs/sdks/codatlendingaccountingbankdata/README.md#listtransactions) - List bank account transactions -### [AccountingBankData.Accounts](docs/sdks/accounts/README.md) +#### [AccountingBankData.Accounts](docs/sdks/accounts/README.md) * [Get](docs/sdks/accounts/README.md#get) - Get bank account * [List](docs/sdks/accounts/README.md#list) - List bank accounts +### [AccountsPayable](docs/sdks/accountspayable/README.md) -### [Banking.AccountBalances](docs/sdks/accountbalances/README.md) - -* [List](docs/sdks/accountbalances/README.md#list) - List account balances - -### [Banking.Accounts](docs/sdks/codatlendingaccounts/README.md) - -* [Get](docs/sdks/codatlendingaccounts/README.md#get) - Get account -* [List](docs/sdks/codatlendingaccounts/README.md#list) - List accounts -### [Banking.TransactionCategories](docs/sdks/transactioncategories/README.md) +#### [AccountsPayable.BillCreditNotes](docs/sdks/billcreditnotes/README.md) -* [Get](docs/sdks/transactioncategories/README.md#get) - Get transaction category -* [List](docs/sdks/transactioncategories/README.md#list) - List transaction categories - -### [Banking.Transactions](docs/sdks/codatlendingbankingtransactions/README.md) - -* [Get](docs/sdks/codatlendingbankingtransactions/README.md#get) - Get bank transaction -* [List](docs/sdks/codatlendingbankingtransactions/README.md#list) - List transactions - -### [Banking.CategorizedStatement](docs/sdks/categorizedstatement/README.md) +* [Get](docs/sdks/billcreditnotes/README.md#get) - Get bill credit note +* [List](docs/sdks/billcreditnotes/README.md#list) - List bill credit notes -* [Get](docs/sdks/categorizedstatement/README.md#get) - Get categorized bank statement +#### [AccountsPayable.BillPayments](docs/sdks/billpayments/README.md) +* [Get](docs/sdks/billpayments/README.md#get) - Get bill payment +* [List](docs/sdks/billpayments/README.md#list) - List bill payments -### [AccountsPayable.Bills](docs/sdks/bills/README.md) +#### [AccountsPayable.Bills](docs/sdks/bills/README.md) * [DownloadAttachment](docs/sdks/bills/README.md#downloadattachment) - Download bill attachment * [Get](docs/sdks/bills/README.md#get) - Get bill @@ -142,7 +139,7 @@ func main() { * [List](docs/sdks/bills/README.md#list) - List bills * [ListAttachments](docs/sdks/bills/README.md#listattachments) - List bill attachments -### [AccountsPayable.Suppliers](docs/sdks/suppliers/README.md) +#### [AccountsPayable.Suppliers](docs/sdks/suppliers/README.md) * [DownloadAttachment](docs/sdks/suppliers/README.md#downloadattachment) - Download supplier attachment * [Get](docs/sdks/suppliers/README.md#get) - Get supplier @@ -150,221 +147,303 @@ func main() { * [List](docs/sdks/suppliers/README.md#list) - List suppliers * [ListAttachments](docs/sdks/suppliers/README.md#listattachments) - List supplier attachments -### [AccountsPayable.BillCreditNotes](docs/sdks/billcreditnotes/README.md) +### [AccountsReceivable](docs/sdks/accountsreceivable/README.md) -* [Get](docs/sdks/billcreditnotes/README.md#get) - Get bill credit note -* [List](docs/sdks/billcreditnotes/README.md#list) - List bill credit notes -### [AccountsPayable.BillPayments](docs/sdks/billpayments/README.md) +#### [AccountsReceivable.CreditNotes](docs/sdks/creditnotes/README.md) -* [Get](docs/sdks/billpayments/README.md#get) - Get bill payment -* [List](docs/sdks/billpayments/README.md#list) - List bill payments +* [Get](docs/sdks/creditnotes/README.md#get) - Get credit note +* [List](docs/sdks/creditnotes/README.md#list) - List credit notes +#### [AccountsReceivable.Customers](docs/sdks/customers/README.md) -### [Sales.Customers](docs/sdks/codatlendingcustomers/README.md) +* [DownloadAttachment](docs/sdks/customers/README.md#downloadattachment) - Download customer attachment +* [Get](docs/sdks/customers/README.md#get) - Get customer +* [GetAttachment](docs/sdks/customers/README.md#getattachment) - Get customer attachment +* [List](docs/sdks/customers/README.md#list) - List customers +* [ListAttachments](docs/sdks/customers/README.md#listattachments) - List customer attachments -* [Get](docs/sdks/codatlendingcustomers/README.md#get) - Get customer -* [List](docs/sdks/codatlendingcustomers/README.md#list) - List customers +#### [AccountsReceivable.DirectIncomes](docs/sdks/directincomes/README.md) + +* [DownloadAttachment](docs/sdks/directincomes/README.md#downloadattachment) - Download direct income attachment +* [Get](docs/sdks/directincomes/README.md#get) - Get direct income +* [GetAttachment](docs/sdks/directincomes/README.md#getattachment) - Get direct income attachment +* [List](docs/sdks/directincomes/README.md#list) - List direct incomes +* [ListAttachments](docs/sdks/directincomes/README.md#listattachments) - List direct income attachments -### [Sales.Disputes](docs/sdks/disputes/README.md) +#### [AccountsReceivable.Invoices](docs/sdks/invoices/README.md) -* [Get](docs/sdks/disputes/README.md#get) - Get dispute -* [List](docs/sdks/disputes/README.md#list) - List disputes +* [DownloadAttachment](docs/sdks/invoices/README.md#downloadattachment) - Download invoice attachment +* [DownloadPdf](docs/sdks/invoices/README.md#downloadpdf) - Get invoice as PDF +* [Get](docs/sdks/invoices/README.md#get) - Get invoice +* [GetAttachment](docs/sdks/invoices/README.md#getattachment) - Get invoice attachment +* [List](docs/sdks/invoices/README.md#list) - List invoices +* [ListAttachments](docs/sdks/invoices/README.md#listattachments) - List invoice attachments +* [ListReconciled](docs/sdks/invoices/README.md#listreconciled) - List reconciled invoices -### [Sales.Locations](docs/sdks/locations/README.md) +#### [AccountsReceivable.Payments](docs/sdks/payments/README.md) -* [Get](docs/sdks/locations/README.md#get) - Get location -* [List](docs/sdks/locations/README.md#list) - List locations +* [Get](docs/sdks/payments/README.md#get) - Get payment +* [List](docs/sdks/payments/README.md#list) - List payments -### [Sales.Orders](docs/sdks/orders/README.md) +#### [AccountsReceivable.Reports](docs/sdks/reports/README.md) -* [Get](docs/sdks/orders/README.md#get) - Get order -* [List](docs/sdks/orders/README.md#list) - List orders +* [GetAgedCreditors](docs/sdks/reports/README.md#getagedcreditors) - Aged creditors report +* [GetAgedDebtors](docs/sdks/reports/README.md#getageddebtors) - Aged debtors report +* [IsAgedCreditorsAvailable](docs/sdks/reports/README.md#isagedcreditorsavailable) - Aged creditors report available +* [IsAgedDebtorsAvailable](docs/sdks/reports/README.md#isageddebtorsavailable) - Aged debtors report available -### [Sales.PaymentMethods](docs/sdks/paymentmethods/README.md) +### [Banking](docs/sdks/banking/README.md) -* [Get](docs/sdks/paymentmethods/README.md#get) - Get payment method -* [List](docs/sdks/paymentmethods/README.md#list) - List payment methods -### [Sales.Payments](docs/sdks/codatlendingsalespayments/README.md) +#### [Banking.AccountBalances](docs/sdks/accountbalances/README.md) -* [Get](docs/sdks/codatlendingsalespayments/README.md#get) - Get payment -* [List](docs/sdks/codatlendingsalespayments/README.md#list) - List payments +* [List](docs/sdks/accountbalances/README.md#list) - List account balances -### [Sales.ProductCategories](docs/sdks/productcategories/README.md) +#### [Banking.Accounts](docs/sdks/codatlendingaccounts/README.md) -* [Get](docs/sdks/productcategories/README.md#get) - Get product category -* [List](docs/sdks/productcategories/README.md#list) - List product categories +* [Get](docs/sdks/codatlendingaccounts/README.md#get) - Get account +* [List](docs/sdks/codatlendingaccounts/README.md#list) - List accounts -### [Sales.Products](docs/sdks/products/README.md) +#### [Banking.CategorizedStatement](docs/sdks/categorizedstatement/README.md) -* [Get](docs/sdks/products/README.md#get) - Get product -* [List](docs/sdks/products/README.md#list) - List products +* [Get](docs/sdks/categorizedstatement/README.md#get) - Get categorized bank statement -### [Sales.Transactions](docs/sdks/codatlendingtransactions/README.md) +#### [Banking.TransactionCategories](docs/sdks/transactioncategories/README.md) -* [Get](docs/sdks/codatlendingtransactions/README.md#get) - Get transaction -* [List](docs/sdks/codatlendingtransactions/README.md#list) - List transactions +* [Get](docs/sdks/transactioncategories/README.md#get) - Get transaction category +* [List](docs/sdks/transactioncategories/README.md#list) - List transaction categories -### [Sales.Metrics](docs/sdks/metrics/README.md) +#### [Banking.Transactions](docs/sdks/codatlendingbankingtransactions/README.md) -* [GetCustomerRetention](docs/sdks/metrics/README.md#getcustomerretention) - Get customer retention metrics -* [GetLifetimeValue](docs/sdks/metrics/README.md#getlifetimevalue) - Get lifetime value metrics -* [GetRevenue](docs/sdks/metrics/README.md#getrevenue) - Get commerce revenue metrics +* [Get](docs/sdks/codatlendingbankingtransactions/README.md#get) - Get bank transaction +* [List](docs/sdks/codatlendingbankingtransactions/README.md#list) - List transactions -### [Sales.Reports](docs/sdks/codatlendingreports/README.md) +### [BankStatements](docs/sdks/bankstatements/README.md) -* [GetOrders](docs/sdks/codatlendingreports/README.md#getorders) - Get orders report -* [GetRefunds](docs/sdks/codatlendingreports/README.md#getrefunds) - Get refunds report +* [EndUploadSession](docs/sdks/bankstatements/README.md#enduploadsession) - End upload session +* [GetUploadConfiguration](docs/sdks/bankstatements/README.md#getuploadconfiguration) - Get upload configuration +* [SetUploadConfiguration](docs/sdks/bankstatements/README.md#setuploadconfiguration) - Set upload configuration +* [StartUploadSession](docs/sdks/bankstatements/README.md#startuploadsession) - Start upload session +* [UploadBankStatementData](docs/sdks/bankstatements/README.md#uploadbankstatementdata) - Upload data + + +### [Companies](docs/sdks/companies/README.md) + +* [Create](docs/sdks/companies/README.md#create) - Create company +* [Delete](docs/sdks/companies/README.md#delete) - Delete a company +* [Get](docs/sdks/companies/README.md#get) - Get company +* [List](docs/sdks/companies/README.md#list) - List companies +* [Update](docs/sdks/companies/README.md#update) - Update company ### [CompanyInfo](docs/sdks/companyinfo/README.md) * [GetAccountingProfile](docs/sdks/companyinfo/README.md#getaccountingprofile) - Get company accounting profile * [GetCommerceProfile](docs/sdks/companyinfo/README.md#getcommerceprofile) - Get company commerce profile +### [Connections](docs/sdks/connections/README.md) + +* [Create](docs/sdks/connections/README.md#create) - Create connection +* [Delete](docs/sdks/connections/README.md#delete) - Delete connection +* [Get](docs/sdks/connections/README.md#get) - Get connection +* [List](docs/sdks/connections/README.md#list) - List connections +* [Unlink](docs/sdks/connections/README.md#unlink) - Unlink connection -### [AccountsReceivable.Customers](docs/sdks/customers/README.md) +### [DataIntegrity](docs/sdks/dataintegrity/README.md) -* [DownloadAttachment](docs/sdks/customers/README.md#downloadattachment) - Download customer attachment -* [Get](docs/sdks/customers/README.md#get) - Get customer -* [GetAttachment](docs/sdks/customers/README.md#getattachment) - Get customer attachment -* [List](docs/sdks/customers/README.md#list) - List customers -* [ListAttachments](docs/sdks/customers/README.md#listattachments) - List customer attachments +* [Details](docs/sdks/dataintegrity/README.md#details) - List data integrity details +* [Status](docs/sdks/dataintegrity/README.md#status) - Get data integrity status +* [Summaries](docs/sdks/dataintegrity/README.md#summaries) - Get data integrity summaries -### [AccountsReceivable.DirectIncomes](docs/sdks/directincomes/README.md) +### [ExcelReports](docs/sdks/excelreports/README.md) -* [DownloadAttachment](docs/sdks/directincomes/README.md#downloadattachment) - Download direct income attachment -* [Get](docs/sdks/directincomes/README.md#get) - Get direct income -* [GetAttachment](docs/sdks/directincomes/README.md#getattachment) - Get direct income attachment -* [List](docs/sdks/directincomes/README.md#list) - List direct incomes -* [ListAttachments](docs/sdks/directincomes/README.md#listattachments) - List direct income attachments +* [Download](docs/sdks/excelreports/README.md#download) - Download Excel report +* [Generate](docs/sdks/excelreports/README.md#generate) - Generate Excel report +* [GetStatus](docs/sdks/excelreports/README.md#getstatus) - Get Excel report status -### [AccountsReceivable.Invoices](docs/sdks/invoices/README.md) +### [FileUpload](docs/sdks/fileupload/README.md) -* [DownloadAttachment](docs/sdks/invoices/README.md#downloadattachment) - Download invoice attachment -* [DownloadPdf](docs/sdks/invoices/README.md#downloadpdf) - Get invoice as PDF -* [Get](docs/sdks/invoices/README.md#get) - Get invoice -* [GetAttachment](docs/sdks/invoices/README.md#getattachment) - Get invoice attachment -* [List](docs/sdks/invoices/README.md#list) - List invoices -* [ListAttachments](docs/sdks/invoices/README.md#listattachments) - List invoice attachments -* [ListReconciled](docs/sdks/invoices/README.md#listreconciled) - List reconciled invoices +* [Download](docs/sdks/fileupload/README.md#download) - Download all files for a company +* [ListUploaded](docs/sdks/fileupload/README.md#listuploaded) - List all files uploaded by a company +* [Upload](docs/sdks/fileupload/README.md#upload) - Upload files for a company -### [AccountsReceivable.CreditNotes](docs/sdks/creditnotes/README.md) +### [FinancialStatements](docs/sdks/financialstatements/README.md) -* [Get](docs/sdks/creditnotes/README.md#get) - Get credit note -* [List](docs/sdks/creditnotes/README.md#list) - List credit notes -### [AccountsReceivable.Payments](docs/sdks/payments/README.md) +#### [FinancialStatements.Accounts](docs/sdks/codatlendingfinancialstatementsaccounts/README.md) -* [Get](docs/sdks/payments/README.md#get) - Get payment -* [List](docs/sdks/payments/README.md#list) - List payments +* [Get](docs/sdks/codatlendingfinancialstatementsaccounts/README.md#get) - Get account +* [List](docs/sdks/codatlendingfinancialstatementsaccounts/README.md#list) - List accounts -### [AccountsReceivable.Reports](docs/sdks/reports/README.md) +#### [FinancialStatements.BalanceSheet](docs/sdks/balancesheet/README.md) -* [GetAgedCreditors](docs/sdks/reports/README.md#getagedcreditors) - Aged creditors report -* [GetAgedDebtors](docs/sdks/reports/README.md#getageddebtors) - Aged debtors report -* [IsAgedCreditorsAvailable](docs/sdks/reports/README.md#isagedcreditorsavailable) - Aged creditors report available -* [IsAgedDebtorsAvailable](docs/sdks/reports/README.md#isageddebtorsavailable) - Aged debtors report available +* [Get](docs/sdks/balancesheet/README.md#get) - Get balance sheet +* [GetCategorizedAccounts](docs/sdks/balancesheet/README.md#getcategorizedaccounts) - Get categorized balance sheet statement -### [FileUpload](docs/sdks/fileupload/README.md) +#### [FinancialStatements.CashFlow](docs/sdks/cashflow/README.md) -* [Download](docs/sdks/fileupload/README.md#download) - Download all files for a company -* [ListUploaded](docs/sdks/fileupload/README.md#listuploaded) - List all files uploaded by a company -* [Upload](docs/sdks/fileupload/README.md#upload) - Upload files for a company +* [Get](docs/sdks/cashflow/README.md#get) - Get cash flow statement + +#### [FinancialStatements.ProfitAndLoss](docs/sdks/profitandloss/README.md) + +* [Get](docs/sdks/profitandloss/README.md#get) - Get profit and loss +* [GetCategorizedAccounts](docs/sdks/profitandloss/README.md#getcategorizedaccounts) - Get categorized profit and loss statement + +### [Liabilities](docs/sdks/liabilities/README.md) + +* [GenerateLoanSummary](docs/sdks/liabilities/README.md#generateloansummary) - Generate loan summaries report +* [GenerateLoanTransactions](docs/sdks/liabilities/README.md#generateloantransactions) - Generate loan transactions report +* [GetLoanSummary](docs/sdks/liabilities/README.md#getloansummary) - Get loan summaries +* [ListLoanTransactions](docs/sdks/liabilities/README.md#listloantransactions) - List loan transactions + +### [LoanWriteback](docs/sdks/loanwriteback/README.md) -### [LoanWriteback.BankAccounts](docs/sdks/bankaccounts/README.md) +#### [LoanWriteback.Accounts](docs/sdks/codatlendingloanwritebackaccounts/README.md) + +* [Create](docs/sdks/codatlendingloanwritebackaccounts/README.md#create) - Create account +* [GetCreateModel](docs/sdks/codatlendingloanwritebackaccounts/README.md#getcreatemodel) - Get create account model + +#### [LoanWriteback.BankAccounts](docs/sdks/bankaccounts/README.md) * [Create](docs/sdks/bankaccounts/README.md#create) - Create bank account * [GetCreateUpdateModel](docs/sdks/bankaccounts/README.md#getcreateupdatemodel) - Get create/update bank account model -### [LoanWriteback.BankTransactions](docs/sdks/banktransactions/README.md) +#### [LoanWriteback.BankTransactions](docs/sdks/banktransactions/README.md) * [Create](docs/sdks/banktransactions/README.md#create) - Create bank account transactions * [GetCreateModel](docs/sdks/banktransactions/README.md#getcreatemodel) - Get create bank account transactions model -### [LoanWriteback.Accounts](docs/sdks/codatlendingloanwritebackaccounts/README.md) +#### [LoanWriteback.CreateOperations](docs/sdks/createoperations/README.md) -* [Create](docs/sdks/codatlendingloanwritebackaccounts/README.md#create) - Create account -* [GetCreateModel](docs/sdks/codatlendingloanwritebackaccounts/README.md#getcreatemodel) - Get create account model +* [Get](docs/sdks/createoperations/README.md#get) - Get create operation +* [List](docs/sdks/createoperations/README.md#list) - List create operations -### [LoanWriteback.DirectCosts](docs/sdks/directcosts/README.md) +#### [LoanWriteback.DirectCosts](docs/sdks/directcosts/README.md) * [Create](docs/sdks/directcosts/README.md#create) - Create direct cost * [GetCreateModel](docs/sdks/directcosts/README.md#getcreatemodel) - Get create direct cost model -### [LoanWriteback.Payments](docs/sdks/codatlendingpayments/README.md) +#### [LoanWriteback.Payments](docs/sdks/codatlendingpayments/README.md) * [Create](docs/sdks/codatlendingpayments/README.md#create) - Create payment * [GetCreateModel](docs/sdks/codatlendingpayments/README.md#getcreatemodel) - Get create payment model -### [LoanWriteback.Suppliers](docs/sdks/codatlendingsuppliers/README.md) +#### [LoanWriteback.Suppliers](docs/sdks/codatlendingsuppliers/README.md) * [Create](docs/sdks/codatlendingsuppliers/README.md#create) - Create supplier * [GetCreateUpdateModel](docs/sdks/codatlendingsuppliers/README.md#getcreateupdatemodel) - Get create/update supplier model -### [LoanWriteback.Transfers](docs/sdks/transfers/README.md) +#### [LoanWriteback.Transfers](docs/sdks/transfers/README.md) * [Create](docs/sdks/transfers/README.md#create) - Create transfer * [GetCreateModel](docs/sdks/transfers/README.md#getcreatemodel) - Get create transfer model -### [LoanWriteback.CreateOperations](docs/sdks/createoperations/README.md) +### [ManageData](docs/sdks/managedata/README.md) -* [Get](docs/sdks/createoperations/README.md#get) - Get create operation -* [List](docs/sdks/createoperations/README.md#list) - List create operations +* [GetStatus](docs/sdks/managedata/README.md#getstatus) - Get data status +#### [ManageData.PullOperations](docs/sdks/pulloperations/README.md) -### [FinancialStatements.Accounts](docs/sdks/codatlendingfinancialstatementsaccounts/README.md) +* [Get](docs/sdks/pulloperations/README.md#get) - Get pull operation +* [List](docs/sdks/pulloperations/README.md#list) - List pull operations -* [Get](docs/sdks/codatlendingfinancialstatementsaccounts/README.md#get) - Get account -* [List](docs/sdks/codatlendingfinancialstatementsaccounts/README.md#list) - List accounts +#### [ManageData.Refresh](docs/sdks/refresh/README.md) -### [FinancialStatements.BalanceSheet](docs/sdks/balancesheet/README.md) +* [AllDataTypes](docs/sdks/refresh/README.md#alldatatypes) - Refresh all data +* [DataType](docs/sdks/refresh/README.md#datatype) - Refresh data type -* [Get](docs/sdks/balancesheet/README.md#get) - Get balance sheet -* [GetCategorizedAccounts](docs/sdks/balancesheet/README.md#getcategorizedaccounts) - Get categorized balance sheet statement +### [Sales](docs/sdks/sales/README.md) -### [FinancialStatements.CashFlow](docs/sdks/cashflow/README.md) -* [Get](docs/sdks/cashflow/README.md#get) - Get cash flow statement +#### [Sales.Customers](docs/sdks/codatlendingcustomers/README.md) -### [FinancialStatements.ProfitAndLoss](docs/sdks/profitandloss/README.md) +* [Get](docs/sdks/codatlendingcustomers/README.md#get) - Get customer +* [List](docs/sdks/codatlendingcustomers/README.md#list) - List customers -* [Get](docs/sdks/profitandloss/README.md#get) - Get profit and loss -* [GetCategorizedAccounts](docs/sdks/profitandloss/README.md#getcategorizedaccounts) - Get categorized profit and loss statement +#### [Sales.Disputes](docs/sdks/disputes/README.md) -### [ManageData](docs/sdks/managedata/README.md) +* [Get](docs/sdks/disputes/README.md#get) - Get dispute +* [List](docs/sdks/disputes/README.md#list) - List disputes -* [GetStatus](docs/sdks/managedata/README.md#getstatus) - Get data status +#### [Sales.Locations](docs/sdks/locations/README.md) -### [ManageData.Refresh](docs/sdks/refresh/README.md) +* [Get](docs/sdks/locations/README.md#get) - Get location +* [List](docs/sdks/locations/README.md#list) - List locations -* [AllDataTypes](docs/sdks/refresh/README.md#alldatatypes) - Refresh all data -* [DataType](docs/sdks/refresh/README.md#datatype) - Refresh data type +#### [Sales.Metrics](docs/sdks/metrics/README.md) -### [ManageData.PullOperations](docs/sdks/pulloperations/README.md) +* [GetCustomerRetention](docs/sdks/metrics/README.md#getcustomerretention) - Get customer retention metrics +* [GetLifetimeValue](docs/sdks/metrics/README.md#getlifetimevalue) - Get lifetime value metrics +* [GetRevenue](docs/sdks/metrics/README.md#getrevenue) - Get commerce revenue metrics -* [Get](docs/sdks/pulloperations/README.md#get) - Get pull operation -* [List](docs/sdks/pulloperations/README.md#list) - List pull operations +#### [Sales.Orders](docs/sdks/orders/README.md) -### [Liabilities](docs/sdks/liabilities/README.md) +* [Get](docs/sdks/orders/README.md#get) - Get order +* [List](docs/sdks/orders/README.md#list) - List orders -* [GenerateLoanSummary](docs/sdks/liabilities/README.md#generateloansummary) - Generate loan summaries report -* [GenerateLoanTransactions](docs/sdks/liabilities/README.md#generateloantransactions) - Generate loan transactions report -* [GetLoanSummary](docs/sdks/liabilities/README.md#getloansummary) - Get loan summaries -* [ListLoanTransactions](docs/sdks/liabilities/README.md#listloantransactions) - List loan transactions +#### [Sales.PaymentMethods](docs/sdks/paymentmethods/README.md) -### [DataIntegrity](docs/sdks/dataintegrity/README.md) +* [Get](docs/sdks/paymentmethods/README.md#get) - Get payment method +* [List](docs/sdks/paymentmethods/README.md#list) - List payment methods -* [Details](docs/sdks/dataintegrity/README.md#details) - List data integrity details -* [Status](docs/sdks/dataintegrity/README.md#status) - Get data integrity status -* [Summaries](docs/sdks/dataintegrity/README.md#summaries) - Get data integrity summaries +#### [Sales.Payments](docs/sdks/codatlendingsalespayments/README.md) -### [ExcelReports](docs/sdks/excelreports/README.md) +* [Get](docs/sdks/codatlendingsalespayments/README.md#get) - Get payment +* [List](docs/sdks/codatlendingsalespayments/README.md#list) - List payments -* [Download](docs/sdks/excelreports/README.md#download) - Download Excel report -* [Generate](docs/sdks/excelreports/README.md#generate) - Generate Excel report -* [GetStatus](docs/sdks/excelreports/README.md#getstatus) - Get Excel report status +#### [Sales.ProductCategories](docs/sdks/productcategories/README.md) + +* [Get](docs/sdks/productcategories/README.md#get) - Get product category +* [List](docs/sdks/productcategories/README.md#list) - List product categories + +#### [Sales.Products](docs/sdks/products/README.md) + +* [Get](docs/sdks/products/README.md#get) - Get product +* [List](docs/sdks/products/README.md#list) - List products + +#### [Sales.Reports](docs/sdks/codatlendingreports/README.md) + +* [GetOrders](docs/sdks/codatlendingreports/README.md#getorders) - Get orders report +* [GetRefunds](docs/sdks/codatlendingreports/README.md#getrefunds) - Get refunds report + +#### [Sales.Transactions](docs/sdks/codatlendingtransactions/README.md) + +* [Get](docs/sdks/codatlendingtransactions/README.md#get) - Get transaction +* [List](docs/sdks/codatlendingtransactions/README.md#list) - List transactions + +### [Transactions](docs/sdks/transactions/README.md) + + +#### [Transactions.AccountTransactions](docs/sdks/accounttransactions/README.md) + +* [Get](docs/sdks/accounttransactions/README.md#get) - Get account transaction +* [List](docs/sdks/accounttransactions/README.md#list) - List account transactions + +#### [Transactions.DirectCosts](docs/sdks/codatlendingdirectcosts/README.md) + +* [DownloadAttachment](docs/sdks/codatlendingdirectcosts/README.md#downloadattachment) - Download direct cost attachment +* [Get](docs/sdks/codatlendingdirectcosts/README.md#get) - Get direct cost +* [GetAttachment](docs/sdks/codatlendingdirectcosts/README.md#getattachment) - Get direct cost attachment +* [List](docs/sdks/codatlendingdirectcosts/README.md#list) - List direct costs +* [ListAttachments](docs/sdks/codatlendingdirectcosts/README.md#listattachments) - List direct cost attachments + +#### [Transactions.JournalEntries](docs/sdks/journalentries/README.md) + +* [Get](docs/sdks/journalentries/README.md#get) - Get journal entry +* [List](docs/sdks/journalentries/README.md#list) - List journal entries + +#### [Transactions.Journals](docs/sdks/journals/README.md) + +* [Get](docs/sdks/journals/README.md#get) - Get journal +* [List](docs/sdks/journals/README.md#list) - List journals + +#### [Transactions.Transfers](docs/sdks/codatlendingtransfers/README.md) + +* [Get](docs/sdks/codatlendingtransfers/README.md#get) - Get transfer +* [List](docs/sdks/codatlendingtransfers/README.md#list) - List transfers + +
@@ -402,7 +481,7 @@ d6 := types.MustDateFromString("2019-01-01") // returns types.Date and panics on Some 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 by using the `WithRetries` option: +To change the default retry strategy for a single API call, simply provide a `retry.Config` object to the call by using the `WithRetries` option: ```go package main @@ -410,7 +489,7 @@ import ( "context" lending "github.com/codatio/client-sdk-go/lending/v5" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" - "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "log" "pkg/models/operations" ) @@ -425,11 +504,16 @@ func main() { ctx := context.Background() res, err := s.Companies.Create(ctx, &shared.CompanyRequestBody{ Description: lending.String("Requested early access to the new financing scheme."), - Name: "Bank of Dave", + Groups: []shared.GroupReference{ + shared.GroupReference{ + ID: lending.String("60d2fa12-8a04-11ee-b9d1-0242ac120002"), + }, + }, + Name: "Technicalium", }, operations.WithRetries( - utils.RetryConfig{ + retry.Config{ Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + Backoff: &retry.BackoffStrategy{ InitialInterval: 1, MaxInterval: 50, Exponent: 1.1, @@ -440,7 +524,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.Company != nil { // handle response } @@ -456,16 +539,16 @@ import ( "context" lending "github.com/codatio/client-sdk-go/lending/v5" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" - "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "log" ) func main() { s := lending.New( lending.WithRetryConfig( - utils.RetryConfig{ + retry.Config{ Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + Backoff: &retry.BackoffStrategy{ InitialInterval: 1, MaxInterval: 50, Exponent: 1.1, @@ -481,12 +564,16 @@ func main() { ctx := context.Background() res, err := s.Companies.Create(ctx, &shared.CompanyRequestBody{ Description: lending.String("Requested early access to the new financing scheme."), - Name: "Bank of Dave", + Groups: []shared.GroupReference{ + shared.GroupReference{ + ID: lending.String("60d2fa12-8a04-11ee-b9d1-0242ac120002"), + }, + }, + Name: "Technicalium", }) if err != nil { log.Fatal(err) } - if res.Company != nil { // handle response } @@ -529,7 +616,12 @@ func main() { ctx := context.Background() res, err := s.Companies.Create(ctx, &shared.CompanyRequestBody{ Description: lending.String("Requested early access to the new financing scheme."), - Name: "Bank of Dave", + Groups: []shared.GroupReference{ + shared.GroupReference{ + ID: lending.String("60d2fa12-8a04-11ee-b9d1-0242ac120002"), + }, + }, + Name: "Technicalium", }) if err != nil { @@ -584,12 +676,16 @@ func main() { ctx := context.Background() res, err := s.Companies.Create(ctx, &shared.CompanyRequestBody{ Description: lending.String("Requested early access to the new financing scheme."), - Name: "Bank of Dave", + Groups: []shared.GroupReference{ + shared.GroupReference{ + ID: lending.String("60d2fa12-8a04-11ee-b9d1-0242ac120002"), + }, + }, + Name: "Technicalium", }) if err != nil { log.Fatal(err) } - if res.Company != nil { // handle response } @@ -622,12 +718,16 @@ func main() { ctx := context.Background() res, err := s.Companies.Create(ctx, &shared.CompanyRequestBody{ Description: lending.String("Requested early access to the new financing scheme."), - Name: "Bank of Dave", + Groups: []shared.GroupReference{ + shared.GroupReference{ + ID: lending.String("60d2fa12-8a04-11ee-b9d1-0242ac120002"), + }, + }, + Name: "Technicalium", }) if err != nil { log.Fatal(err) } - if res.Company != nil { // handle response } @@ -697,12 +797,16 @@ func main() { ctx := context.Background() res, err := s.Companies.Create(ctx, &shared.CompanyRequestBody{ Description: lending.String("Requested early access to the new financing scheme."), - Name: "Bank of Dave", + Groups: []shared.GroupReference{ + shared.GroupReference{ + ID: lending.String("60d2fa12-8a04-11ee-b9d1-0242ac120002"), + }, + }, + Name: "Technicalium", }) if err != nil { log.Fatal(err) } - if res.Company != nil { // handle response } diff --git a/lending/RELEASES.md b/lending/RELEASES.md index 0cfe2d596..3c5d3ec7d 100644 --- a/lending/RELEASES.md +++ b/lending/RELEASES.md @@ -98,4 +98,14 @@ Based on: ### Generated - [go v5.3.0] lending ### Releases -- [Go v5.3.0] https://github.com/codatio/client-sdk-go/releases/tag/lending/v5.3.0 - lending \ No newline at end of file +- [Go v5.3.0] https://github.com/codatio/client-sdk-go/releases/tag/lending/v5.3.0 - lending + +## 2024-09-13 16:11:19 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.396.7 (2.415.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v5.4.0] lending +### Releases +- [Go v5.4.0] https://github.com/codatio/client-sdk-go/releases/tag/lending/v5.4.0 - lending \ No newline at end of file diff --git a/lending/USAGE.md b/lending/USAGE.md index a9c789d33..1ff54995b 100644 --- a/lending/USAGE.md +++ b/lending/USAGE.md @@ -19,12 +19,16 @@ func main() { ctx := context.Background() res, err := s.Companies.Create(ctx, &shared.CompanyRequestBody{ Description: lending.String("Requested early access to the new financing scheme."), - Name: "Bank of Dave", + Groups: []shared.GroupReference{ + shared.GroupReference{ + ID: lending.String("60d2fa12-8a04-11ee-b9d1-0242ac120002"), + }, + }, + Name: "Technicalium", }) if err != nil { log.Fatal(err) } - if res.Company != nil { // handle response } diff --git a/lending/accountbalances.go b/lending/accountbalances.go index dab515ef9..f0cb9d942 100644 --- a/lending/accountbalances.go +++ b/lending/accountbalances.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -31,9 +34,17 @@ func newAccountBalances(sdkConfig sdkConfiguration) *AccountBalances { // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *AccountBalances) List(ctx context.Context, request operations.ListBankingAccountBalancesRequest, opts ...operations.Option) (*operations.ListBankingAccountBalancesResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-banking-account-balances", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -41,32 +52,47 @@ func (s *AccountBalances) List(ctx context.Context, request operations.ListBanki return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/banking-accountBalances", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/banking-accountBalances", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -74,53 +100,109 @@ func (s *AccountBalances) List(ctx context.Context, request operations.ListBanki }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListBankingAccountBalancesResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.BankingAccountBalances if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -128,7 +210,12 @@ func (s *AccountBalances) List(ctx context.Context, request operations.ListBanki res.BankingAccountBalances = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -148,20 +235,44 @@ func (s *AccountBalances) List(ctx context.Context, request operations.ListBanki fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/accounts.go b/lending/accounts.go index 616046cfa..90e63d1fb 100644 --- a/lending/accounts.go +++ b/lending/accounts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newAccounts(sdkConfig sdkConfiguration) *Accounts { // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Accounts) Get(ctx context.Context, request operations.GetAccountingBankAccountRequest, opts ...operations.Option) (*operations.GetAccountingBankAccountResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-bank-account", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *Accounts) Get(ctx context.Context, request operations.GetAccountingBank return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/bankAccounts/{accountId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/bankAccounts/{accountId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *Accounts) Get(ctx context.Context, request operations.GetAccountingBank }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingBankAccountResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingBankAccount if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *Accounts) Get(ctx context.Context, request operations.GetAccountingBank res.AccountingBankAccount = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *Accounts) Get(ctx context.Context, request operations.GetAccountingBank fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List bank accounts @@ -169,9 +280,17 @@ func (s *Accounts) Get(ctx context.Context, request operations.GetAccountingBank // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Accounts) List(ctx context.Context, request operations.ListAccountingBankAccountsRequest, opts ...operations.Option) (*operations.ListAccountingBankAccountsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-bank-accounts", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *Accounts) List(ctx context.Context, request operations.ListAccountingBa return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/bankAccounts", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/bankAccounts", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *Accounts) List(ctx context.Context, request operations.ListAccountingBa }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingBankAccountsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingBankAccounts if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *Accounts) List(ctx context.Context, request operations.ListAccountingBa res.AccountingBankAccounts = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *Accounts) List(ctx context.Context, request operations.ListAccountingBa fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/accountspayable.go b/lending/accountspayable.go index 98abc36c8..5b2a8223c 100644 --- a/lending/accountspayable.go +++ b/lending/accountspayable.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending diff --git a/lending/accountsreceivable.go b/lending/accountsreceivable.go index f45ff8e3e..16e5a5aa1 100644 --- a/lending/accountsreceivable.go +++ b/lending/accountsreceivable.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending diff --git a/lending/accounttransactions.go b/lending/accounttransactions.go index 25af26019..a904950ed 100644 --- a/lending/accounttransactions.go +++ b/lending/accounttransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -27,15 +30,23 @@ func newAccountTransactions(sdkConfig sdkConfiguration) *AccountTransactions { // Get account transaction // The *Get account transaction* endpoint returns a single account transaction for a given accountTransactionId. // -// [Account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction) represent bank activity within an accounting platform. All transactions that go through a bank account are recorded as account transactions. +// [Account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction) represent bank activity within an accounting software. All transactions that go through a bank account are recorded as account transactions. // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=accountTransactions) for integrations that support getting a specific account transaction. // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *AccountTransactions) Get(ctx context.Context, request operations.GetAccountingAccountTransactionRequest, opts ...operations.Option) (*operations.GetAccountingAccountTransactionResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-account-transaction", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *AccountTransactions) Get(ctx context.Context, request operations.GetAcc return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/accountTransactions/{accountTransactionId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/accountTransactions/{accountTransactionId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *AccountTransactions) Get(ctx context.Context, request operations.GetAcc }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingAccountTransactionResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingAccountTransaction if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *AccountTransactions) Get(ctx context.Context, request operations.GetAcc res.AccountingAccountTransaction = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,34 +231,66 @@ func (s *AccountTransactions) Get(ctx context.Context, request operations.GetAcc fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List account transactions // The *List account transactions* endpoint returns a list of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction) for a given company's connection. // -// [Account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction) represent bank activity within an accounting platform. All transactions that go through a bank account are recorded as account transactions. +// [Account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction) represent bank activity within an accounting software. All transactions that go through a bank account are recorded as account transactions. // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *AccountTransactions) List(ctx context.Context, request operations.ListAccountingAccountTransactionsRequest, opts ...operations.Option) (*operations.ListAccountingAccountTransactionsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-account-transactions", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *AccountTransactions) List(ctx context.Context, request operations.ListA return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/accountTransactions", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/accountTransactions", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *AccountTransactions) List(ctx context.Context, request operations.ListA }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingAccountTransactionsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingAccountTransactions if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *AccountTransactions) List(ctx context.Context, request operations.ListA res.AccountingAccountTransactions = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *AccountTransactions) List(ctx context.Context, request operations.ListA fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/balancesheet.go b/lending/balancesheet.go index ba182cf00..bf42d6aa8 100644 --- a/lending/balancesheet.go +++ b/lending/balancesheet.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -27,9 +30,17 @@ func newBalanceSheet(sdkConfig sdkConfiguration) *BalanceSheet { // Get balance sheet // Gets the latest balance sheet for a company. func (s *BalanceSheet) Get(ctx context.Context, request operations.GetAccountingBalanceSheetRequest, opts ...operations.Option) (*operations.GetAccountingBalanceSheetResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-balance-sheet", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -37,32 +48,47 @@ func (s *BalanceSheet) Get(ctx context.Context, request operations.GetAccounting return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/financials/balanceSheet", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/financials/balanceSheet", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -70,53 +96,109 @@ func (s *BalanceSheet) Get(ctx context.Context, request operations.GetAccounting }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingBalanceSheetResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingBalanceSheet if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -124,7 +206,12 @@ func (s *BalanceSheet) Get(ctx context.Context, request operations.GetAccounting res.AccountingBalanceSheet = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -142,22 +229,46 @@ func (s *BalanceSheet) Get(ctx context.Context, request operations.GetAccounting fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetCategorizedAccounts - Get categorized balance sheet statement @@ -165,9 +276,17 @@ func (s *BalanceSheet) Get(ctx context.Context, request operations.GetAccounting // // Codat suggests a category for each account automatically, but you can [change it](https://docs.codat.io/lending/enhanced-financials/overview#categorize-accounts) to a more suitable one. func (s *BalanceSheet) GetCategorizedAccounts(ctx context.Context, request operations.GetCategorizedBalanceSheetStatementRequest, opts ...operations.Option) (*operations.GetCategorizedBalanceSheetStatementResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-categorized-balance-sheet-statement", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -175,32 +294,47 @@ func (s *BalanceSheet) GetCategorizedAccounts(ctx context.Context, request opera return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/enhancedBalanceSheet/accounts", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/enhancedBalanceSheet/accounts", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -208,53 +342,109 @@ func (s *BalanceSheet) GetCategorizedAccounts(ctx context.Context, request opera }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCategorizedBalanceSheetStatementResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.EnhancedFinancialReport if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -262,7 +452,12 @@ func (s *BalanceSheet) GetCategorizedAccounts(ctx context.Context, request opera res.EnhancedFinancialReport = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -280,20 +475,44 @@ func (s *BalanceSheet) GetCategorizedAccounts(ctx context.Context, request opera fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/bankaccounts.go b/lending/bankaccounts.go index 81dfbf4ba..1681400eb 100644 --- a/lending/bankaccounts.go +++ b/lending/bankaccounts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -35,9 +38,17 @@ func newBankAccounts(sdkConfig sdkConfiguration) *BankAccounts { // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support creating an account. func (s *BankAccounts) Create(ctx context.Context, request operations.CreateBankAccountRequest, opts ...operations.Option) (*operations.CreateBankAccountResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "create-bank-account", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -45,39 +56,53 @@ func (s *BankAccounts) Create(ctx context.Context, request operations.CreateBank return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/bankAccounts", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/bankAccounts", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, true, true, "AccountingBankAccount", "json", `request:"mediaType=application/json"`) if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -85,53 +110,109 @@ func (s *BankAccounts) Create(ctx context.Context, request operations.CreateBank }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.CreateBankAccountResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingCreateBankAccountResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -139,7 +220,12 @@ func (s *BankAccounts) Create(ctx context.Context, request operations.CreateBank res.AccountingCreateBankAccountResponse = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -157,22 +243,46 @@ func (s *BankAccounts) Create(ctx context.Context, request operations.CreateBank fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetCreateUpdateModel - Get create/update bank account model @@ -186,9 +296,17 @@ func (s *BankAccounts) Create(ctx context.Context, request operations.CreateBank // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support creating and updating a bank account. func (s *BankAccounts) GetCreateUpdateModel(ctx context.Context, request operations.GetCreateUpdateBankAccountsModelRequest, opts ...operations.Option) (*operations.GetCreateUpdateBankAccountsModelResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-create-update-bankAccounts-model", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -196,28 +314,43 @@ func (s *BankAccounts) GetCreateUpdateModel(ctx context.Context, request operati return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/bankAccounts", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/bankAccounts", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -225,53 +358,109 @@ func (s *BankAccounts) GetCreateUpdateModel(ctx context.Context, request operati }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCreateUpdateBankAccountsModelResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.PushOption if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -279,7 +468,12 @@ func (s *BankAccounts) GetCreateUpdateModel(ctx context.Context, request operati res.PushOption = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -295,20 +489,44 @@ func (s *BankAccounts) GetCreateUpdateModel(ctx context.Context, request operati fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/banking.go b/lending/banking.go index efc7b43ea..6e8c75da6 100644 --- a/lending/banking.go +++ b/lending/banking.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending diff --git a/lending/bankstatements.go b/lending/bankstatements.go new file mode 100644 index 000000000..7c1585a67 --- /dev/null +++ b/lending/bankstatements.go @@ -0,0 +1,1231 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package lending + +import ( + "bytes" + "context" + "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" + "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" + "io" + "net/http" +) + +// BankStatements - Retrieve banking data from linked bank accounts. +type BankStatements struct { + sdkConfiguration sdkConfiguration +} + +func newBankStatements(sdkConfig sdkConfiguration) *BankStatements { + return &BankStatements{ + sdkConfiguration: sdkConfig, + } +} + +// EndUploadSession - End upload session +// Use the *End upload session* endpoint to finalize a bank statement upload session. Include a `status` in the request body to indicate if you want to cancel the processing of the dataset or trigger the ingestion and enrichment of the data. +// +// A session is a one-time process that enables you to upload bank statements to Codat. It will time out after 90 minutes if no data is uploaded. +func (s *BankStatements) EndUploadSession(ctx context.Context, request operations.EndBankStatementUploadSessionRequest, opts ...operations.Option) (*operations.EndBankStatementUploadSessionResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "end-bank-statement-upload-session", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/bankStatements/upload/dataset/{datasetId}/endSession", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "EndUploadSessionRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.EndBankStatementUploadSessionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 402: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + fallthrough + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode == 503: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + var out sdkerrors.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetUploadConfiguration - Get upload configuration +// Use the *Get upload configuration* endpoint to view the existing bank statement upload configuration for the specified data connection. +// +// With this configuration, you set the source of the data you plan to upload, the ID of the account in third-party banking platform, and a provider ID, if required. This lets us determine the expected format of the data and any source-specific requirements. +// +// When you use the [*Upload data*](https://docs.codat.io/lending-api#/operations/upload-bank-statement-data) endpoint next, you must upload the data for the account you configured. +func (s *BankStatements) GetUploadConfiguration(ctx context.Context, request operations.GetBankStatementUploadConfigurationRequest, opts ...operations.Option) (*operations.GetBankStatementUploadConfigurationResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-bank-statement-upload-configuration", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/bankStatements/upload/configuration", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetBankStatementUploadConfigurationResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + var out shared.BankStatementUploadConfiguration + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.BankStatementUploadConfiguration = &out + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 402: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + fallthrough + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode == 503: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + var out sdkerrors.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SetUploadConfiguration - Set upload configuration +// Use the *Set upload configuration* endpoint to create bank statement upload configuration for the specified data connection. +// +// With this configuration, you set the source of the data you plan to upload, the ID of the account in third-party banking platform, and a provider ID, if required. This lets us determine the expected format of the data and any source-specific requirements. +// +// Each data connection can only have one configuration for each company and external account ID combination. You will receive a Bad Request response if you try to set it again. +func (s *BankStatements) SetUploadConfiguration(ctx context.Context, request operations.SetBankStatementUploadConfigurationRequest, opts ...operations.Option) (*operations.SetBankStatementUploadConfigurationResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "set-bank-statement-upload-configuration", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/bankStatements/upload/configuration", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "BankStatementUploadConfiguration", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.SetBankStatementUploadConfigurationResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + var out shared.BankStatementUploadConfiguration + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.BankStatementUploadConfiguration = &out + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 402: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + fallthrough + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode == 503: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + var out sdkerrors.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// StartUploadSession - Start upload session +// Use the *Start upload session* endpoint to initiate a bank statement upload session for a given company. +// +// A session is a one-time process that enables you to upload bank statements to Codat. It will time out after 90 minutes if no data is uploaded. +// +// You can only have one active session per data type at a time. You can complete or cancel a session using the [*End upload session*](https://docs.codat.io/lending-api#/operations/end-bank-statement-upload-session) endpoint. +func (s *BankStatements) StartUploadSession(ctx context.Context, request operations.StartBankStatementUploadSessionRequest, opts ...operations.Option) (*operations.StartBankStatementUploadSessionResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "start-bank-statement-upload-session", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/bankStatements/upload/startSession", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "StartUploadSessionRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.StartBankStatementUploadSessionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + var out shared.PullOperation + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PullOperation = &out + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 402: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + fallthrough + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode == 503: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + var out sdkerrors.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// UploadBankStatementData - Upload data +// During an active session, use the **Upload data* endpoint to uploads a page of bank accounts or bank transactions data to the session. +// +// Make sure you created configuration for the account using the [*Set upload configuration*](https://docs.codat.io/lending-api#/operations/set-bank-statement-upload-configuration) endpoint before attempting an upload. +func (s *BankStatements) UploadBankStatementData(ctx context.Context, request operations.UploadBankStatementDataRequest, opts ...operations.Option) (*operations.UploadBankStatementDataResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "upload-bank-statement-data", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/bankStatements/upload/dataset/{datasetId}/upload", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "RequestBody", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.UploadBankStatementDataResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 402: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + fallthrough + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode == 503: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + var out sdkerrors.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/lending/banktransactions.go b/lending/banktransactions.go index 0121b4170..50bbfcb2b 100644 --- a/lending/banktransactions.go +++ b/lending/banktransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -35,9 +38,17 @@ func newBankTransactions(sdkConfig sdkConfiguration) *BankTransactions { // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankTransactions) for integrations that support creating a bank account transactions. func (s *BankTransactions) Create(ctx context.Context, request operations.CreateBankTransactionsRequest, opts ...operations.Option) (*operations.CreateBankTransactionsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "create-bank-transactions", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -45,39 +56,53 @@ func (s *BankTransactions) Create(ctx context.Context, request operations.Create return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/bankAccounts/{accountId}/bankTransactions", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/bankAccounts/{accountId}/bankTransactions", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "AccountingCreateBankTransactions", "json", `request:"mediaType=application/json"`) if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -85,53 +110,109 @@ func (s *BankTransactions) Create(ctx context.Context, request operations.Create }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.CreateBankTransactionsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingCreateBankTransactionsResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -139,7 +220,12 @@ func (s *BankTransactions) Create(ctx context.Context, request operations.Create res.AccountingCreateBankTransactionsResponse = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -157,22 +243,46 @@ func (s *BankTransactions) Create(ctx context.Context, request operations.Create fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetCreateModel - Get create bank account transactions model @@ -186,9 +296,17 @@ func (s *BankTransactions) Create(ctx context.Context, request operations.Create // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankTransactions) for integrations that support creating an bank transaction. func (s *BankTransactions) GetCreateModel(ctx context.Context, request operations.GetCreateBankTransactionsModelRequest, opts ...operations.Option) (*operations.GetCreateBankTransactionsModelResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-create-bank-transactions-model", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -196,28 +314,43 @@ func (s *BankTransactions) GetCreateModel(ctx context.Context, request operation return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/bankAccounts/{accountId}/bankTransactions", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/bankAccounts/{accountId}/bankTransactions", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -225,53 +358,109 @@ func (s *BankTransactions) GetCreateModel(ctx context.Context, request operation }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCreateBankTransactionsModelResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.PushOption if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -279,7 +468,12 @@ func (s *BankTransactions) GetCreateModel(ctx context.Context, request operation res.PushOption = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -295,20 +489,44 @@ func (s *BankTransactions) GetCreateModel(ctx context.Context, request operation fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/billcreditnotes.go b/lending/billcreditnotes.go index b79878b52..b00299ba9 100644 --- a/lending/billcreditnotes.go +++ b/lending/billcreditnotes.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newBillCreditNotes(sdkConfig sdkConfiguration) *BillCreditNotes { // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *BillCreditNotes) Get(ctx context.Context, request operations.GetAccountingBillCreditNoteRequest, opts ...operations.Option) (*operations.GetAccountingBillCreditNoteResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-bill-credit-note", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *BillCreditNotes) Get(ctx context.Context, request operations.GetAccount return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/billCreditNotes/{billCreditNoteId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/billCreditNotes/{billCreditNoteId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *BillCreditNotes) Get(ctx context.Context, request operations.GetAccount }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingBillCreditNoteResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingBillCreditNote if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *BillCreditNotes) Get(ctx context.Context, request operations.GetAccount res.AccountingBillCreditNote = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *BillCreditNotes) Get(ctx context.Context, request operations.GetAccount fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List bill credit notes @@ -169,9 +280,17 @@ func (s *BillCreditNotes) Get(ctx context.Context, request operations.GetAccount // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *BillCreditNotes) List(ctx context.Context, request operations.ListAccountingBillCreditNotesRequest, opts ...operations.Option) (*operations.ListAccountingBillCreditNotesResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-bill-credit-notes", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *BillCreditNotes) List(ctx context.Context, request operations.ListAccou return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/billCreditNotes", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/billCreditNotes", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *BillCreditNotes) List(ctx context.Context, request operations.ListAccou }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingBillCreditNotesResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingBillCreditNotes if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *BillCreditNotes) List(ctx context.Context, request operations.ListAccou res.AccountingBillCreditNotes = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *BillCreditNotes) List(ctx context.Context, request operations.ListAccou fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/billpayments.go b/lending/billpayments.go index 54b23211b..bbb58c1ba 100644 --- a/lending/billpayments.go +++ b/lending/billpayments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newBillPayments(sdkConfig sdkConfiguration) *BillPayments { // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *BillPayments) Get(ctx context.Context, request operations.GetAccountingBillPaymentRequest, opts ...operations.Option) (*operations.GetAccountingBillPaymentResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-bill-payment", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *BillPayments) Get(ctx context.Context, request operations.GetAccounting return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/billPayments/{billPaymentId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/billPayments/{billPaymentId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *BillPayments) Get(ctx context.Context, request operations.GetAccounting }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingBillPaymentResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingBillPayment if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *BillPayments) Get(ctx context.Context, request operations.GetAccounting res.AccountingBillPayment = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *BillPayments) Get(ctx context.Context, request operations.GetAccounting fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List bill payments @@ -169,9 +280,17 @@ func (s *BillPayments) Get(ctx context.Context, request operations.GetAccounting // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *BillPayments) List(ctx context.Context, request operations.ListAccountingBillPaymentsRequest, opts ...operations.Option) (*operations.ListAccountingBillPaymentsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-bill-payments", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *BillPayments) List(ctx context.Context, request operations.ListAccounti return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/billPayments", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/billPayments", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *BillPayments) List(ctx context.Context, request operations.ListAccounti }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingBillPaymentsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingBillPayments if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *BillPayments) List(ctx context.Context, request operations.ListAccounti res.AccountingBillPayments = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *BillPayments) List(ctx context.Context, request operations.ListAccounti fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/bills.go b/lending/bills.go index 3c558c090..f2d0c51b8 100644 --- a/lending/bills.go +++ b/lending/bills.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -31,10 +34,17 @@ func newBills(sdkConfig sdkConfiguration) *Bills { // // 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. func (s *Bills) DownloadAttachment(ctx context.Context, request operations.DownloadAccountingBillAttachmentRequest, opts ...operations.Option) (*operations.DownloadAccountingBillAttachmentResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "download-accounting-bill-attachment", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, - operations.SupportedOptionAcceptHeaderOverride, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -42,33 +52,43 @@ func (s *Bills) DownloadAttachment(ctx context.Context, request operations.Downl return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments/{attachmentId}/download", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments/{attachmentId}/download", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout } - if o.AcceptHeaderOverride != nil { - req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) - } else { - req.Header.Set("Accept", "application/json;q=1, application/octet-stream;q=0") + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/octet-stream") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -76,60 +96,114 @@ func (s *Bills) DownloadAttachment(ctx context.Context, request operations.Downl }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.DownloadAccountingBillAttachmentResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - if (httpRes.StatusCode == 200) && utils.MatchContentType(contentType, `application/octet-stream`) { - res.Data = httpRes.Body - - return res, nil + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/octet-stream`): + res.Data = httpRes.Body + + return res, nil default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -145,22 +219,46 @@ func (s *Bills) DownloadAttachment(ctx context.Context, request operations.Downl fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // Get bill @@ -171,10 +269,22 @@ func (s *Bills) DownloadAttachment(ctx context.Context, request operations.Downl // 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/lending-api#/operations/refresh-company-data). +// +// ### Tips and traps +// +// To access the `paymentAllocations` property, ensure that the `billPayments` data type is queued and cached in Codat before retrieving `bills` from Codat's cache. func (s *Bills) Get(ctx context.Context, request operations.GetAccountingBillRequest, opts ...operations.Option) (*operations.GetAccountingBillResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-bill", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -182,28 +292,43 @@ func (s *Bills) Get(ctx context.Context, request operations.GetAccountingBillReq return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/bills/{billId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/bills/{billId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -211,53 +336,109 @@ func (s *Bills) Get(ctx context.Context, request operations.GetAccountingBillReq }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingBillResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingBill if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -265,7 +446,12 @@ func (s *Bills) Get(ctx context.Context, request operations.GetAccountingBillReq res.AccountingBill = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -283,22 +469,46 @@ func (s *Bills) Get(ctx context.Context, request operations.GetAccountingBillReq fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetAttachment - Get bill attachment @@ -308,9 +518,17 @@ func (s *Bills) Get(ctx context.Context, request operations.GetAccountingBillReq // // 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. func (s *Bills) GetAttachment(ctx context.Context, request operations.GetAccountingBillAttachmentRequest, opts ...operations.Option) (*operations.GetAccountingBillAttachmentResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-bill-attachment", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -318,28 +536,43 @@ func (s *Bills) GetAttachment(ctx context.Context, request operations.GetAccount return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments/{attachmentId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments/{attachmentId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -347,53 +580,109 @@ func (s *Bills) GetAttachment(ctx context.Context, request operations.GetAccount }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingBillAttachmentResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingAttachment if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -401,7 +690,12 @@ func (s *Bills) GetAttachment(ctx context.Context, request operations.GetAccount res.AccountingAttachment = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -417,22 +711,46 @@ func (s *Bills) GetAttachment(ctx context.Context, request operations.GetAccount fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List bills @@ -441,10 +759,22 @@ func (s *Bills) GetAttachment(ctx context.Context, request operations.GetAccount // [Bills](https://docs.codat.io/lending-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/lending-api#/operations/refresh-company-data). +// +// ### Tips and traps +// +// To access the `paymentAllocations` property, ensure that the `billPayments` data type is queued and cached in Codat before retrieving `bills` from Codat's cache. func (s *Bills) List(ctx context.Context, request operations.ListAccountingBillsRequest, opts ...operations.Option) (*operations.ListAccountingBillsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-bills", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -452,32 +782,47 @@ func (s *Bills) List(ctx context.Context, request operations.ListAccountingBills return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/bills", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/bills", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -485,53 +830,109 @@ func (s *Bills) List(ctx context.Context, request operations.ListAccountingBills }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingBillsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingBills if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -539,7 +940,12 @@ func (s *Bills) List(ctx context.Context, request operations.ListAccountingBills res.AccountingBills = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -559,22 +965,46 @@ func (s *Bills) List(ctx context.Context, request operations.ListAccountingBills fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // ListAttachments - List bill attachments @@ -584,9 +1014,17 @@ func (s *Bills) List(ctx context.Context, request operations.ListAccountingBills // // 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. func (s *Bills) ListAttachments(ctx context.Context, request operations.ListAccountingBillAttachmentsRequest, opts ...operations.Option) (*operations.ListAccountingBillAttachmentsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-bill-attachments", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -594,28 +1032,43 @@ func (s *Bills) ListAttachments(ctx context.Context, request operations.ListAcco return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -623,53 +1076,109 @@ func (s *Bills) ListAttachments(ctx context.Context, request operations.ListAcco }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingBillAttachmentsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.Attachments if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -677,7 +1186,12 @@ func (s *Bills) ListAttachments(ctx context.Context, request operations.ListAcco res.Attachments = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -695,20 +1209,44 @@ func (s *Bills) ListAttachments(ctx context.Context, request operations.ListAcco fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/cashflow.go b/lending/cashflow.go index 13aa75de3..7c1e7d390 100644 --- a/lending/cashflow.go +++ b/lending/cashflow.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -27,9 +30,17 @@ func newCashFlow(sdkConfig sdkConfiguration) *CashFlow { // Get cash flow statement // Gets the latest cash flow statement for a company. func (s *CashFlow) Get(ctx context.Context, request operations.GetAccountingCashFlowStatementRequest, opts ...operations.Option) (*operations.GetAccountingCashFlowStatementResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-cash-flow-statement", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -37,32 +48,47 @@ func (s *CashFlow) Get(ctx context.Context, request operations.GetAccountingCash return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/financials/cashFlowStatement", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/financials/cashFlowStatement", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -70,53 +96,109 @@ func (s *CashFlow) Get(ctx context.Context, request operations.GetAccountingCash }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingCashFlowStatementResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingCashFlowStatement if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -124,7 +206,12 @@ func (s *CashFlow) Get(ctx context.Context, request operations.GetAccountingCash res.AccountingCashFlowStatement = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -142,20 +229,44 @@ func (s *CashFlow) Get(ctx context.Context, request operations.GetAccountingCash fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/categorizedstatement.go b/lending/categorizedstatement.go index 4af177e94..f0ba4c1f9 100644 --- a/lending/categorizedstatement.go +++ b/lending/categorizedstatement.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -31,9 +34,17 @@ func newCategorizedStatement(sdkConfig sdkConfiguration) *CategorizedStatement { // // The _Get categorized bank statement_ endpoint provides a fully categorized list of banking transactions for a company. Accounts and transaction data are obtained from the company's banking data sources. func (s *CategorizedStatement) Get(ctx context.Context, request operations.GetCategorizedBankStatementRequest, opts ...operations.Option) (*operations.GetCategorizedBankStatementResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-categorized-bank-statement", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -41,32 +52,47 @@ func (s *CategorizedStatement) Get(ctx context.Context, request operations.GetCa return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/enhancedCashFlow/transactions", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/enhancedCashFlow/transactions", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -74,53 +100,109 @@ func (s *CategorizedStatement) Get(ctx context.Context, request operations.GetCa }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCategorizedBankStatementResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.EnhancedCashFlowTransactions if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -128,7 +210,12 @@ func (s *CategorizedStatement) Get(ctx context.Context, request operations.GetCa res.EnhancedCashFlowTransactions = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -146,20 +233,44 @@ func (s *CategorizedStatement) Get(ctx context.Context, request operations.GetCa fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/codatlending.go b/lending/codatlending.go index 6bafaf941..d57248bef 100644 --- a/lending/codatlending.go +++ b/lending/codatlending.go @@ -1,11 +1,13 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending import ( "context" "fmt" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "net/http" "time" @@ -40,9 +42,11 @@ func Float32(f float32) *float32 { return &f } // Float64 provides a helper function to return a pointer to a float64 func Float64(f float64) *float64 { return &f } +// Pointer provides a helper function to return a pointer to a type +func Pointer[T any](v T) *T { return &v } + type sdkConfiguration struct { - DefaultClient HTTPClient - SecurityClient HTTPClient + Client HTTPClient Security func(context.Context) (interface{}, error) ServerURL string ServerIndex int @@ -51,7 +55,9 @@ type sdkConfiguration struct { SDKVersion string GenVersion string UserAgent string - RetryConfig *utils.RetryConfig + RetryConfig *retry.Config + Hooks *hooks.Hooks + Timeout *time.Duration } func (c *sdkConfiguration) GetServerDetails() (string, map[string]string) { @@ -62,40 +68,42 @@ func (c *sdkConfiguration) GetServerDetails() (string, map[string]string) { return ServerList[c.ServerIndex], nil } -// CodatLending - Lending API: Our Lending API helps you make smarter credit decisions on small businesses by enabling you to pull your customers' latest data from accounting, banking, and commerce platforms they are already using. It also includes features to help providers verify the accuracy of data and process it more efficiently. +// CodatLending - Lending API: Our Lending API helps you make smarter credit decisions on small businesses by enabling you to pull your customers' latest data from accounting, banking, and commerce software they are already using. It also includes features to help providers verify the accuracy of data and process it more efficiently. // // The Lending API is built on top of the latest accounting, commerce, and banking data, providing you with the most important data points you need to get a full picture of SMB creditworthiness and make a comprehensive assessment of your customers. // // [Explore product](https://docs.codat.io/lending/overview) | [See OpenAPI spec](https://github.com/codatio/oas) // -// --- -// +// // ## Endpoints // -// | Endpoints | Description | -// |:---------------------|:-----------------------------------------------------------------------------------------------------------| -// | Companies | Create and manage your SMB users' companies. | -// | Connections | Create new and manage existing data connections for a company. | -// | Bank statements | Retrieve banking data from linked bank accounts. | -// | Sales | Retrieve standardized sales data from a linked commerce platform. | -// | Financial statements | Financial data and reports from a linked accounting platform. | -// | Liabilities | Debt and other liabilities. | -// | Accounts payable | Data from a linked accounting platform representing money the business owes money to its suppliers. | -// | Accounts receivable | Data from a linked accounting platform representing money owed to the business for sold goods or services. | -// | Transactions | Data from a linked accounting platform representing transactions. | -// | Data integrity | Match mutable accounting data with immutable banking data to increase confidence in financial data. | -// | Company info | View company profile from the source platform. | -// | Excel reports | Download reports in Excel format. | -// | Categories | Manage Codat's automatic account categorization functionality. | -// | Manage data | Control how data is retrieved from an integration. | -// | File upload | Endpoints to manage uploaded files. | +// | Endpoints | Description | +// | :- |:- | +// | Companies | Create and manage your SMB users' companies. | +// | Connections | Create new and manage existing data connections for a company. | +// | Bank statements | Retrieve banking data from linked bank accounts. | +// | Sales | Retrieve standardized sales data from a linked commerce software. | +// | Financial statements | Financial data and reports from a linked accounting software. | +// | Liabilities | Debt and other liabilities. | +// | Accounts payable | Data from a linked accounting software representing money the business owes money to its suppliers. | +// | Accounts receivable | Data from a linked accounting software representing money owed to the business for sold goods or services. | +// | Transactions | Data from a linked accounting software representing transactions. | +// | Company info | View company information fetched from the source platform. | +// | Data integrity | Match mutable accounting data with immutable banking data to increase confidence in financial data. | +// | Excel reports | Download reports in Excel format. | +// | Manage data | Control how data is retrieved from an integration. | +// | File upload | Endpoints to manage uploaded files. | +// | Loan writeback | Implement the [loan writeback](https://docs.codat.io/lending/guides/loan-writeback/introduction) procedure in your lending process to maintain an accurate position of a loan during the entire lending cycle. | +// type CodatLending struct { - // Create and manage your Codat companies. + // Create and manage your SMB users' companies. Companies *Companies - // Manage your companies' data connections. - Connections *Connections - Transactions *Transactions - // Access bank transactions from an accounting platform. + // Create new and manage existing data connections for a company. + Connections *Connections + // Retrieve banking data from linked bank accounts. + BankStatements *BankStatements + Transactions *Transactions + // Access bank transactions from an accounting software. AccountingBankData *CodatLendingAccountingBankData Banking *Banking AccountsPayable *AccountsPayable @@ -152,20 +160,14 @@ func WithServerIndex(serverIndex int) SDKOption { // WithClient allows the overriding of the default HTTP client used by the SDK func WithClient(client HTTPClient) SDKOption { return func(sdk *CodatLending) { - sdk.sdkConfiguration.DefaultClient = client - } -} - -func withSecurity(security interface{}) func(context.Context) (interface{}, error) { - return func(context.Context) (interface{}, error) { - return &security, nil + sdk.sdkConfiguration.Client = client } } // WithSecurity configures the SDK to use the provided security details func WithSecurity(security shared.Security) SDKOption { return func(sdk *CodatLending) { - sdk.sdkConfiguration.Security = withSecurity(security) + sdk.sdkConfiguration.Security = utils.AsSecuritySource(security) } } @@ -178,21 +180,29 @@ func WithSecuritySource(security func(context.Context) (shared.Security, error)) } } -func WithRetryConfig(retryConfig utils.RetryConfig) SDKOption { +func WithRetryConfig(retryConfig retry.Config) SDKOption { return func(sdk *CodatLending) { sdk.sdkConfiguration.RetryConfig = &retryConfig } } +// WithTimeout Optional request timeout applied to each operation +func WithTimeout(timeout time.Duration) SDKOption { + return func(sdk *CodatLending) { + sdk.sdkConfiguration.Timeout = &timeout + } +} + // New creates a new instance of the SDK with the provided options func New(opts ...SDKOption) *CodatLending { sdk := &CodatLending{ sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "3.0.0", - SDKVersion: "5.3.0", - GenVersion: "2.253.0", - UserAgent: "speakeasy-sdk/go 5.3.0 2.253.0 3.0.0 github.com/codatio/client-sdk-go/lending", + SDKVersion: "5.4.0", + GenVersion: "2.415.6", + UserAgent: "speakeasy-sdk/go 5.4.0 2.415.6 3.0.0 github.com/codatio/client-sdk-go/lending", + Hooks: hooks.New(), }, } for _, opt := range opts { @@ -200,21 +210,23 @@ func New(opts ...SDKOption) *CodatLending { } // Use WithClient to override the default client if you would like to customize the timeout - if sdk.sdkConfiguration.DefaultClient == nil { - sdk.sdkConfiguration.DefaultClient = &http.Client{Timeout: 60 * time.Second} + if sdk.sdkConfiguration.Client == nil { + sdk.sdkConfiguration.Client = &http.Client{Timeout: 60 * time.Second} } - if sdk.sdkConfiguration.SecurityClient == nil { - if sdk.sdkConfiguration.Security != nil { - sdk.sdkConfiguration.SecurityClient = utils.ConfigureSecurityClient(sdk.sdkConfiguration.DefaultClient, sdk.sdkConfiguration.Security) - } else { - sdk.sdkConfiguration.SecurityClient = sdk.sdkConfiguration.DefaultClient - } + + currentServerURL, _ := sdk.sdkConfiguration.GetServerDetails() + serverURL := currentServerURL + serverURL, sdk.sdkConfiguration.Client = sdk.sdkConfiguration.Hooks.SDKInit(currentServerURL, sdk.sdkConfiguration.Client) + if serverURL != currentServerURL { + sdk.sdkConfiguration.ServerURL = serverURL } sdk.Companies = newCompanies(sdk.sdkConfiguration) sdk.Connections = newConnections(sdk.sdkConfiguration) + sdk.BankStatements = newBankStatements(sdk.sdkConfiguration) + sdk.Transactions = newTransactions(sdk.sdkConfiguration) sdk.AccountingBankData = newCodatLendingAccountingBankData(sdk.sdkConfiguration) diff --git a/lending/codatlendingaccountingbankdata.go b/lending/codatlendingaccountingbankdata.go index c599a42d3..a3fe9fb0e 100644 --- a/lending/codatlendingaccountingbankdata.go +++ b/lending/codatlendingaccountingbankdata.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,15 +6,18 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" ) -// CodatLendingAccountingBankData - Access bank transactions from an accounting platform. +// CodatLendingAccountingBankData - Access bank transactions from an accounting software. type CodatLendingAccountingBankData struct { Accounts *Accounts @@ -37,9 +40,17 @@ func newCodatLendingAccountingBankData(sdkConfig sdkConfiguration) *CodatLending // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingAccountingBankData) ListTransactions(ctx context.Context, request operations.ListAccountingBankAccountTransactionsRequest, opts ...operations.Option) (*operations.ListAccountingBankAccountTransactionsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-bank-account-transactions", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -47,32 +58,47 @@ func (s *CodatLendingAccountingBankData) ListTransactions(ctx context.Context, r return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/bankAccounts/{accountId}/bankTransactions", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/bankAccounts/{accountId}/bankTransactions", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -80,53 +106,109 @@ func (s *CodatLendingAccountingBankData) ListTransactions(ctx context.Context, r }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingBankAccountTransactionsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingBankTransactions if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -134,7 +216,12 @@ func (s *CodatLendingAccountingBankData) ListTransactions(ctx context.Context, r res.AccountingBankTransactions = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -154,20 +241,44 @@ func (s *CodatLendingAccountingBankData) ListTransactions(ctx context.Context, r fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/codatlendingaccounts.go b/lending/codatlendingaccounts.go index d98b2ee5a..f7c1e6d36 100644 --- a/lending/codatlendingaccounts.go +++ b/lending/codatlendingaccounts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newCodatLendingAccounts(sdkConfig sdkConfiguration) *CodatLendingAccounts { // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingAccounts) Get(ctx context.Context, request operations.GetBankingAccountRequest, opts ...operations.Option) (*operations.GetBankingAccountResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-banking-account", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *CodatLendingAccounts) Get(ctx context.Context, request operations.GetBa return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/banking-accounts/{accountId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/banking-accounts/{accountId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *CodatLendingAccounts) Get(ctx context.Context, request operations.GetBa }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetBankingAccountResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.BankingAccount if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *CodatLendingAccounts) Get(ctx context.Context, request operations.GetBa res.BankingAccount = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *CodatLendingAccounts) Get(ctx context.Context, request operations.GetBa fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List accounts @@ -169,9 +280,17 @@ func (s *CodatLendingAccounts) Get(ctx context.Context, request operations.GetBa // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingAccounts) List(ctx context.Context, request operations.ListBankingAccountsRequest, opts ...operations.Option) (*operations.ListBankingAccountsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-banking-accounts", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *CodatLendingAccounts) List(ctx context.Context, request operations.List return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/banking-accounts", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/banking-accounts", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *CodatLendingAccounts) List(ctx context.Context, request operations.List }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListBankingAccountsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.BankingAccounts if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *CodatLendingAccounts) List(ctx context.Context, request operations.List res.BankingAccounts = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *CodatLendingAccounts) List(ctx context.Context, request operations.List fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/codatlendingbankingtransactions.go b/lending/codatlendingbankingtransactions.go index 82743f5d8..697250650 100644 --- a/lending/codatlendingbankingtransactions.go +++ b/lending/codatlendingbankingtransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newCodatLendingBankingTransactions(sdkConfig sdkConfiguration) *CodatLendin // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingBankingTransactions) Get(ctx context.Context, request operations.GetBankingTransactionRequest, opts ...operations.Option) (*operations.GetBankingTransactionResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-banking-transaction", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *CodatLendingBankingTransactions) Get(ctx context.Context, request opera return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/banking-transactions/{transactionId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/banking-transactions/{transactionId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *CodatLendingBankingTransactions) Get(ctx context.Context, request opera }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetBankingTransactionResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.BankingTransaction if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *CodatLendingBankingTransactions) Get(ctx context.Context, request opera res.BankingTransaction = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *CodatLendingBankingTransactions) Get(ctx context.Context, request opera fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List transactions @@ -169,9 +280,17 @@ func (s *CodatLendingBankingTransactions) Get(ctx context.Context, request opera // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingBankingTransactions) List(ctx context.Context, request operations.ListBankingTransactionsRequest, opts ...operations.Option) (*operations.ListBankingTransactionsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-banking-transactions", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *CodatLendingBankingTransactions) List(ctx context.Context, request oper return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/banking-transactions", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/banking-transactions", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *CodatLendingBankingTransactions) List(ctx context.Context, request oper }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListBankingTransactionsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.BankingTransactions if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *CodatLendingBankingTransactions) List(ctx context.Context, request oper res.BankingTransactions = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *CodatLendingBankingTransactions) List(ctx context.Context, request oper fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/codatlendingcustomers.go b/lending/codatlendingcustomers.go index be52868b7..db6865938 100644 --- a/lending/codatlendingcustomers.go +++ b/lending/codatlendingcustomers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newCodatLendingCustomers(sdkConfig sdkConfiguration) *CodatLendingCustomers // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingCustomers) Get(ctx context.Context, request operations.GetCommerceCustomerRequest, opts ...operations.Option) (*operations.GetCommerceCustomerResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-commerce-customer", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *CodatLendingCustomers) Get(ctx context.Context, request operations.GetC return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-customers/{customerId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-customers/{customerId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *CodatLendingCustomers) Get(ctx context.Context, request operations.GetC }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCommerceCustomerResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceCustomer if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *CodatLendingCustomers) Get(ctx context.Context, request operations.GetC res.CommerceCustomer = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *CodatLendingCustomers) Get(ctx context.Context, request operations.GetC fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List customers @@ -169,9 +280,17 @@ func (s *CodatLendingCustomers) Get(ctx context.Context, request operations.GetC // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingCustomers) List(ctx context.Context, request operations.ListCommerceCustomersRequest, opts ...operations.Option) (*operations.ListCommerceCustomersResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-commerce-customers", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *CodatLendingCustomers) List(ctx context.Context, request operations.Lis return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-customers", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-customers", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *CodatLendingCustomers) List(ctx context.Context, request operations.Lis }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListCommerceCustomersResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceCustomers if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *CodatLendingCustomers) List(ctx context.Context, request operations.Lis res.CommerceCustomers = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *CodatLendingCustomers) List(ctx context.Context, request operations.Lis fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/codatlendingdirectcosts.go b/lending/codatlendingdirectcosts.go index 42fd476b7..c547006fa 100644 --- a/lending/codatlendingdirectcosts.go +++ b/lending/codatlendingdirectcosts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -31,10 +34,17 @@ func newCodatLendingDirectCosts(sdkConfig sdkConfiguration) *CodatLendingDirectC // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support downloading a direct cost attachment. func (s *CodatLendingDirectCosts) DownloadAttachment(ctx context.Context, request operations.DownloadAccountingDirectCostAttachmentRequest, opts ...operations.Option) (*operations.DownloadAccountingDirectCostAttachmentResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "download-accounting-direct-cost-attachment", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, - operations.SupportedOptionAcceptHeaderOverride, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -42,33 +52,43 @@ func (s *CodatLendingDirectCosts) DownloadAttachment(ctx context.Context, reques return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}/attachments/{attachmentId}/download", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}/attachments/{attachmentId}/download", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout } - if o.AcceptHeaderOverride != nil { - req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) - } else { - req.Header.Set("Accept", "application/json;q=1, application/octet-stream;q=0") + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/octet-stream") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -76,60 +96,114 @@ func (s *CodatLendingDirectCosts) DownloadAttachment(ctx context.Context, reques }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.DownloadAccountingDirectCostAttachmentResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - if (httpRes.StatusCode == 200) && utils.MatchContentType(contentType, `application/octet-stream`) { - res.Data = httpRes.Body - - return res, nil + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/octet-stream`): + res.Data = httpRes.Body + + return res, nil default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -145,22 +219,46 @@ func (s *CodatLendingDirectCosts) DownloadAttachment(ctx context.Context, reques fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // Get direct cost @@ -172,9 +270,17 @@ func (s *CodatLendingDirectCosts) DownloadAttachment(ctx context.Context, reques // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingDirectCosts) Get(ctx context.Context, request operations.GetAccountingDirectCostRequest, opts ...operations.Option) (*operations.GetAccountingDirectCostResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-direct-cost", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -182,28 +288,43 @@ func (s *CodatLendingDirectCosts) Get(ctx context.Context, request operations.Ge return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -211,53 +332,109 @@ func (s *CodatLendingDirectCosts) Get(ctx context.Context, request operations.Ge }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingDirectCostResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingDirectCost if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -265,7 +442,12 @@ func (s *CodatLendingDirectCosts) Get(ctx context.Context, request operations.Ge res.AccountingDirectCost = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -283,22 +465,46 @@ func (s *CodatLendingDirectCosts) Get(ctx context.Context, request operations.Ge fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetAttachment - Get direct cost attachment @@ -308,9 +514,17 @@ func (s *CodatLendingDirectCosts) Get(ctx context.Context, request operations.Ge // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support getting a direct cost attachment. func (s *CodatLendingDirectCosts) GetAttachment(ctx context.Context, request operations.GetAccountingDirectCostAttachmentRequest, opts ...operations.Option) (*operations.GetAccountingDirectCostAttachmentResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-direct-cost-attachment", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -318,28 +532,43 @@ func (s *CodatLendingDirectCosts) GetAttachment(ctx context.Context, request ope return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}/attachments/{attachmentId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}/attachments/{attachmentId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -347,53 +576,109 @@ func (s *CodatLendingDirectCosts) GetAttachment(ctx context.Context, request ope }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingDirectCostAttachmentResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingAttachment if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -401,7 +686,12 @@ func (s *CodatLendingDirectCosts) GetAttachment(ctx context.Context, request ope res.AccountingAttachment = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -417,22 +707,46 @@ func (s *CodatLendingDirectCosts) GetAttachment(ctx context.Context, request ope fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List direct costs @@ -442,9 +756,17 @@ func (s *CodatLendingDirectCosts) GetAttachment(ctx context.Context, request ope // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingDirectCosts) List(ctx context.Context, request operations.ListAccountingDirectCostsRequest, opts ...operations.Option) (*operations.ListAccountingDirectCostsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-direct-costs", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -452,32 +774,47 @@ func (s *CodatLendingDirectCosts) List(ctx context.Context, request operations.L return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directCosts", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directCosts", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -485,53 +822,109 @@ func (s *CodatLendingDirectCosts) List(ctx context.Context, request operations.L }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingDirectCostsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingDirectCosts if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -539,7 +932,12 @@ func (s *CodatLendingDirectCosts) List(ctx context.Context, request operations.L res.AccountingDirectCosts = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -559,22 +957,46 @@ func (s *CodatLendingDirectCosts) List(ctx context.Context, request operations.L fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // ListAttachments - List direct cost attachments @@ -584,9 +1006,17 @@ func (s *CodatLendingDirectCosts) List(ctx context.Context, request operations.L // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support listing direct cost attachments. func (s *CodatLendingDirectCosts) ListAttachments(ctx context.Context, request operations.ListAccountingDirectCostAttachmentsRequest, opts ...operations.Option) (*operations.ListAccountingDirectCostAttachmentsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-direct-cost-attachments", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -594,28 +1024,43 @@ func (s *CodatLendingDirectCosts) ListAttachments(ctx context.Context, request o return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}/attachments", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}/attachments", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -623,53 +1068,109 @@ func (s *CodatLendingDirectCosts) ListAttachments(ctx context.Context, request o }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingDirectCostAttachmentsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.Attachments if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -677,7 +1178,12 @@ func (s *CodatLendingDirectCosts) ListAttachments(ctx context.Context, request o res.Attachments = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -695,20 +1201,44 @@ func (s *CodatLendingDirectCosts) ListAttachments(ctx context.Context, request o fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/codatlendingfinancialstatementsaccounts.go b/lending/codatlendingfinancialstatementsaccounts.go index 66d8f4add..0b171d694 100644 --- a/lending/codatlendingfinancialstatementsaccounts.go +++ b/lending/codatlendingfinancialstatementsaccounts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newCodatLendingFinancialStatementsAccounts(sdkConfig sdkConfiguration) *Cod // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingFinancialStatementsAccounts) Get(ctx context.Context, request operations.GetAccountingAccountRequest, opts ...operations.Option) (*operations.GetAccountingAccountResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-account", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *CodatLendingFinancialStatementsAccounts) Get(ctx context.Context, reque return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/accounts/{accountId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/accounts/{accountId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *CodatLendingFinancialStatementsAccounts) Get(ctx context.Context, reque }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingAccountResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingAccount if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *CodatLendingFinancialStatementsAccounts) Get(ctx context.Context, reque res.AccountingAccount = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *CodatLendingFinancialStatementsAccounts) Get(ctx context.Context, reque fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List accounts @@ -169,9 +280,17 @@ func (s *CodatLendingFinancialStatementsAccounts) Get(ctx context.Context, reque // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingFinancialStatementsAccounts) List(ctx context.Context, request operations.ListAccountingAccountsRequest, opts ...operations.Option) (*operations.ListAccountingAccountsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-accounts", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *CodatLendingFinancialStatementsAccounts) List(ctx context.Context, requ return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/accounts", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/accounts", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *CodatLendingFinancialStatementsAccounts) List(ctx context.Context, requ }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingAccountsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingAccounts if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *CodatLendingFinancialStatementsAccounts) List(ctx context.Context, requ res.AccountingAccounts = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *CodatLendingFinancialStatementsAccounts) List(ctx context.Context, requ fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/codatlendingloanwritebackaccounts.go b/lending/codatlendingloanwritebackaccounts.go index 05df17be1..a753aade6 100644 --- a/lending/codatlendingloanwritebackaccounts.go +++ b/lending/codatlendingloanwritebackaccounts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -35,9 +38,17 @@ func newCodatLendingLoanWritebackAccounts(sdkConfig sdkConfiguration) *CodatLend // // 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. func (s *CodatLendingLoanWritebackAccounts) Create(ctx context.Context, request operations.CreateAccountRequest, opts ...operations.Option) (*operations.CreateAccountResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "create-account", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -45,39 +56,53 @@ func (s *CodatLendingLoanWritebackAccounts) Create(ctx context.Context, request return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/accounts", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/accounts", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "AccountPrototype", "json", `request:"mediaType=application/json"`) if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -85,53 +110,109 @@ func (s *CodatLendingLoanWritebackAccounts) Create(ctx context.Context, request }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.CreateAccountResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingCreateAccountResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -139,7 +220,12 @@ func (s *CodatLendingLoanWritebackAccounts) Create(ctx context.Context, request res.AccountingCreateAccountResponse = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -157,22 +243,46 @@ func (s *CodatLendingLoanWritebackAccounts) Create(ctx context.Context, request fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetCreateModel - Get create account model @@ -186,9 +296,17 @@ func (s *CodatLendingLoanWritebackAccounts) Create(ctx context.Context, request // // 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. func (s *CodatLendingLoanWritebackAccounts) GetCreateModel(ctx context.Context, request operations.GetCreateChartOfAccountsModelRequest, opts ...operations.Option) (*operations.GetCreateChartOfAccountsModelResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-create-chartOfAccounts-model", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -196,28 +314,43 @@ func (s *CodatLendingLoanWritebackAccounts) GetCreateModel(ctx context.Context, return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/chartOfAccounts", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/chartOfAccounts", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -225,53 +358,109 @@ func (s *CodatLendingLoanWritebackAccounts) GetCreateModel(ctx context.Context, }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCreateChartOfAccountsModelResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.PushOption if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -279,7 +468,12 @@ func (s *CodatLendingLoanWritebackAccounts) GetCreateModel(ctx context.Context, res.PushOption = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -295,20 +489,44 @@ func (s *CodatLendingLoanWritebackAccounts) GetCreateModel(ctx context.Context, fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/codatlendingpayments.go b/lending/codatlendingpayments.go index 33337be8c..938076c7e 100644 --- a/lending/codatlendingpayments.go +++ b/lending/codatlendingpayments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -35,9 +38,17 @@ func newCodatLendingPayments(sdkConfig sdkConfiguration) *CodatLendingPayments { // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=payments) for integrations that support creating an account. func (s *CodatLendingPayments) Create(ctx context.Context, request operations.CreatePaymentRequest, opts ...operations.Option) (*operations.CreatePaymentResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "create-payment", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -45,39 +56,53 @@ func (s *CodatLendingPayments) Create(ctx context.Context, request operations.Cr return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/payments", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/payments", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, true, true, "AccountingPayment", "json", `request:"mediaType=application/json"`) if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -85,53 +110,109 @@ func (s *CodatLendingPayments) Create(ctx context.Context, request operations.Cr }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.CreatePaymentResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingCreatePaymentResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -139,7 +220,12 @@ func (s *CodatLendingPayments) Create(ctx context.Context, request operations.Cr res.AccountingCreatePaymentResponse = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -157,22 +243,46 @@ func (s *CodatLendingPayments) Create(ctx context.Context, request operations.Cr fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetCreateModel - Get create payment model @@ -186,9 +296,17 @@ func (s *CodatLendingPayments) Create(ctx context.Context, request operations.Cr // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=payments) for integrations that support creating a payment. func (s *CodatLendingPayments) GetCreateModel(ctx context.Context, request operations.GetCreatePaymentModelRequest, opts ...operations.Option) (*operations.GetCreatePaymentModelResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-create-payment-model", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -196,28 +314,43 @@ func (s *CodatLendingPayments) GetCreateModel(ctx context.Context, request opera return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/payments", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/payments", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -225,53 +358,109 @@ func (s *CodatLendingPayments) GetCreateModel(ctx context.Context, request opera }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCreatePaymentModelResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.PushOption if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -279,7 +468,12 @@ func (s *CodatLendingPayments) GetCreateModel(ctx context.Context, request opera res.PushOption = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -295,20 +489,44 @@ func (s *CodatLendingPayments) GetCreateModel(ctx context.Context, request opera fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/codatlendingreports.go b/lending/codatlendingreports.go index 0add7e396..c572666e5 100644 --- a/lending/codatlendingreports.go +++ b/lending/codatlendingreports.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -49,9 +52,17 @@ func newCodatLendingReports(sdkConfig sdkConfiguration) *CodatLendingReports { // // The report data then combines multiple reporting dimensions and measures and outputs the value of each combination. func (s *CodatLendingReports) GetOrders(ctx context.Context, request operations.GetCommerceOrdersReportRequest, opts ...operations.Option) (*operations.GetCommerceOrdersReportResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-commerce-orders-report", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -59,32 +70,47 @@ func (s *CodatLendingReports) GetOrders(ctx context.Context, request operations. return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/connections/{connectionId}/assess/commerceMetrics/orders", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/connections/{connectionId}/assess/commerceMetrics/orders", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -92,53 +118,109 @@ func (s *CodatLendingReports) GetOrders(ctx context.Context, request operations. }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCommerceOrdersReportResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceReport if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -146,7 +228,12 @@ func (s *CodatLendingReports) GetOrders(ctx context.Context, request operations. res.CommerceReport = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -164,22 +251,46 @@ func (s *CodatLendingReports) GetOrders(ctx context.Context, request operations. fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetRefunds - Get refunds report @@ -208,9 +319,17 @@ func (s *CodatLendingReports) GetOrders(ctx context.Context, request operations. // // The report data then combines multiple reporting dimensions and measures and outputs the value of each combination. func (s *CodatLendingReports) GetRefunds(ctx context.Context, request operations.GetCommerceRefundsReportRequest, opts ...operations.Option) (*operations.GetCommerceRefundsReportResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-commerce-refunds-report", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -218,32 +337,47 @@ func (s *CodatLendingReports) GetRefunds(ctx context.Context, request operations return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/connections/{connectionId}/assess/commerceMetrics/refunds", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/connections/{connectionId}/assess/commerceMetrics/refunds", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -251,53 +385,109 @@ func (s *CodatLendingReports) GetRefunds(ctx context.Context, request operations }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCommerceRefundsReportResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceReport if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -305,7 +495,12 @@ func (s *CodatLendingReports) GetRefunds(ctx context.Context, request operations res.CommerceReport = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -323,20 +518,44 @@ func (s *CodatLendingReports) GetRefunds(ctx context.Context, request operations fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/codatlendingsalespayments.go b/lending/codatlendingsalespayments.go index b8244068c..2b374bb78 100644 --- a/lending/codatlendingsalespayments.go +++ b/lending/codatlendingsalespayments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newCodatLendingSalesPayments(sdkConfig sdkConfiguration) *CodatLendingSales // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingSalesPayments) Get(ctx context.Context, request operations.GetCommercePaymentRequest, opts ...operations.Option) (*operations.GetCommercePaymentResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-commerce-payment", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *CodatLendingSalesPayments) Get(ctx context.Context, request operations. return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-payments/{paymentId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-payments/{paymentId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *CodatLendingSalesPayments) Get(ctx context.Context, request operations. }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCommercePaymentResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommercePayment if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *CodatLendingSalesPayments) Get(ctx context.Context, request operations. res.CommercePayment = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *CodatLendingSalesPayments) Get(ctx context.Context, request operations. fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List payments @@ -169,9 +280,17 @@ func (s *CodatLendingSalesPayments) Get(ctx context.Context, request operations. // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingSalesPayments) List(ctx context.Context, request operations.ListCommercePaymentsRequest, opts ...operations.Option) (*operations.ListCommercePaymentsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-commerce-payments", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *CodatLendingSalesPayments) List(ctx context.Context, request operations return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-payments", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-payments", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *CodatLendingSalesPayments) List(ctx context.Context, request operations }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListCommercePaymentsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommercePayments if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *CodatLendingSalesPayments) List(ctx context.Context, request operations res.CommercePayments = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *CodatLendingSalesPayments) List(ctx context.Context, request operations fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/codatlendingsuppliers.go b/lending/codatlendingsuppliers.go index de8e67272..f495c392b 100644 --- a/lending/codatlendingsuppliers.go +++ b/lending/codatlendingsuppliers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -35,9 +38,17 @@ func newCodatLendingSuppliers(sdkConfig sdkConfiguration) *CodatLendingSuppliers // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating an account. func (s *CodatLendingSuppliers) Create(ctx context.Context, request operations.CreateSupplierRequest, opts ...operations.Option) (*operations.CreateSupplierResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "create-supplier", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -45,39 +56,53 @@ func (s *CodatLendingSuppliers) Create(ctx context.Context, request operations.C return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/suppliers", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/suppliers", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, true, true, "AccountingSupplier", "json", `request:"mediaType=application/json"`) if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -85,53 +110,109 @@ func (s *CodatLendingSuppliers) Create(ctx context.Context, request operations.C }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.CreateSupplierResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingCreateSupplierResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -139,7 +220,12 @@ func (s *CodatLendingSuppliers) Create(ctx context.Context, request operations.C res.AccountingCreateSupplierResponse = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -157,22 +243,46 @@ func (s *CodatLendingSuppliers) Create(ctx context.Context, request operations.C fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetCreateUpdateModel - Get create/update supplier model @@ -186,9 +296,17 @@ func (s *CodatLendingSuppliers) Create(ctx context.Context, request operations.C // // 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. func (s *CodatLendingSuppliers) GetCreateUpdateModel(ctx context.Context, request operations.GetCreateUpdateSuppliersModelRequest, opts ...operations.Option) (*operations.GetCreateUpdateSuppliersModelResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-create-update-suppliers-model", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -196,28 +314,43 @@ func (s *CodatLendingSuppliers) GetCreateUpdateModel(ctx context.Context, reques return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/suppliers", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/suppliers", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -225,53 +358,109 @@ func (s *CodatLendingSuppliers) GetCreateUpdateModel(ctx context.Context, reques }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCreateUpdateSuppliersModelResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.PushOption if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -279,7 +468,12 @@ func (s *CodatLendingSuppliers) GetCreateUpdateModel(ctx context.Context, reques res.PushOption = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -295,20 +489,44 @@ func (s *CodatLendingSuppliers) GetCreateUpdateModel(ctx context.Context, reques fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/codatlendingtransactions.go b/lending/codatlendingtransactions.go index c21ce1086..68208c146 100644 --- a/lending/codatlendingtransactions.go +++ b/lending/codatlendingtransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newCodatLendingTransactions(sdkConfig sdkConfiguration) *CodatLendingTransa // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingTransactions) Get(ctx context.Context, request operations.GetCommerceTransactionRequest, opts ...operations.Option) (*operations.GetCommerceTransactionResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-commerce-transaction", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *CodatLendingTransactions) Get(ctx context.Context, request operations.G return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-transactions/{transactionId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-transactions/{transactionId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *CodatLendingTransactions) Get(ctx context.Context, request operations.G }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCommerceTransactionResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceTransaction if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *CodatLendingTransactions) Get(ctx context.Context, request operations.G res.CommerceTransaction = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *CodatLendingTransactions) Get(ctx context.Context, request operations.G fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List transactions @@ -169,9 +280,17 @@ func (s *CodatLendingTransactions) Get(ctx context.Context, request operations.G // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingTransactions) List(ctx context.Context, request operations.ListCommerceTransactionsRequest, opts ...operations.Option) (*operations.ListCommerceTransactionsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-commerce-transactions", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *CodatLendingTransactions) List(ctx context.Context, request operations. return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-transactions", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-transactions", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *CodatLendingTransactions) List(ctx context.Context, request operations. }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListCommerceTransactionsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceTransactions if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *CodatLendingTransactions) List(ctx context.Context, request operations. res.CommerceTransactions = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *CodatLendingTransactions) List(ctx context.Context, request operations. fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/codatlendingtransfers.go b/lending/codatlendingtransfers.go index a3c68c18c..85d43281b 100644 --- a/lending/codatlendingtransfers.go +++ b/lending/codatlendingtransfers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newCodatLendingTransfers(sdkConfig sdkConfiguration) *CodatLendingTransfers // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingTransfers) Get(ctx context.Context, request operations.GetAccountingTransferRequest, opts ...operations.Option) (*operations.GetAccountingTransferResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-transfer", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *CodatLendingTransfers) Get(ctx context.Context, request operations.GetA return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/transfers/{transferId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/transfers/{transferId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *CodatLendingTransfers) Get(ctx context.Context, request operations.GetA }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingTransferResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingTransfer if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *CodatLendingTransfers) Get(ctx context.Context, request operations.GetA res.AccountingTransfer = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *CodatLendingTransfers) Get(ctx context.Context, request operations.GetA fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List transfers @@ -169,9 +280,17 @@ func (s *CodatLendingTransfers) Get(ctx context.Context, request operations.GetA // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CodatLendingTransfers) List(ctx context.Context, request operations.ListAccountingTransfersRequest, opts ...operations.Option) (*operations.ListAccountingTransfersResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-transfers", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *CodatLendingTransfers) List(ctx context.Context, request operations.Lis return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/transfers", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/transfers", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *CodatLendingTransfers) List(ctx context.Context, request operations.Lis }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingTransfersResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingTransfers if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *CodatLendingTransfers) List(ctx context.Context, request operations.Lis res.AccountingTransfers = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *CodatLendingTransfers) List(ctx context.Context, request operations.Lis fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/companies.go b/lending/companies.go index da63b3831..475589996 100644 --- a/lending/companies.go +++ b/lending/companies.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,16 +6,19 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" - "strings" + "net/url" ) -// Companies - Create and manage your Codat companies. +// Companies - Create and manage your SMB users' companies. type Companies struct { sdkConfiguration sdkConfiguration } @@ -34,9 +37,17 @@ func newCompanies(sdkConfig sdkConfiguration) *Companies { // // 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`. func (s *Companies) Create(ctx context.Context, request *shared.CompanyRequestBody, opts ...operations.Option) (*operations.CreateCompanyResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "create-company", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -44,32 +55,49 @@ func (s *Companies) Create(ctx context.Context, request *shared.CompanyRequestBo return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url := strings.TrimSuffix(baseURL, "/") + "/companies" + opURL, err := url.JoinPath(baseURL, "/companies") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -77,53 +105,109 @@ func (s *Companies) Create(ctx context.Context, request *shared.CompanyRequestBo }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.CreateCompanyResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.Company if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -131,7 +215,12 @@ func (s *Companies) Create(ctx context.Context, request *shared.CompanyRequestBo res.Company = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -147,22 +236,46 @@ func (s *Companies) Create(ctx context.Context, request *shared.CompanyRequestBo fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // Delete a company @@ -171,9 +284,17 @@ func (s *Companies) Create(ctx context.Context, request *shared.CompanyRequestBo // A [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data. // Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. func (s *Companies) Delete(ctx context.Context, request operations.DeleteCompanyRequest, opts ...operations.Option) (*operations.DeleteCompanyResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "delete-company", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -181,28 +302,43 @@ func (s *Companies) Delete(ctx context.Context, request operations.DeleteCompany return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -210,49 +346,100 @@ func (s *Companies) Delete(ctx context.Context, request operations.DeleteCompany }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.DeleteCompanyResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 204: case httpRes.StatusCode == 401: @@ -269,22 +456,46 @@ func (s *Companies) Delete(ctx context.Context, request operations.DeleteCompany fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // Get company @@ -293,9 +504,17 @@ func (s *Companies) Delete(ctx context.Context, request operations.DeleteCompany // A [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data. // Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. func (s *Companies) Get(ctx context.Context, request operations.GetCompanyRequest, opts ...operations.Option) (*operations.GetCompanyResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-company", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -303,28 +522,43 @@ func (s *Companies) Get(ctx context.Context, request operations.GetCompanyReques return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -332,53 +566,109 @@ func (s *Companies) Get(ctx context.Context, request operations.GetCompanyReques }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCompanyResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.Company if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -386,7 +676,12 @@ func (s *Companies) Get(ctx context.Context, request operations.GetCompanyReques res.Company = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -402,22 +697,46 @@ func (s *Companies) Get(ctx context.Context, request operations.GetCompanyReques fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List companies @@ -426,9 +745,17 @@ func (s *Companies) Get(ctx context.Context, request operations.GetCompanyReques // A [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data. // Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. func (s *Companies) List(ctx context.Context, request operations.ListCompaniesRequest, opts ...operations.Option) (*operations.ListCompaniesResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-companies", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -436,29 +763,47 @@ func (s *Companies) List(ctx context.Context, request operations.ListCompaniesRe return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url := strings.TrimSuffix(baseURL, "/") + "/companies" + opURL, err := url.JoinPath(baseURL, "/companies") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -466,53 +811,109 @@ func (s *Companies) List(ctx context.Context, request operations.ListCompaniesRe }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListCompaniesResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.Companies if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -520,7 +921,12 @@ func (s *Companies) List(ctx context.Context, request operations.ListCompaniesRe res.Companies = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -538,22 +944,46 @@ func (s *Companies) List(ctx context.Context, request operations.ListCompaniesRe fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // Update company @@ -563,9 +993,17 @@ func (s *Companies) List(ctx context.Context, request operations.ListCompaniesRe // A [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data. // Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. func (s *Companies) Update(ctx context.Context, request operations.UpdateCompanyRequest, opts ...operations.Option) (*operations.UpdateCompanyResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "update-company", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -573,35 +1011,49 @@ func (s *Companies) Update(ctx context.Context, request operations.UpdateCompany return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "CompanyRequestBody", "json", `request:"mediaType=application/json"`) if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) + return nil, err } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -609,53 +1061,109 @@ func (s *Companies) Update(ctx context.Context, request operations.UpdateCompany }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.UpdateCompanyResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.Company if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -663,7 +1171,12 @@ func (s *Companies) Update(ctx context.Context, request operations.UpdateCompany res.Company = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -679,20 +1192,44 @@ func (s *Companies) Update(ctx context.Context, request operations.UpdateCompany fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/companyinfo.go b/lending/companyinfo.go index 903daf854..b02414835 100644 --- a/lending/companyinfo.go +++ b/lending/companyinfo.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -28,9 +31,17 @@ func newCompanyInfo(sdkConfig sdkConfiguration) *CompanyInfo { // GetAccountingProfile - Get company accounting profile // Gets the latest basic info for a company. func (s *CompanyInfo) GetAccountingProfile(ctx context.Context, request operations.GetAccountingProfileRequest, opts ...operations.Option) (*operations.GetAccountingProfileResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-profile", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -38,28 +49,43 @@ func (s *CompanyInfo) GetAccountingProfile(ctx context.Context, request operatio return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/info", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/info", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -67,53 +93,109 @@ func (s *CompanyInfo) GetAccountingProfile(ctx context.Context, request operatio }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingProfileResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingCompanyInfo if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -121,7 +203,12 @@ func (s *CompanyInfo) GetAccountingProfile(ctx context.Context, request operatio res.AccountingCompanyInfo = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -139,22 +226,46 @@ func (s *CompanyInfo) GetAccountingProfile(ctx context.Context, request operatio fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetCommerceProfile - Get company commerce profile @@ -164,9 +275,17 @@ func (s *CompanyInfo) GetAccountingProfile(ctx context.Context, request operatio // This may include information like addresses, tax registration details and // social media or website information." func (s *CompanyInfo) GetCommerceProfile(ctx context.Context, request operations.GetCommerceProfileRequest, opts ...operations.Option) (*operations.GetCommerceProfileResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-commerce-profile", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -174,28 +293,43 @@ func (s *CompanyInfo) GetCommerceProfile(ctx context.Context, request operations return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-info", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-info", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -203,53 +337,109 @@ func (s *CompanyInfo) GetCommerceProfile(ctx context.Context, request operations }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCommerceProfileResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceCompanyInfo if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -257,7 +447,12 @@ func (s *CompanyInfo) GetCommerceProfile(ctx context.Context, request operations res.CommerceCompanyInfo = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -275,20 +470,44 @@ func (s *CompanyInfo) GetCommerceProfile(ctx context.Context, request operations fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/connections.go b/lending/connections.go index a780c992f..fa03fa2dc 100644 --- a/lending/connections.go +++ b/lending/connections.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,15 +6,18 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" ) -// Connections - Manage your companies' data connections. +// Connections - Create new and manage existing data connections for a company. type Connections struct { sdkConfiguration sdkConfiguration } @@ -30,9 +33,17 @@ func newConnections(sdkConfig sdkConfiguration) *Connections { // // Use the [List Integrations](https://docs.codat.io/lending-api#/operations/list-integrations) endpoint to access valid platform keys. func (s *Connections) Create(ctx context.Context, request operations.CreateConnectionRequest, opts ...operations.Option) (*operations.CreateConnectionResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "create-connection", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -40,35 +51,49 @@ func (s *Connections) Create(ctx context.Context, request operations.CreateConne return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "json", `request:"mediaType=application/json"`) if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -76,53 +101,109 @@ func (s *Connections) Create(ctx context.Context, request operations.CreateConne }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.CreateConnectionResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.Connection if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -130,7 +211,12 @@ func (s *Connections) Create(ctx context.Context, request operations.CreateConne res.Connection = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -146,31 +232,63 @@ func (s *Connections) Create(ctx context.Context, request operations.CreateConne fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // 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. func (s *Connections) Delete(ctx context.Context, request operations.DeleteConnectionRequest, opts ...operations.Option) (*operations.DeleteConnectionResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "delete-connection", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -178,28 +296,43 @@ func (s *Connections) Delete(ctx context.Context, request operations.DeleteConne return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -207,49 +340,100 @@ func (s *Connections) Delete(ctx context.Context, request operations.DeleteConne }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.DeleteConnectionResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: case httpRes.StatusCode == 401: @@ -266,30 +450,62 @@ func (s *Connections) Delete(ctx context.Context, request operations.DeleteConne fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // 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. func (s *Connections) Get(ctx context.Context, request operations.GetConnectionRequest, opts ...operations.Option) (*operations.GetConnectionResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-connection", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -297,28 +513,43 @@ func (s *Connections) Get(ctx context.Context, request operations.GetConnectionR return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -326,53 +557,109 @@ func (s *Connections) Get(ctx context.Context, request operations.GetConnectionR }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetConnectionResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.Connection if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -380,7 +667,12 @@ func (s *Connections) Get(ctx context.Context, request operations.GetConnectionR res.Connection = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -396,30 +688,62 @@ func (s *Connections) Get(ctx context.Context, request operations.GetConnectionR fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List connections // List the connections for a company. func (s *Connections) List(ctx context.Context, request operations.ListConnectionsRequest, opts ...operations.Option) (*operations.ListConnectionsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-connections", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -427,32 +751,47 @@ func (s *Connections) List(ctx context.Context, request operations.ListConnectio return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -460,53 +799,109 @@ func (s *Connections) List(ctx context.Context, request operations.ListConnectio }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListConnectionsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.Connections if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -514,7 +909,12 @@ func (s *Connections) List(ctx context.Context, request operations.ListConnectio res.Connections = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -532,30 +932,62 @@ func (s *Connections) List(ctx context.Context, request operations.ListConnectio fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // 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. func (s *Connections) Unlink(ctx context.Context, request operations.UnlinkConnectionRequest, opts ...operations.Option) (*operations.UnlinkConnectionResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "unlink-connection", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -563,35 +995,49 @@ func (s *Connections) Unlink(ctx context.Context, request operations.UnlinkConne return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "json", `request:"mediaType=application/json"`) if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req, err := http.NewRequestWithContext(ctx, "PATCH", url, bodyReader) + req, err := http.NewRequestWithContext(ctx, "PATCH", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -599,53 +1045,109 @@ func (s *Connections) Unlink(ctx context.Context, request operations.UnlinkConne }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.UnlinkConnectionResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.Connection if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -653,7 +1155,12 @@ func (s *Connections) Unlink(ctx context.Context, request operations.UnlinkConne res.Connection = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -669,20 +1176,44 @@ func (s *Connections) Unlink(ctx context.Context, request operations.UnlinkConne fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/createoperations.go b/lending/createoperations.go index 1d1bb8256..73a55ad65 100644 --- a/lending/createoperations.go +++ b/lending/createoperations.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -27,9 +30,17 @@ func newCreateOperations(sdkConfig sdkConfiguration) *CreateOperations { // Get create operation // Retrieve create operation. func (s *CreateOperations) Get(ctx context.Context, request operations.GetCreateOperationRequest, opts ...operations.Option) (*operations.GetCreateOperationResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-create-operation", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -37,28 +48,43 @@ func (s *CreateOperations) Get(ctx context.Context, request operations.GetCreate return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/push/{pushOperationKey}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/push/{pushOperationKey}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -66,53 +92,109 @@ func (s *CreateOperations) Get(ctx context.Context, request operations.GetCreate }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCreateOperationResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.PushOperation if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -120,7 +202,12 @@ func (s *CreateOperations) Get(ctx context.Context, request operations.GetCreate res.PushOperation = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -136,30 +223,62 @@ func (s *CreateOperations) Get(ctx context.Context, request operations.GetCreate fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List create operations // List create operations. func (s *CreateOperations) List(ctx context.Context, request operations.ListCreateOperationsRequest, opts ...operations.Option) (*operations.ListCreateOperationsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-create-operations", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -167,32 +286,47 @@ func (s *CreateOperations) List(ctx context.Context, request operations.ListCrea return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/push", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/push", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -200,53 +334,109 @@ func (s *CreateOperations) List(ctx context.Context, request operations.ListCrea }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListCreateOperationsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.PushOperations if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -254,7 +444,12 @@ func (s *CreateOperations) List(ctx context.Context, request operations.ListCrea res.PushOperations = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -272,20 +467,44 @@ func (s *CreateOperations) List(ctx context.Context, request operations.ListCrea fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/creditnotes.go b/lending/creditnotes.go index 017665760..570a5174f 100644 --- a/lending/creditnotes.go +++ b/lending/creditnotes.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newCreditNotes(sdkConfig sdkConfiguration) *CreditNotes { // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CreditNotes) Get(ctx context.Context, request operations.GetAccountingCreditNoteRequest, opts ...operations.Option) (*operations.GetAccountingCreditNoteResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-credit-note", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *CreditNotes) Get(ctx context.Context, request operations.GetAccountingC return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/creditNotes/{creditNoteId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/creditNotes/{creditNoteId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *CreditNotes) Get(ctx context.Context, request operations.GetAccountingC }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingCreditNoteResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingCreditNote if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *CreditNotes) Get(ctx context.Context, request operations.GetAccountingC res.AccountingCreditNote = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *CreditNotes) Get(ctx context.Context, request operations.GetAccountingC fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List credit notes @@ -169,9 +280,17 @@ func (s *CreditNotes) Get(ctx context.Context, request operations.GetAccountingC // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *CreditNotes) List(ctx context.Context, request operations.ListAccountingCreditNotesRequest, opts ...operations.Option) (*operations.ListAccountingCreditNotesResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-credit-notes", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *CreditNotes) List(ctx context.Context, request operations.ListAccountin return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/creditNotes", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/creditNotes", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *CreditNotes) List(ctx context.Context, request operations.ListAccountin }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingCreditNotesResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingCreditNotes if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *CreditNotes) List(ctx context.Context, request operations.ListAccountin res.AccountingCreditNotes = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *CreditNotes) List(ctx context.Context, request operations.ListAccountin fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/customers.go b/lending/customers.go index a5aa9b099..2c66cda10 100644 --- a/lending/customers.go +++ b/lending/customers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -31,10 +34,17 @@ func newCustomers(sdkConfig sdkConfiguration) *Customers { // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support downloading a customer attachment. func (s *Customers) DownloadAttachment(ctx context.Context, request operations.DownloadAccountingCustomerAttachmentRequest, opts ...operations.Option) (*operations.DownloadAccountingCustomerAttachmentResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "download-accounting-customer-attachment", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, - operations.SupportedOptionAcceptHeaderOverride, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -42,33 +52,43 @@ func (s *Customers) DownloadAttachment(ctx context.Context, request operations.D return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/customers/{customerId}/attachments/{attachmentId}/download", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/customers/{customerId}/attachments/{attachmentId}/download", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout } - if o.AcceptHeaderOverride != nil { - req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) - } else { - req.Header.Set("Accept", "application/json;q=1, application/octet-stream;q=0") + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/octet-stream") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -76,60 +96,114 @@ func (s *Customers) DownloadAttachment(ctx context.Context, request operations.D }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.DownloadAccountingCustomerAttachmentResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - if (httpRes.StatusCode == 200) && utils.MatchContentType(contentType, `application/octet-stream`) { - res.Data = httpRes.Body - - return res, nil + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/octet-stream`): + res.Data = httpRes.Body + + return res, nil default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -145,22 +219,46 @@ func (s *Customers) DownloadAttachment(ctx context.Context, request operations.D fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // Get customer @@ -172,9 +270,17 @@ func (s *Customers) DownloadAttachment(ctx context.Context, request operations.D // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Customers) Get(ctx context.Context, request operations.GetAccountingCustomerRequest, opts ...operations.Option) (*operations.GetAccountingCustomerResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-customer", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -182,28 +288,43 @@ func (s *Customers) Get(ctx context.Context, request operations.GetAccountingCus return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/customers/{customerId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/customers/{customerId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -211,53 +332,109 @@ func (s *Customers) Get(ctx context.Context, request operations.GetAccountingCus }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingCustomerResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingCustomer if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -265,7 +442,12 @@ func (s *Customers) Get(ctx context.Context, request operations.GetAccountingCus res.AccountingCustomer = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -283,22 +465,46 @@ func (s *Customers) Get(ctx context.Context, request operations.GetAccountingCus fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetAttachment - Get customer attachment @@ -308,9 +514,17 @@ func (s *Customers) Get(ctx context.Context, request operations.GetAccountingCus // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support getting a customer attachment. func (s *Customers) GetAttachment(ctx context.Context, request operations.GetAccountingCustomerAttachmentRequest, opts ...operations.Option) (*operations.GetAccountingCustomerAttachmentResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-customer-attachment", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -318,28 +532,43 @@ func (s *Customers) GetAttachment(ctx context.Context, request operations.GetAcc return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/customers/{customerId}/attachments/{attachmentId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/customers/{customerId}/attachments/{attachmentId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -347,53 +576,109 @@ func (s *Customers) GetAttachment(ctx context.Context, request operations.GetAcc }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingCustomerAttachmentResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingAttachment if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -401,7 +686,12 @@ func (s *Customers) GetAttachment(ctx context.Context, request operations.GetAcc res.AccountingAttachment = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -417,22 +707,46 @@ func (s *Customers) GetAttachment(ctx context.Context, request operations.GetAcc fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List customers @@ -442,9 +756,17 @@ func (s *Customers) GetAttachment(ctx context.Context, request operations.GetAcc // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Customers) List(ctx context.Context, request operations.ListAccountingCustomersRequest, opts ...operations.Option) (*operations.ListAccountingCustomersResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-customers", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -452,32 +774,47 @@ func (s *Customers) List(ctx context.Context, request operations.ListAccountingC return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/customers", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/customers", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -485,53 +822,109 @@ func (s *Customers) List(ctx context.Context, request operations.ListAccountingC }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingCustomersResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingCustomers if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -539,7 +932,12 @@ func (s *Customers) List(ctx context.Context, request operations.ListAccountingC res.AccountingCustomers = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -559,22 +957,46 @@ func (s *Customers) List(ctx context.Context, request operations.ListAccountingC fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // ListAttachments - List customer attachments @@ -584,9 +1006,17 @@ func (s *Customers) List(ctx context.Context, request operations.ListAccountingC // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support listing customer attachments. func (s *Customers) ListAttachments(ctx context.Context, request operations.ListAccountingCustomerAttachmentsRequest, opts ...operations.Option) (*operations.ListAccountingCustomerAttachmentsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-customer-attachments", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -594,28 +1024,43 @@ func (s *Customers) ListAttachments(ctx context.Context, request operations.List return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/customers/{customerId}/attachments", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/customers/{customerId}/attachments", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -623,53 +1068,109 @@ func (s *Customers) ListAttachments(ctx context.Context, request operations.List }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingCustomerAttachmentsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.Attachments if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -677,7 +1178,12 @@ func (s *Customers) ListAttachments(ctx context.Context, request operations.List res.Attachments = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -695,20 +1201,44 @@ func (s *Customers) ListAttachments(ctx context.Context, request operations.List fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/dataintegrity.go b/lending/dataintegrity.go index 353e530d1..6803c6b58 100644 --- a/lending/dataintegrity.go +++ b/lending/dataintegrity.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -30,9 +33,17 @@ func newDataIntegrity(sdkConfig sdkConfiguration) *DataIntegrity { // // The [details](https://docs.codat.io/lending-api#/schemas/DataIntegrityDetails) are paginated and support ordering, following the same conventions as our other data endpoints. func (s *DataIntegrity) Details(ctx context.Context, request operations.ListDataIntegrityDetailsRequest, opts ...operations.Option) (*operations.ListDataIntegrityDetailsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-data-integrity-details", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -40,32 +51,47 @@ func (s *DataIntegrity) Details(ctx context.Context, request operations.ListData return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/assess/dataTypes/{dataType}/dataIntegrity/details", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/assess/dataTypes/{dataType}/dataIntegrity/details", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -73,53 +99,109 @@ func (s *DataIntegrity) Details(ctx context.Context, request operations.ListData }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListDataIntegrityDetailsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.DataIntegrityDetails if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -127,7 +209,12 @@ func (s *DataIntegrity) Details(ctx context.Context, request operations.ListData res.DataIntegrityDetails = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -145,22 +232,46 @@ func (s *DataIntegrity) Details(ctx context.Context, request operations.ListData fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // Status - Get data integrity status @@ -173,9 +284,17 @@ func (s *DataIntegrity) Details(ctx context.Context, request operations.ListData // - When the results were generated, and their status. // - The connection IDs, amounts, and dates involved to support useful querying. func (s *DataIntegrity) Status(ctx context.Context, request operations.GetDataIntegrityStatusRequest, opts ...operations.Option) (*operations.GetDataIntegrityStatusResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-data-integrity-status", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -183,28 +302,43 @@ func (s *DataIntegrity) Status(ctx context.Context, request operations.GetDataIn return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/assess/dataTypes/{dataType}/dataIntegrity/status", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/assess/dataTypes/{dataType}/dataIntegrity/status", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *DataIntegrity) Status(ctx context.Context, request operations.GetDataIn }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetDataIntegrityStatusResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.DataIntegrityStatuses if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *DataIntegrity) Status(ctx context.Context, request operations.GetDataIn res.DataIntegrityStatuses = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -282,22 +477,46 @@ func (s *DataIntegrity) Status(ctx context.Context, request operations.GetDataIn fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // Summaries - Get data integrity summaries @@ -307,9 +526,17 @@ func (s *DataIntegrity) Status(ctx context.Context, request operations.GetDataIn // // The endpoint response includes only the summary results, not transactions. To view match data for transactions, use the [List data integrity details](https://docs.codat.io/lending-api#/operations/list-data-type-data-integrity-details) endpoint. func (s *DataIntegrity) Summaries(ctx context.Context, request operations.GetDataIntegritySummariesRequest, opts ...operations.Option) (*operations.GetDataIntegritySummariesResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-data-integrity-summaries", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -317,32 +544,47 @@ func (s *DataIntegrity) Summaries(ctx context.Context, request operations.GetDat return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/assess/dataTypes/{dataType}/dataIntegrity/summaries", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/assess/dataTypes/{dataType}/dataIntegrity/summaries", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -350,53 +592,109 @@ func (s *DataIntegrity) Summaries(ctx context.Context, request operations.GetDat }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetDataIntegritySummariesResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.DataIntegritySummaries if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -404,7 +702,12 @@ func (s *DataIntegrity) Summaries(ctx context.Context, request operations.GetDat res.DataIntegritySummaries = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -422,20 +725,44 @@ func (s *DataIntegrity) Summaries(ctx context.Context, request operations.GetDat fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/directcosts.go b/lending/directcosts.go index 1e7c1ccba..81ae8d7cf 100644 --- a/lending/directcosts.go +++ b/lending/directcosts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -35,9 +38,17 @@ func newDirectCosts(sdkConfig sdkConfiguration) *DirectCosts { // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support creating an account. func (s *DirectCosts) Create(ctx context.Context, request operations.CreateDirectCostRequest, opts ...operations.Option) (*operations.CreateDirectCostResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "create-direct-cost", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -45,39 +56,53 @@ func (s *DirectCosts) Create(ctx context.Context, request operations.CreateDirec return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/directCosts", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/directCosts", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "DirectCostPrototype", "json", `request:"mediaType=application/json"`) if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -85,53 +110,109 @@ func (s *DirectCosts) Create(ctx context.Context, request operations.CreateDirec }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.CreateDirectCostResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingCreateDirectCostResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -139,7 +220,12 @@ func (s *DirectCosts) Create(ctx context.Context, request operations.CreateDirec res.AccountingCreateDirectCostResponse = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -157,22 +243,46 @@ func (s *DirectCosts) Create(ctx context.Context, request operations.CreateDirec fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetCreateModel - Get create direct cost model @@ -186,9 +296,17 @@ func (s *DirectCosts) Create(ctx context.Context, request operations.CreateDirec // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support creating a direct cost. func (s *DirectCosts) GetCreateModel(ctx context.Context, request operations.GetCreateDirectCostsModelRequest, opts ...operations.Option) (*operations.GetCreateDirectCostsModelResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-create-directCosts-model", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -196,28 +314,43 @@ func (s *DirectCosts) GetCreateModel(ctx context.Context, request operations.Get return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/directCosts", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/directCosts", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -225,53 +358,109 @@ func (s *DirectCosts) GetCreateModel(ctx context.Context, request operations.Get }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCreateDirectCostsModelResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.PushOption if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -279,7 +468,12 @@ func (s *DirectCosts) GetCreateModel(ctx context.Context, request operations.Get res.PushOption = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -295,20 +489,44 @@ func (s *DirectCosts) GetCreateModel(ctx context.Context, request operations.Get fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/directincomes.go b/lending/directincomes.go index ca6f8f076..a3fb89a4e 100644 --- a/lending/directincomes.go +++ b/lending/directincomes.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -31,10 +34,17 @@ func newDirectIncomes(sdkConfig sdkConfiguration) *DirectIncomes { // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directIncomes) for integrations that support downloading a direct income attachment. func (s *DirectIncomes) DownloadAttachment(ctx context.Context, request operations.DownloadAccountingDirectIncomeAttachmentRequest, opts ...operations.Option) (*operations.DownloadAccountingDirectIncomeAttachmentResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "download-accounting-direct-income-attachment", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, - operations.SupportedOptionAcceptHeaderOverride, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -42,33 +52,43 @@ func (s *DirectIncomes) DownloadAttachment(ctx context.Context, request operatio return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directIncomes/{directIncomeId}/attachments/{attachmentId}/download", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directIncomes/{directIncomeId}/attachments/{attachmentId}/download", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout } - if o.AcceptHeaderOverride != nil { - req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) - } else { - req.Header.Set("Accept", "application/json;q=1, application/octet-stream;q=0") + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/octet-stream") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -76,60 +96,114 @@ func (s *DirectIncomes) DownloadAttachment(ctx context.Context, request operatio }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.DownloadAccountingDirectIncomeAttachmentResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - if (httpRes.StatusCode == 200) && utils.MatchContentType(contentType, `application/octet-stream`) { - res.Data = httpRes.Body - - return res, nil + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/octet-stream`): + res.Data = httpRes.Body + + return res, nil default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -145,22 +219,46 @@ func (s *DirectIncomes) DownloadAttachment(ctx context.Context, request operatio fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // Get direct income @@ -172,9 +270,17 @@ func (s *DirectIncomes) DownloadAttachment(ctx context.Context, request operatio // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *DirectIncomes) Get(ctx context.Context, request operations.GetAccountingDirectIncomeRequest, opts ...operations.Option) (*operations.GetAccountingDirectIncomeResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-direct-income", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -182,28 +288,43 @@ func (s *DirectIncomes) Get(ctx context.Context, request operations.GetAccountin return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directIncomes/{directIncomeId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directIncomes/{directIncomeId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -211,53 +332,109 @@ func (s *DirectIncomes) Get(ctx context.Context, request operations.GetAccountin }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingDirectIncomeResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingDirectIncome if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -265,7 +442,12 @@ func (s *DirectIncomes) Get(ctx context.Context, request operations.GetAccountin res.AccountingDirectIncome = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -283,22 +465,46 @@ func (s *DirectIncomes) Get(ctx context.Context, request operations.GetAccountin fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetAttachment - Get direct income attachment @@ -308,9 +514,17 @@ func (s *DirectIncomes) Get(ctx context.Context, request operations.GetAccountin // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directIncomes) for integrations that support getting a direct income attachment. func (s *DirectIncomes) GetAttachment(ctx context.Context, request operations.GetAccountingDirectIncomeAttachmentRequest, opts ...operations.Option) (*operations.GetAccountingDirectIncomeAttachmentResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-direct-income-attachment", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -318,32 +532,47 @@ func (s *DirectIncomes) GetAttachment(ctx context.Context, request operations.Ge return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directIncomes/{directIncomeId}/attachments/{attachmentId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directIncomes/{directIncomeId}/attachments/{attachmentId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -351,53 +580,109 @@ func (s *DirectIncomes) GetAttachment(ctx context.Context, request operations.Ge }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingDirectIncomeAttachmentResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingAttachment if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -405,7 +690,12 @@ func (s *DirectIncomes) GetAttachment(ctx context.Context, request operations.Ge res.AccountingAttachment = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -421,22 +711,46 @@ func (s *DirectIncomes) GetAttachment(ctx context.Context, request operations.Ge fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List direct incomes @@ -446,9 +760,17 @@ func (s *DirectIncomes) GetAttachment(ctx context.Context, request operations.Ge // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *DirectIncomes) List(ctx context.Context, request operations.ListAccountingDirectIncomesRequest, opts ...operations.Option) (*operations.ListAccountingDirectIncomesResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-direct-incomes", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -456,32 +778,47 @@ func (s *DirectIncomes) List(ctx context.Context, request operations.ListAccount return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directIncomes", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directIncomes", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -489,53 +826,109 @@ func (s *DirectIncomes) List(ctx context.Context, request operations.ListAccount }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingDirectIncomesResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingDirectIncomes if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -543,7 +936,12 @@ func (s *DirectIncomes) List(ctx context.Context, request operations.ListAccount res.AccountingDirectIncomes = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -563,22 +961,46 @@ func (s *DirectIncomes) List(ctx context.Context, request operations.ListAccount fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // ListAttachments - List direct income attachments @@ -588,9 +1010,17 @@ func (s *DirectIncomes) List(ctx context.Context, request operations.ListAccount // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directIncomes) for integrations that support listing direct income attachments. func (s *DirectIncomes) ListAttachments(ctx context.Context, request operations.ListAccountingDirectIncomeAttachmentsRequest, opts ...operations.Option) (*operations.ListAccountingDirectIncomeAttachmentsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-direct-income-attachments", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -598,28 +1028,43 @@ func (s *DirectIncomes) ListAttachments(ctx context.Context, request operations. return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directIncomes/{directIncomeId}/attachments", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/directIncomes/{directIncomeId}/attachments", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -627,53 +1072,109 @@ func (s *DirectIncomes) ListAttachments(ctx context.Context, request operations. }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingDirectIncomeAttachmentsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.Attachments if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -681,7 +1182,12 @@ func (s *DirectIncomes) ListAttachments(ctx context.Context, request operations. res.Attachments = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -699,20 +1205,44 @@ func (s *DirectIncomes) ListAttachments(ctx context.Context, request operations. fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/disputes.go b/lending/disputes.go index 0f6903e8f..5072c58a3 100644 --- a/lending/disputes.go +++ b/lending/disputes.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newDisputes(sdkConfig sdkConfiguration) *Disputes { // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Disputes) Get(ctx context.Context, request operations.GetCommerceDisputeRequest, opts ...operations.Option) (*operations.GetCommerceDisputeResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-commerce-dispute", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *Disputes) Get(ctx context.Context, request operations.GetCommerceDisput return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-disputes/{disputeId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-disputes/{disputeId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *Disputes) Get(ctx context.Context, request operations.GetCommerceDisput }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCommerceDisputeResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceDispute if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *Disputes) Get(ctx context.Context, request operations.GetCommerceDisput res.CommerceDispute = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *Disputes) Get(ctx context.Context, request operations.GetCommerceDisput fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List disputes @@ -169,9 +280,17 @@ func (s *Disputes) Get(ctx context.Context, request operations.GetCommerceDisput // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Disputes) List(ctx context.Context, request operations.ListCommerceDisputesRequest, opts ...operations.Option) (*operations.ListCommerceDisputesResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-commerce-disputes", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *Disputes) List(ctx context.Context, request operations.ListCommerceDisp return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-disputes", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-disputes", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *Disputes) List(ctx context.Context, request operations.ListCommerceDisp }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListCommerceDisputesResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceDisputes if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *Disputes) List(ctx context.Context, request operations.ListCommerceDisp res.CommerceDisputes = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *Disputes) List(ctx context.Context, request operations.ListCommerceDisp fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/docs/pkg/models/operations/createcompanyresponse.md b/lending/docs/pkg/models/operations/createcompanyresponse.md index 795f1c5b4..134636626 100644 --- a/lending/docs/pkg/models/operations/createcompanyresponse.md +++ b/lending/docs/pkg/models/operations/createcompanyresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Company` | [*shared.Company](../../../pkg/models/shared/company.md) | :heavy_minus_sign: | OK | {"id":"0498e921-9b53-4396-a412-4f2f5983b0a2","name":"string","platform":"string","redirect":"https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739","lastSync":"2022-01-01T12:00:00.000Z","created":"2022-01-01T12:00:00.000Z","createdByUserName":"string","dataConnections":[{"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"}],"groups":[{"id":"d7a6c4b4-dc87-45f6-b803-62f466398680"}]} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Company` | [*shared.Company](../../../pkg/models/shared/company.md) | :heavy_minus_sign: | OK | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739",
"lastSync": "2022-01-01T12:00:00.000Z",
"created": "2022-01-01T12:00:00.000Z",
"createdByUserName": "string",
"tags": {
"region": "us",
"uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"
},
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
]
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/createconnectionresponse.md b/lending/docs/pkg/models/operations/createconnectionresponse.md index 570c12006..8967db127 100644 --- a/lending/docs/pkg/models/operations/createconnectionresponse.md +++ b/lending/docs/pkg/models/operations/createconnectionresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Connection` | [*shared.Connection](../../../pkg/models/shared/connection.md) | :heavy_minus_sign: | OK | {"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Connection` | [*shared.Connection](../../../pkg/models/shared/connection.md) | :heavy_minus_sign: | OK | {
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/createsupplierrequest.md b/lending/docs/pkg/models/operations/createsupplierrequest.md index 56fa2fe89..b8bb21262 100644 --- a/lending/docs/pkg/models/operations/createsupplierrequest.md +++ b/lending/docs/pkg/models/operations/createsupplierrequest.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AccountingSupplier` | [*shared.AccountingSupplier](../../../pkg/models/shared/accountingsupplier.md) | :heavy_minus_sign: | N/A | {"id":"C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F","supplierName":"Kelly's Industrial Supplies","contactName":"Kelly's Industrial Supplies","emailAddress":"sales@kellysupplies.com","phone":"07999 999999","addresses":[{"type":"Billing","line1":"Unit 51","line2":"Bakersfield Industrial Estate","city":"Bakersfield","region":"California","country":"USA","postalcode":"93308"}],"registrationNumber":"string","taxNumber":"string","status":"Unknown","defaultCurrency":"string","metadata":{"isDeleted":true},"supplementalData":{"content":{"property1":{"property1":null,"property2":null},"property2":{"property1":null,"property2":null}}},"modifiedDate":"2022-10-23T00:00:00Z","sourceModifiedDate":"2022-10-23T00:00:00Z"} | -| `AllowSyncOnPushComplete` | **bool* | :heavy_minus_sign: | Allow a sync upon push completion. | | -| `CompanyID` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `ConnectionID` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `TimeoutInMinutes` | **int* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `AccountingSupplier` | [*shared.AccountingSupplier](../../../pkg/models/shared/accountingsupplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | +| `AllowSyncOnPushComplete` | **bool* | :heavy_minus_sign: | Allow a sync upon push completion. | | +| `CompanyID` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `TimeoutInMinutes` | **int* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/endbankstatementuploadsessionrequest.md b/lending/docs/pkg/models/operations/endbankstatementuploadsessionrequest.md new file mode 100644 index 000000000..641b9a920 --- /dev/null +++ b/lending/docs/pkg/models/operations/endbankstatementuploadsessionrequest.md @@ -0,0 +1,11 @@ +# EndBankStatementUploadSessionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `EndUploadSessionRequest` | [*shared.EndUploadSessionRequest](../../../pkg/models/shared/enduploadsessionrequest.md) | :heavy_minus_sign: | N/A | | +| `CompanyID` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `DatasetID` | *string* | :heavy_check_mark: | Unique identifier for the dataset that completed its sync. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/endbankstatementuploadsessionresponse.md b/lending/docs/pkg/models/operations/endbankstatementuploadsessionresponse.md new file mode 100644 index 000000000..f592c4199 --- /dev/null +++ b/lending/docs/pkg/models/operations/endbankstatementuploadsessionresponse.md @@ -0,0 +1,10 @@ +# EndBankStatementUploadSessionResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getaccountingagedcreditorsreportresponse.md b/lending/docs/pkg/models/operations/getaccountingagedcreditorsreportresponse.md index 8bdb56203..a84af5c40 100644 --- a/lending/docs/pkg/models/operations/getaccountingagedcreditorsreportresponse.md +++ b/lending/docs/pkg/models/operations/getaccountingagedcreditorsreportresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AccountingAgedCreditorReport` | [*shared.AccountingAgedCreditorReport](../../../pkg/models/shared/accountingagedcreditorreport.md) | :heavy_minus_sign: | OK | {"generated":"2022-10-23T00:00:00Z","reportDate":"2022-10-23T00:00:00Z","data":[{"customerId":"f594cefb-7750-4c3a-bab2-b5322026dee9","customerName":"John Doe","agedCurrencyOutstanding":[{"currency":"GBP","agedOutstandingAmounts":[{"fromDate":"2022-10-01T00:00:00Z","toDate":"2022-10-31T00:00:00Z","amount":1547.5,"details":[{"name":"Bills","amount":1547.5}]}]}]}]} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingAgedCreditorReport` | [*shared.AccountingAgedCreditorReport](../../../pkg/models/shared/accountingagedcreditorreport.md) | :heavy_minus_sign: | OK | {
"generated": "2022-10-23T00:00:00Z",
"reportDate": "2022-10-23T00:00:00Z",
"data": [
{
"customerId": "f594cefb-7750-4c3a-bab2-b5322026dee9",
"customerName": "John Doe",
"agedCurrencyOutstanding": [
{
"currency": "GBP",
"agedOutstandingAmounts": [
{
"fromDate": "2022-10-01T00:00:00Z",
"toDate": "2022-10-31T00:00:00Z",
"amount": 1547.5,
"details": [
{
"name": "Bills",
"amount": 1547.5
}
]
}
]
}
]
}
]
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getaccountingageddebtorsreportresponse.md b/lending/docs/pkg/models/operations/getaccountingageddebtorsreportresponse.md index f2653e513..0a9864843 100644 --- a/lending/docs/pkg/models/operations/getaccountingageddebtorsreportresponse.md +++ b/lending/docs/pkg/models/operations/getaccountingageddebtorsreportresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AccountingAgedDebtorReport` | [*shared.AccountingAgedDebtorReport](../../../pkg/models/shared/accountingageddebtorreport.md) | :heavy_minus_sign: | OK | {"generated":"2022-10-23T00:00:00Z","reportDate":"2022-10-23T00:00:00Z","data":[{"customerId":"f594cefb-7750-4c3a-bab2-b5322026dee9","customerName":"John Doe","agedCurrencyOutstanding":[{"currency":"GBP","agedOutstandingAmounts":[{"fromDate":"2022-10-01T00:00:00Z","toDate":"2022-10-31T00:00:00Z","amount":1547.5,"details":[{"name":"Invoices","amount":1547.5}]}]}]}]} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `AccountingAgedDebtorReport` | [*shared.AccountingAgedDebtorReport](../../../pkg/models/shared/accountingageddebtorreport.md) | :heavy_minus_sign: | OK | {
"generated": "2022-10-23T00:00:00Z",
"reportDate": "2022-10-23T00:00:00Z",
"data": [
{
"customerId": "f594cefb-7750-4c3a-bab2-b5322026dee9",
"customerName": "John Doe",
"agedCurrencyOutstanding": [
{
"currency": "GBP",
"agedOutstandingAmounts": [
{
"fromDate": "2022-10-01T00:00:00Z",
"toDate": "2022-10-31T00:00:00Z",
"amount": 1547.5,
"details": [
{
"name": "Invoices",
"amount": 1547.5
}
]
}
]
}
]
}
]
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getaccountingbillcreditnoteresponse.md b/lending/docs/pkg/models/operations/getaccountingbillcreditnoteresponse.md index 03c0bdebe..2424219aa 100644 --- a/lending/docs/pkg/models/operations/getaccountingbillcreditnoteresponse.md +++ b/lending/docs/pkg/models/operations/getaccountingbillcreditnoteresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AccountingBillCreditNote` | [*shared.AccountingBillCreditNote](../../../pkg/models/shared/accountingbillcreditnote.md) | :heavy_minus_sign: | Success | {"id":"6a0e9dfb-87b0-47d3-aaaf-9753ae9e757d","billCreditNoteNumber":"14763237","totalAmount":693,"remainingCredit":693,"status":"Submitted","issueDate":"2019-02-18T16:03:07.268Z","note":"Track separately","currency":"USD","lineItems":[{"description":"AcmeMagnet","unitAmount":25,"discountAmount":0,"quantity":4,"subTotal":100,"taxAmount":10,"totalAmount":110,"itemRef":{"id":"3"},"taxRateRef":{"id":"6c88aff3-7cb9-4980-a3d3-443e72e02498"},"accountRef":{"id":"3f267b10-757d-44c0-bef9-20f70cc8fbe3"},"trackingCategoryRefs":[{"id":"department_1","name":"ACMERockets"},{"id":"costcode_2","name":"ACM2-ACMESigns"}]},{"description":"ACMEDisintegratingPistol","unitAmount":25,"discountAmount":0,"quantity":3,"subTotal":75,"taxAmount":7.5,"totalAmount":82.5,"itemRef":{"id":"3abf0883-03f7-44c6-bc15-1372522d25e1"},"taxRateRef":{"id":"6c88aff3-7cb9-4980-a3d3-443e72e02498"},"accountRef":{"id":"3f267b10-757d-44c0-bef9-20f70cc8fbe3"}},{"description":"ACMEWhippedCreamDispenser","unitAmount":52,"discountAmount":0,"quantity":6,"subTotal":312,"taxAmount":31.2,"totalAmount":343.2,"itemRef":{"id":"3691f3d9-0ff7-4358-8a93-bed31c1b4b03"},"taxRateRef":{"id":"6c88aff3-7cb9-4980-a3d3-443e72e02498"},"accountRef":{"id":"3f267b10-757d-44c0-bef9-20f70cc8fbe3"}},{"description":"ACMEJetPropelledPogoStick","unitAmount":130,"discountAmount":0,"quantity":1,"subTotal":130,"taxAmount":27.3,"totalAmount":157.3,"itemRef":{"id":"075410d4-7edc-4936-ba52-9e1e43cbe300"},"taxRateRef":{"id":"d606732b-db18-44d7-823b-7f15f42c32ea"},"accountRef":{"id":"3f267b10-757d-44c0-bef9-20f70cc8fbe3"}}],"supplierRef":{"id":"67C6A7A1-5E84-4AC4-B950-24A114E379D0","supplierName":"Chin's Gas and Oil"}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingBillCreditNote` | [*shared.AccountingBillCreditNote](../../../pkg/models/shared/accountingbillcreditnote.md) | :heavy_minus_sign: | Success | {
"id": "6a0e9dfb-87b0-47d3-aaaf-9753ae9e757d",
"billCreditNoteNumber": "14763237",
"totalAmount": 693,
"remainingCredit": 693,
"status": "Submitted",
"issueDate": "2019-02-18T16:03:07.268Z",
"note": "Track separately",
"currency": "USD",
"lineItems": [
{
"description": "AcmeMagnet",
"unitAmount": 25,
"discountAmount": 0,
"quantity": 4,
"subTotal": 100,
"taxAmount": 10,
"totalAmount": 110,
"itemRef": {
"id": "3"
},
"taxRateRef": {
"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
},
"trackingCategoryRefs": [
{
"id": "department_1",
"name": "ACMERockets"
},
{
"id": "costcode_2",
"name": "ACM2-ACMESigns"
}
],
"createdFromLineRef": [
{
"id": "8462",
"dataType": "bill",
"lineNumber": 1
}
]
},
{
"description": "ACMEDisintegratingPistol",
"unitAmount": 25,
"discountAmount": 0,
"quantity": 3,
"subTotal": 75,
"taxAmount": 7.5,
"totalAmount": 82.5,
"itemRef": {
"id": "3abf0883-03f7-44c6-bc15-1372522d25e1"
},
"taxRateRef": {
"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
}
},
{
"description": "ACMEWhippedCreamDispenser",
"unitAmount": 52,
"discountAmount": 0,
"quantity": 6,
"subTotal": 312,
"taxAmount": 31.2,
"totalAmount": 343.2,
"itemRef": {
"id": "3691f3d9-0ff7-4358-8a93-bed31c1b4b03"
},
"taxRateRef": {
"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
}
},
{
"description": "ACMEJetPropelledPogoStick",
"unitAmount": 130,
"discountAmount": 0,
"quantity": 1,
"subTotal": 130,
"taxAmount": 27.3,
"totalAmount": 157.3,
"itemRef": {
"id": "075410d4-7edc-4936-ba52-9e1e43cbe300"
},
"taxRateRef": {
"id": "d606732b-db18-44d7-823b-7f15f42c32ea"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
}
}
],
"supplierRef": {
"id": "67C6A7A1-5E84-4AC4-B950-24A114E379D0",
"supplierName": "Chin's Gas and Oil"
},
"createdFromLineRef": {
"id": "8462",
"dataType": "bills",
"line": 1
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getaccountingbillpaymentresponse.md b/lending/docs/pkg/models/operations/getaccountingbillpaymentresponse.md index 0def44b4a..623a993ec 100644 --- a/lending/docs/pkg/models/operations/getaccountingbillpaymentresponse.md +++ b/lending/docs/pkg/models/operations/getaccountingbillpaymentresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `AccountingBillPayment` | [*shared.AccountingBillPayment](../../../pkg/models/shared/accountingbillpayment.md) | :heavy_minus_sign: | Success | {"totalAmount":1000,"lines":[{"amount":1000,"links":[{"type":"Bill","id":"x","amount":-1000}]}]} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `AccountingBillPayment` | [*shared.AccountingBillPayment](../../../pkg/models/shared/accountingbillpayment.md) | :heavy_minus_sign: | Success | {
"totalAmount": 1000,
"lines": [
{
"amount": 1000,
"links": [
{
"type": "Bill",
"id": "x",
"amount": -1000
}
]
}
]
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getaccountingcreditnoteresponse.md b/lending/docs/pkg/models/operations/getaccountingcreditnoteresponse.md index de5f3b976..507800d30 100644 --- a/lending/docs/pkg/models/operations/getaccountingcreditnoteresponse.md +++ b/lending/docs/pkg/models/operations/getaccountingcreditnoteresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingCreditNote` | [*shared.AccountingCreditNote](../../../pkg/models/shared/accountingcreditnote.md) | :heavy_minus_sign: | Success | [{"allocatedOnDate":null,"creditNoteNumber":"5239277","currency":"USD","currencyRate":null,"customerRef":{"companyName":"Tool Hire Company","id":"b5511228-b9ef-4713-91b1-ad2cf60eadb1"},"discountPercentage":0,"id":"0316bd24-8a01-4a3a-a0e5-a73f14ebcbec","issueDate":"2018-03-28T21:28:58.249Z","lineItems":[{"accountRef":{"id":"3f267b10-757d-44c0-bef9-20f70cc8fbe3","name":null},"description":"Anvil10000Lb","discountAmount":0,"discountPercentage":null,"itemRef":{"id":"1","name":null},"quantity":10,"subTotal":500,"taxAmount":50,"taxRateRef":{"id":"6c88aff3-7cb9-4980-a3d3-443e72e02498","name":null},"totalAmount":550,"unitAmount":50}],"modifiedDate":null,"note":"More information available on request.","paymentAllocations":[],"remainingCredit":550,"sourceModifiedDate":null,"status":"Submitted","subTotal":0,"totalAmount":550,"totalDiscount":0,"totalTaxAmount":0}] | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingCreditNote` | [*shared.AccountingCreditNote](../../../pkg/models/shared/accountingcreditnote.md) | :heavy_minus_sign: | Success | [
{
"id": "0316bd24-8a01-4a3a-a0e5-a73f14ebcbec",
"creditNoteNumber": "5239277",
"customerRef": {
"id": "b5511228-b9ef-4713-91b1-ad2cf60eadb1",
"companyName": "Tool Hire Company"
},
"totalAmount": 550,
"totalDiscount": 0,
"subTotal": 0,
"totalTaxAmount": 0,
"discountPercentage": 0,
"remainingCredit": 550,
"status": "Submitted",
"issueDate": "2018-03-28T21:28:58.249Z",
"allocatedOnDate": null,
"note": "More information available on request.",
"currency": "USD",
"currencyRate": null,
"lineItems": [
{
"description": "Anvil10000Lb",
"unitAmount": 50,
"quantity": 10,
"discountAmount": 0,
"subTotal": 500,
"taxAmount": 50,
"totalAmount": 550,
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3",
"name": null
},
"discountPercentage": null,
"taxRateRef": {
"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498",
"name": null
},
"itemRef": {
"id": "1",
"name": null
}
}
],
"paymentAllocations": [],
"modifiedDate": null,
"sourceModifiedDate": null
}
] | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getaccountingprofileresponse.md b/lending/docs/pkg/models/operations/getaccountingprofileresponse.md index d6bcdfd3f..345db1422 100644 --- a/lending/docs/pkg/models/operations/getaccountingprofileresponse.md +++ b/lending/docs/pkg/models/operations/getaccountingprofileresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AccountingCompanyInfo` | [*shared.AccountingCompanyInfo](../../../pkg/models/shared/accountingcompanyinfo.md) | :heavy_minus_sign: | Success | {"companyName":"ACME Corporation","accountingPlatformRef":"4444e827-401b-4925-92cb-d79086bf3b6b","companyLegalName":"ACME Corporation Ltd.","addresses":[{"type":"Billing","line1":"Warner House","line2":"98 Theobald's Road","city":"London","region":"","country":"United Kingdom","postalcode":"WC1X 8WB"},{"type":"Unknown","line1":"123 Sierra Way","line2":"","city":"San Pablo","region":"CA","country":"","postalCode":"87999"}],"phoneNumbers":[{"number":"010 1234 5678","type":"Landline"}],"webLinks":[{"type":"Website","url":"https://www.wbsl.com/"}],"ledgerLockDate":"2019-03-04T12:08:01.881Z","registrationNumber":"1234567890","taxNumber":"GB 123456789","financialYearStartDate":"2019-04-01T00:00:00Z","baseCurrency":"USD","sourceUrls":{"url1":"https://go.xero.com/organisationlogin/default.aspx?shortcode=!rxs0Q","url2":"https://reporting.xero.com/!rxs0Q"},"createdDate":"2020-02-03T16:42:02Z"} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingCompanyInfo` | [*shared.AccountingCompanyInfo](../../../pkg/models/shared/accountingcompanyinfo.md) | :heavy_minus_sign: | Success | {
"companyName": "ACME Corporation",
"accountingPlatformRef": "4444e827-401b-4925-92cb-d79086bf3b6b",
"companyLegalName": "ACME Corporation Ltd.",
"addresses": [
{
"type": "Billing",
"line1": "Warner House",
"line2": "98 Theobald's Road",
"city": "London",
"region": "",
"country": "United Kingdom",
"postalcode": "WC1X 8WB"
},
{
"type": "Unknown",
"line1": "123 Sierra Way",
"line2": "",
"city": "San Pablo",
"region": "CA",
"country": "",
"postalCode": "87999"
}
],
"phoneNumbers": [
{
"number": "010 1234 5678",
"type": "Landline"
}
],
"webLinks": [
{
"type": "Website",
"url": "https://www.wbsl.com/"
}
],
"ledgerLockDate": "2019-03-04T12:08:01.881Z",
"registrationNumber": "1234567890",
"taxNumber": "GB 123456789",
"financialYearStartDate": "2019-04-01T00:00:00Z",
"baseCurrency": "USD",
"sourceUrls": {
"url1": "https://go.xero.com/organisationlogin/default.aspx?shortcode=!rxs0Q",
"url2": "https://reporting.xero.com/!rxs0Q"
},
"createdDate": "2020-02-03T16:42:02Z"
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getaccountingsupplierresponse.md b/lending/docs/pkg/models/operations/getaccountingsupplierresponse.md index 3cadf9c3b..fdbe73d8a 100644 --- a/lending/docs/pkg/models/operations/getaccountingsupplierresponse.md +++ b/lending/docs/pkg/models/operations/getaccountingsupplierresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AccountingSupplier` | [*shared.AccountingSupplier](../../../pkg/models/shared/accountingsupplier.md) | :heavy_minus_sign: | Success | {"id":"C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F","supplierName":"Kelly's Industrial Supplies","contactName":"Kelly's Industrial Supplies","emailAddress":"sales@kellysupplies.com","phone":"07999 999999","addresses":[{"type":"Billing","line1":"Unit 51","line2":"Bakersfield Industrial Estate","city":"Bakersfield","region":"California","country":"USA","postalcode":"93308"}],"registrationNumber":"string","taxNumber":"string","status":"Unknown","defaultCurrency":"string","metadata":{"isDeleted":true},"supplementalData":{"content":{"property1":{"property1":null,"property2":null},"property2":{"property1":null,"property2":null}}},"modifiedDate":"2022-10-23T00:00:00Z","sourceModifiedDate":"2022-10-23T00:00:00Z"} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `AccountingSupplier` | [*shared.AccountingSupplier](../../../pkg/models/shared/accountingsupplier.md) | :heavy_minus_sign: | Success | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getbankingaccountresponse.md b/lending/docs/pkg/models/operations/getbankingaccountresponse.md index 44e4515e5..b6fc3938b 100644 --- a/lending/docs/pkg/models/operations/getbankingaccountresponse.md +++ b/lending/docs/pkg/models/operations/getbankingaccountresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `BankingAccount` | [*shared.BankingAccount](../../../pkg/models/shared/bankingaccount.md) | :heavy_minus_sign: | Success | {"results":[{"id":"1703194f-7805-4da8-bac0-2ba5da4a4216","name":"Business Current Account","informalName":"Codat","holder":"Codat Ltd","type":"Debit","balance":{"available":-459987.97,"current":-459964.9,"limit":5000},"identifiers":{"type":"Depository","subtype":"checking","number":"46762629","bankCode":009911,"iban":"GB29 LOYD 4773 2346 7626 29","bic":"LOYDGB21006","maskedAccountNumber":"LOYDGB21006"},"currency":"GBP","institution":{"id":"lloyds-bank","name":"Lloyds Bank"},"modifiedDate":"2022-05-23T16:32:50Z","sourceModifiedDate":"2021-08-14T05:04:12"}]} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `BankingAccount` | [*shared.BankingAccount](../../../pkg/models/shared/bankingaccount.md) | :heavy_minus_sign: | Success | {
"results": [
{
"id": "1703194f-7805-4da8-bac0-2ba5da4a4216",
"name": "Business Current Account",
"informalName": "Codat",
"holder": "Codat Ltd",
"type": "Debit",
"balance": {
"available": -459987.97,
"current": -459964.9,
"limit": 5000
},
"identifiers": {
"type": "Depository",
"subtype": "checking",
"number": "46762629",
"bankCode": 9911,
"iban": "GB29 LOYD 4773 2346 7626 29",
"bic": "LOYDGB21006",
"maskedAccountNumber": "LOYDGB21006"
},
"currency": "GBP",
"institution": {
"id": "lloyds-bank",
"name": "Lloyds Bank"
},
"modifiedDate": "2022-05-23T16:32:50Z",
"sourceModifiedDate": "2021-08-14T05:04:12"
}
]
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getbankingtransactioncategoryresponse.md b/lending/docs/pkg/models/operations/getbankingtransactioncategoryresponse.md index faeb51579..fcc7ad6c5 100644 --- a/lending/docs/pkg/models/operations/getbankingtransactioncategoryresponse.md +++ b/lending/docs/pkg/models/operations/getbankingtransactioncategoryresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `BankingTransactionCategory` | [*shared.BankingTransactionCategory](../../../pkg/models/shared/bankingtransactioncategory.md) | :heavy_minus_sign: | Success | {"id":"auto-and-transport","name":"Auto & Transport","hasChildren":true,"status":"Active","modifiedDate":"2022-05-23T16:32:50","sourceModifiedDate":"2021-04-24T07:59:10"} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `BankingTransactionCategory` | [*shared.BankingTransactionCategory](../../../pkg/models/shared/bankingtransactioncategory.md) | :heavy_minus_sign: | Success | {
"id": "auto-and-transport",
"name": "Auto \u0026 Transport",
"hasChildren": true,
"status": "Active",
"modifiedDate": "2022-05-23T16:32:50",
"sourceModifiedDate": "2021-04-24T07:59:10"
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getbankingtransactionresponse.md b/lending/docs/pkg/models/operations/getbankingtransactionresponse.md index e42e2ecb0..5f52b930a 100644 --- a/lending/docs/pkg/models/operations/getbankingtransactionresponse.md +++ b/lending/docs/pkg/models/operations/getbankingtransactionresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `BankingTransaction` | [*shared.BankingTransaction](../../../pkg/models/shared/bankingtransaction.md) | :heavy_minus_sign: | Success | {"id":"0130b5bb-1419-40f6-8a27-7362d0381229","accountId":"1703194f-7805-4da8-bac0-2ba5da4a4216","description":"Payments for direct income ce149943-c157-43fc-aac7-42a716b655b6","amount":5062.39,"currency":"GBP","postedDate":"2021-07-06T00:00:00","authorizedDate":"2021-07-06T00:00:00","merchantName":"New Look","transactionCategoryRef":{"id":"health-and-fitness-sports"},"modifiedDate":"2022-05-23T16:32:50Z","sourceModifiedDate":"2021-06-28T10:48:12"} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `BankingTransaction` | [*shared.BankingTransaction](../../../pkg/models/shared/bankingtransaction.md) | :heavy_minus_sign: | Success | {
"id": "0130b5bb-1419-40f6-8a27-7362d0381229",
"accountId": "1703194f-7805-4da8-bac0-2ba5da4a4216",
"description": "Payments for direct income ce149943-c157-43fc-aac7-42a716b655b6",
"amount": 5062.39,
"currency": "GBP",
"postedDate": "2021-07-06T00:00:00",
"authorizedDate": "2021-07-06T00:00:00",
"merchantName": "New Look",
"transactionCategoryRef": {
"id": "health-and-fitness-sports"
},
"modifiedDate": "2022-05-23T16:32:50Z",
"sourceModifiedDate": "2021-06-28T10:48:12"
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getbankstatementuploadconfigurationrequest.md b/lending/docs/pkg/models/operations/getbankstatementuploadconfigurationrequest.md new file mode 100644 index 000000000..263479c49 --- /dev/null +++ b/lending/docs/pkg/models/operations/getbankstatementuploadconfigurationrequest.md @@ -0,0 +1,9 @@ +# GetBankStatementUploadConfigurationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `CompanyID` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getbankstatementuploadconfigurationresponse.md b/lending/docs/pkg/models/operations/getbankstatementuploadconfigurationresponse.md new file mode 100644 index 000000000..8288ca59f --- /dev/null +++ b/lending/docs/pkg/models/operations/getbankstatementuploadconfigurationresponse.md @@ -0,0 +1,11 @@ +# GetBankStatementUploadConfigurationResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `BankStatementUploadConfiguration` | [*shared.BankStatementUploadConfiguration](../../../pkg/models/shared/bankstatementuploadconfiguration.md) | :heavy_minus_sign: | Success | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getcategorizedbalancesheetstatementresponse.md b/lending/docs/pkg/models/operations/getcategorizedbalancesheetstatementresponse.md index 421902b4a..efaf9f6ac 100644 --- a/lending/docs/pkg/models/operations/getcategorizedbalancesheetstatementresponse.md +++ b/lending/docs/pkg/models/operations/getcategorizedbalancesheetstatementresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `EnhancedFinancialReport` | [*shared.EnhancedFinancialReport](../../../pkg/models/shared/enhancedfinancialreport.md) | :heavy_minus_sign: | OK | {"reportInfo":{"reportName":"EnhancedProfitAndLossAccounts","companyName":"ABC LTD","generatedDate":"2022-01-01"},"reportItems":[{"date":"2022-01-01","balance":70,"accountName":"Sales UK","accountId":"13931cbf-ea06-4d6e-9538-a8457fa66011","accountCategory":{"status":"Suggested","levels":[{"levelName":"Income","confidence":0.95},{"levelName":"Revenue","confidence":0.9}]}},{"date":"2022-01-01","balance":30,"accountName":"Sales US","accountId":"13931cbf-ea06-4d6e-9538-a8457fa66011","accountCategory":{"lastUpdated":"2022-01-02","status":"Suggested","levels":[{"levelName":"Income","confidence":0.95},{"levelName":"Revenue","confidence":0.9}]}},{"date":"2022-01-01","balance":70,"accountName":"Amazon","accountId":"13931cbf-ea06-4d6e-9538-a8457fa66011","accountCategory":{"lastUpdated":"2022-01-02","status":"Suggested","levels":[{"levelName":"Income","confidence":0.95},{"levelName":"Revenue","confidence":0.95},{"levelName":"Online","confidence":0.8}]}}]} | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `EnhancedFinancialReport` | [*shared.EnhancedFinancialReport](../../../pkg/models/shared/enhancedfinancialreport.md) | :heavy_minus_sign: | OK | {
"reportInfo": {
"reportName": "EnhancedProfitAndLossAccounts",
"companyName": "ABC LTD",
"generatedDate": "2022-01-01"
},
"reportItems": [
{
"date": "2022-01-01",
"balance": 70,
"accountName": "Sales UK",
"accountId": "13931cbf-ea06-4d6e-9538-a8457fa66011",
"accountCategory": {
"status": "Suggested",
"levels": [
{
"levelName": "Income",
"confidence": 0.95
},
{
"levelName": "Revenue",
"confidence": 0.9
}
]
}
},
{
"date": "2022-01-01",
"balance": 30,
"accountName": "Sales US",
"accountId": "13931cbf-ea06-4d6e-9538-a8457fa66011",
"accountCategory": {
"lastUpdated": "2022-01-02",
"status": "Suggested",
"levels": [
{
"levelName": "Income",
"confidence": 0.95
},
{
"levelName": "Revenue",
"confidence": 0.9
}
]
}
},
{
"date": "2022-01-01",
"balance": 70,
"accountName": "Amazon",
"accountId": "13931cbf-ea06-4d6e-9538-a8457fa66011",
"accountCategory": {
"lastUpdated": "2022-01-02",
"status": "Suggested",
"levels": [
{
"levelName": "Income",
"confidence": 0.95
},
{
"levelName": "Revenue",
"confidence": 0.95
},
{
"levelName": "Online",
"confidence": 0.8
}
]
}
}
]
} | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getcategorizedbankstatementrequest.md b/lending/docs/pkg/models/operations/getcategorizedbankstatementrequest.md index 4676ca6dc..ed57d05cb 100644 --- a/lending/docs/pkg/models/operations/getcategorizedbankstatementrequest.md +++ b/lending/docs/pkg/models/operations/getcategorizedbankstatementrequest.md @@ -8,4 +8,4 @@ | `CompanyID` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getcategorizedbankstatementresponse.md b/lending/docs/pkg/models/operations/getcategorizedbankstatementresponse.md index f55878bf9..41ff76664 100644 --- a/lending/docs/pkg/models/operations/getcategorizedbankstatementresponse.md +++ b/lending/docs/pkg/models/operations/getcategorizedbankstatementresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `EnhancedCashFlowTransactions` | [*shared.EnhancedCashFlowTransactions](../../../pkg/models/shared/enhancedcashflowtransactions.md) | :heavy_minus_sign: | OK | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `EnhancedCashFlowTransactions` | [*shared.EnhancedCashFlowTransactions](../../../pkg/models/shared/enhancedcashflowtransactions.md) | :heavy_minus_sign: | OK | {
"reportInfo": {
"pageNumber": 1,
"pageSize": 100,
"totalResults": 2401,
"reportName": "Cash Flow transactions report",
"companyName": "Example Company",
"generatedDate": "2023-01-25T22:36:05.125Z"
},
"dataSources": [
{
"accounts": [
{
"sourceRef": {
"sourceType": "Banking"
},
"id": "4f78a6b0-e9bb-40f2-82fd-f3a2daa1fd0a",
"platformName": "Plaid",
"accountProvider": "Bank of Sandbox",
"accountName": "Business Current Account",
"accountType": "Debit",
"currency": "USD",
"currentBalance": 1000,
"identifiers": [
{
"type": "Debit",
"subType": "Current",
"number": 12345678,
"bankCode": 123456,
"iban": "US123456789",
"bic": "US123456789",
"maskedAccountNumber": 1234
}
]
},
{
"sourceRef": {
"sourceType": "Banking"
},
"id": "12345678-1234-1234-1234-123456789012",
"platformName": "Plaid",
"accountProvider": "Bank of Sandbox",
"accountName": "Business Saving Account",
"accountType": "Debit",
"currency": "USD",
"currentBalance": 5321,
"identifiers": [
{
"type": "Debit",
"subType": "Saving",
"number": 87654321,
"bankCode": 654321,
"iban": "US987654321",
"bic": "US987654321",
"maskedAccountNumber": 4321
}
]
}
]
}
],
"reportItems": [
{
"transactions": [
{
"sourceRef": {
"sourceType": "Banking"
}
},
{
"accountRef": {
"id": "4f78a6b0-e9bb-40f2-82fd-f3a2daa1fd0a",
"name": "Business Current Account"
},
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"date": "2023-01-25",
"description": "Payment to supplier",
"amount": 100,
"currency": "USD",
"transactionCategory": {
"confidence": 92.7,
"levels": [
"Asset",
"Current",
"Bank"
],
"confidences": [
92.7,
95,
96
]
},
"platformName": "Plaid",
"counterpartyNames": [
"Counterparty"
],
"modifiedDate": "2023-01-25T22:36:05.125Z"
},
{
"sourceRef": {
"sourceType": "Banking"
}
},
{
"accountRef": {
"id": "12345678-1234-1234-1234-123456789012",
"name": "Business Saving Account"
},
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"date": "2023-01-25",
"description": "Payment to supplier",
"amount": 100,
"currency": "USD",
"transactionCategory": null,
"confidence": 92.7,
"levels": [
"Expense",
"Operating"
],
"confidences": [
92.7,
95
],
"platformName": "Plaid",
"counterpartyNames": [],
"modifiedDate": "2023-01-25T22:36:05.125Z"
}
]
}
]
} | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getcategorizedprofitandlossstatementresponse.md b/lending/docs/pkg/models/operations/getcategorizedprofitandlossstatementresponse.md index 3bb90432c..e8d84cfdf 100644 --- a/lending/docs/pkg/models/operations/getcategorizedprofitandlossstatementresponse.md +++ b/lending/docs/pkg/models/operations/getcategorizedprofitandlossstatementresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `EnhancedFinancialReport` | [*shared.EnhancedFinancialReport](../../../pkg/models/shared/enhancedfinancialreport.md) | :heavy_minus_sign: | OK | {"reportInfo":{"reportName":"EnhancedProfitAndLossAccounts","companyName":"ABC LTD","generatedDate":"2022-01-01"},"reportItems":[{"date":"2022-01-01","balance":70,"accountName":"Sales UK","accountId":"13931cbf-ea06-4d6e-9538-a8457fa66011","accountCategory":{"status":"Suggested","levels":[{"levelName":"Income","confidence":0.95},{"levelName":"Revenue","confidence":0.9}]}},{"date":"2022-01-01","balance":30,"accountName":"Sales US","accountId":"13931cbf-ea06-4d6e-9538-a8457fa66011","accountCategory":{"lastUpdated":"2022-01-02","status":"Suggested","levels":[{"levelName":"Income","confidence":0.95},{"levelName":"Revenue","confidence":0.9}]}},{"date":"2022-01-01","balance":70,"accountName":"Amazon","accountId":"13931cbf-ea06-4d6e-9538-a8457fa66011","accountCategory":{"lastUpdated":"2022-01-02","status":"Suggested","levels":[{"levelName":"Income","confidence":0.95},{"levelName":"Revenue","confidence":0.95},{"levelName":"Online","confidence":0.8}]}}]} | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `EnhancedFinancialReport` | [*shared.EnhancedFinancialReport](../../../pkg/models/shared/enhancedfinancialreport.md) | :heavy_minus_sign: | OK | {
"reportInfo": {
"reportName": "EnhancedProfitAndLossAccounts",
"companyName": "ABC LTD",
"generatedDate": "2022-01-01"
},
"reportItems": [
{
"date": "2022-01-01",
"balance": 70,
"accountName": "Sales UK",
"accountId": "13931cbf-ea06-4d6e-9538-a8457fa66011",
"accountCategory": {
"status": "Suggested",
"levels": [
{
"levelName": "Income",
"confidence": 0.95
},
{
"levelName": "Revenue",
"confidence": 0.9
}
]
}
},
{
"date": "2022-01-01",
"balance": 30,
"accountName": "Sales US",
"accountId": "13931cbf-ea06-4d6e-9538-a8457fa66011",
"accountCategory": {
"lastUpdated": "2022-01-02",
"status": "Suggested",
"levels": [
{
"levelName": "Income",
"confidence": 0.95
},
{
"levelName": "Revenue",
"confidence": 0.9
}
]
}
},
{
"date": "2022-01-01",
"balance": 70,
"accountName": "Amazon",
"accountId": "13931cbf-ea06-4d6e-9538-a8457fa66011",
"accountCategory": {
"lastUpdated": "2022-01-02",
"status": "Suggested",
"levels": [
{
"levelName": "Income",
"confidence": 0.95
},
{
"levelName": "Revenue",
"confidence": 0.95
},
{
"levelName": "Online",
"confidence": 0.8
}
]
}
}
]
} | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getcommercecustomerresponse.md b/lending/docs/pkg/models/operations/getcommercecustomerresponse.md index 1c67a74f6..70f4af709 100644 --- a/lending/docs/pkg/models/operations/getcommercecustomerresponse.md +++ b/lending/docs/pkg/models/operations/getcommercecustomerresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `CommerceCustomer` | [*shared.CommerceCustomer](../../../pkg/models/shared/commercecustomer.md) | :heavy_minus_sign: | OK | {"customers":[{"id":"15","customerName":"Daffy Duck","emailAddress":"d.duck@warnerbros.com","defaultCurrency":"GBP","phone":"(877) 492-8687","addresses":[{"type":"billing","line1":"301 Duck Pond","line2":"28 Green Street","city":"London","region":"England","country":"United Kingdom","postalCode":"WX1X 0BE"},{"type":"delivery","line1":"Bread Street","line2":"Bird Avenue","city":"Paris","region":"France","country":"France","postalCode":"WDF 123"}],"note":"Regular customer","createdDate":"0001-01-01T00:00:00","modifiedDate":null,"sourceModifiedDate":"2020-09-15T23:52:28"},{"id":"18","customerName":"Tasmanian Devil","emailAddress":"t.devil@warnerbros.com","defaultCurrency":"GBP","phone":"+1-202-555-0181","addresses":[{"type":"billing","line1":"101 Fire Rooms","line2":"Engine Street","city":"London","region":"England","country":"United Kingdom","postalCode":"WC1X 0BE"}],"note":"Handle with care","createdDate":"0001-01-01T00:00:00","modifiedDate":null,"sourceModifiedDate":"2020-04-16T02:41:52"},{"id":"a99f5e0c-a4db-452f-8d2c-8fd15482b384","customerName":"Bugs Bunny","emailAddress":"b.bunny@warnerbros.com","defaultCurrency":"GBP","phone":"","addresses":[{"type":"billing","line1":"301 Carrot Street","line2":"Orange Town","city":"Yorkshire","region":"England","country":"United Kingdom","postalCode":"WF1X 0BE"},{"type":"delivery","line1":"424 Field Street","line2":"The Meadow","city":"Paris","region":"France","country":"France","postalCode":"WDF 123"}],"note":"Regular customer","createdDate":"0001-01-01T00:00:00","modifiedDate":null,"sourceModifiedDate":"2020-08-12T14:37:37"}]} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CommerceCustomer` | [*shared.CommerceCustomer](../../../pkg/models/shared/commercecustomer.md) | :heavy_minus_sign: | OK | {
"customers": [
{
"id": "15",
"customerName": "Daffy Duck",
"emailAddress": "d.duck@warnerbros.com",
"defaultCurrency": "GBP",
"phone": "(877) 492-8687",
"addresses": [
{
"type": "billing",
"line1": "301 Duck Pond",
"line2": "28 Green Street",
"city": "London",
"region": "England",
"country": "United Kingdom",
"postalCode": "WX1X 0BE"
},
{
"type": "delivery",
"line1": "Bread Street",
"line2": "Bird Avenue",
"city": "Paris",
"region": "France",
"country": "France",
"postalCode": "WDF 123"
}
],
"note": "Regular customer",
"createdDate": "0001-01-01T00:00:00",
"modifiedDate": null,
"sourceModifiedDate": "2020-09-15T23:52:28"
},
{
"id": "18",
"customerName": "Tasmanian Devil",
"emailAddress": "t.devil@warnerbros.com",
"defaultCurrency": "GBP",
"phone": "+1-202-555-0181",
"addresses": [
{
"type": "billing",
"line1": "101 Fire Rooms",
"line2": "Engine Street",
"city": "London",
"region": "England",
"country": "United Kingdom",
"postalCode": "WC1X 0BE"
}
],
"note": "Handle with care",
"createdDate": "0001-01-01T00:00:00",
"modifiedDate": null,
"sourceModifiedDate": "2020-04-16T02:41:52"
},
{
"id": "a99f5e0c-a4db-452f-8d2c-8fd15482b384",
"customerName": "Bugs Bunny",
"emailAddress": "b.bunny@warnerbros.com",
"defaultCurrency": "GBP",
"phone": "",
"addresses": [
{
"type": "billing",
"line1": "301 Carrot Street",
"line2": "Orange Town",
"city": "Yorkshire",
"region": "England",
"country": "United Kingdom",
"postalCode": "WF1X 0BE"
},
{
"type": "delivery",
"line1": "424 Field Street",
"line2": "The Meadow",
"city": "Paris",
"region": "France",
"country": "France",
"postalCode": "WDF 123"
}
],
"note": "Regular customer",
"createdDate": "0001-01-01T00:00:00",
"modifiedDate": null,
"sourceModifiedDate": "2020-08-12T14:37:37"
}
]
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getcommercedisputeresponse.md b/lending/docs/pkg/models/operations/getcommercedisputeresponse.md index 303dd7a02..d6843b803 100644 --- a/lending/docs/pkg/models/operations/getcommercedisputeresponse.md +++ b/lending/docs/pkg/models/operations/getcommercedisputeresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `CommerceDispute` | [*shared.CommerceDispute](../../../pkg/models/shared/commercedispute.md) | :heavy_minus_sign: | OK | {"id":"03e608e3-bd1c-454f-8c2b-fb0133e43b95","disputedTransactions":[{"id":"e63ad857-7e12-4e64-9185-cdfd7c45d09d","type":"Order"}],"totalAmount":-47.66,"currency":"GBP","status":"InquiryEvidenceRequired","reason":"Unhappy with product","dueDate":"2021-03-29T14:39:55","createdDate":"2021-03-22T14:39:55","modifiedDate":"2022-02-02T11:02:45Z","sourceModifiedDate":"2021-03-22T14:39:55"} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CommerceDispute` | [*shared.CommerceDispute](../../../pkg/models/shared/commercedispute.md) | :heavy_minus_sign: | OK | {
"id": "03e608e3-bd1c-454f-8c2b-fb0133e43b95",
"disputedTransactions": [
{
"id": "e63ad857-7e12-4e64-9185-cdfd7c45d09d",
"type": "Order"
}
],
"totalAmount": -47.66,
"currency": "GBP",
"status": "InquiryEvidenceRequired",
"reason": "Unhappy with product",
"dueDate": "2021-03-29T14:39:55",
"createdDate": "2021-03-22T14:39:55",
"modifiedDate": "2022-02-02T11:02:45Z",
"sourceModifiedDate": "2021-03-22T14:39:55"
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getcommercelocationresponse.md b/lending/docs/pkg/models/operations/getcommercelocationresponse.md index b725c278f..6fab97266 100644 --- a/lending/docs/pkg/models/operations/getcommercelocationresponse.md +++ b/lending/docs/pkg/models/operations/getcommercelocationresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `CommerceLocation` | [*shared.CommerceLocation](../../../pkg/models/shared/commercelocation.md) | :heavy_minus_sign: | OK | {"id":"15","name":"London Warehouse","address":{"type":"Inventory","line1":"Warner House","line2":"98 Theobald's Road","city":"London","region":"","country":"United Kingdom","postalCode":"WC1X 8WB"},"modifiedDate":"2020-08-12T14:37:37","sourceModifiedDate":"2020-08-12T14:37:37"} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CommerceLocation` | [*shared.CommerceLocation](../../../pkg/models/shared/commercelocation.md) | :heavy_minus_sign: | OK | {
"id": "15",
"name": "London Warehouse",
"address": {
"type": "Inventory",
"line1": "Warner House",
"line2": "98 Theobald's Road",
"city": "London",
"region": "",
"country": "United Kingdom",
"postalCode": "WC1X 8WB"
},
"modifiedDate": "2020-08-12T14:37:37",
"sourceModifiedDate": "2020-08-12T14:37:37"
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getcommerceorderresponse.md b/lending/docs/pkg/models/operations/getcommerceorderresponse.md index 7909e415a..90ac148f1 100644 --- a/lending/docs/pkg/models/operations/getcommerceorderresponse.md +++ b/lending/docs/pkg/models/operations/getcommerceorderresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `CommerceOrder` | [*shared.CommerceOrder](../../../pkg/models/shared/commerceorder.md) | :heavy_minus_sign: | OK | {"id":"01e63721-1205-478e-8503-9d8bf8a93f44","orderNumber":"99123956","country":"CAN","currency":"CAD","createdDate":"2021-03-28T03:00:14","totalAmount":12,"totalRefund":0,"totalTaxAmount":2,"totalDiscount":0,"totalGratuity":1,"orderLineItems":[{"id":"116113a6-54d3-4624-ba73-26a77a5ffd51","quantity":1,"taxPercentage":20,"totalAmount":12,"totalTaxAmount":2,"unitPrice":10,"taxes":[{"taxComponentRef":{"id":"72","name":"Sales Tax"},"taxAmount":""},{"taxComponentRef":{"id":"72","name":"City Tax"},"taxAmount":""}],"productRef":{"id":"ac186646-41f2-4280-afea-1012c59459ab","name":"Intelligent Concrete Salad"},"productVariantRef":{"id":"f9ca9de5-9e31-460d-ac81-368f4e7c8fc0","name":"Small Incredible Wooden Soap"},"discountAllocations":[]}],"payments":[{"id":"defdceb6-83a3-4b7d-a74e-e9ef947d5f48","amount":12,"currency":"CAD","type":"Paypal","status":"Unknown","dueDate":"2021-04-04T03:00:14","createdDate":"2021-03-28T03:00:14","modifiedDate":"2022-02-02T11:02:45"}],"serviceCharges":[{"description":"Service Charge","totalAmount":1.2,"taxPercentage":20,"taxAmount":0.2,"taxes":[{"taxComponentRef":{"id":"72","name":"Service Tax"},"taxAmount":""}],"quantity":1,"type":"Generic"}],"locationRef":{"id":"47bbffc7-c045-4b0f-a3bb-ecf1f669edfa"},"customerRef":{"id":"2634d180-7205-43f0-a73d-84af6443a005","name":"Emmy Roberts"},"modifiedDate":"2022-02-02T11:02:45Z","sourceModifiedDate":"2021-03-28T03:00:14"} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CommerceOrder` | [*shared.CommerceOrder](../../../pkg/models/shared/commerceorder.md) | :heavy_minus_sign: | OK | {
"id": "01e63721-1205-478e-8503-9d8bf8a93f44",
"orderNumber": "99123956",
"country": "CAN",
"currency": "CAD",
"createdDate": "2021-03-28T03:00:14",
"totalAmount": 12,
"totalRefund": 0,
"totalTaxAmount": 2,
"totalDiscount": 0,
"totalGratuity": 1,
"orderLineItems": [
{
"id": "116113a6-54d3-4624-ba73-26a77a5ffd51",
"quantity": 1,
"taxPercentage": 20,
"totalAmount": 12,
"totalTaxAmount": 2,
"unitPrice": 10,
"taxes": [
{
"taxComponentRef": {
"id": "72",
"name": "Sales Tax"
},
"taxAmount": ""
},
{
"taxComponentRef": {
"id": "72",
"name": "City Tax"
},
"taxAmount": ""
}
],
"productRef": {
"id": "ac186646-41f2-4280-afea-1012c59459ab",
"name": "Intelligent Concrete Salad"
},
"productVariantRef": {
"id": "f9ca9de5-9e31-460d-ac81-368f4e7c8fc0",
"name": "Small Incredible Wooden Soap"
},
"discountAllocations": []
}
],
"payments": [
{
"id": "defdceb6-83a3-4b7d-a74e-e9ef947d5f48",
"amount": 12,
"currency": "CAD",
"type": "Paypal",
"status": "Unknown",
"dueDate": "2021-04-04T03:00:14",
"createdDate": "2021-03-28T03:00:14",
"modifiedDate": "2022-02-02T11:02:45"
}
],
"serviceCharges": [
{
"description": "Service Charge",
"totalAmount": 1.2,
"taxPercentage": 20,
"taxAmount": 0.2,
"taxes": [
{
"taxComponentRef": {
"id": "72",
"name": "Service Tax"
},
"taxAmount": ""
}
],
"quantity": 1,
"type": "Generic"
}
],
"locationRef": {
"id": "47bbffc7-c045-4b0f-a3bb-ecf1f669edfa"
},
"customerRef": {
"id": "2634d180-7205-43f0-a73d-84af6443a005",
"name": "Emmy Roberts"
},
"modifiedDate": "2022-02-02T11:02:45Z",
"sourceModifiedDate": "2021-03-28T03:00:14"
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getcommerceproductcategoryresponse.md b/lending/docs/pkg/models/operations/getcommerceproductcategoryresponse.md index 38b437fb5..aa64b325f 100644 --- a/lending/docs/pkg/models/operations/getcommerceproductcategoryresponse.md +++ b/lending/docs/pkg/models/operations/getcommerceproductcategoryresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `CommerceProductCategory` | [*shared.CommerceProductCategory](../../../pkg/models/shared/commerceproductcategory.md) | :heavy_minus_sign: | OK | {"productCategories":[{"id":"100","name":"Entertainment","ancestorRefs":[],"hasChildren":true,"modifiedDate":"2022-01-01T12:00:00Z","sourceModifiedDate":"2021-10-01T12:53:21Z"},{"id":"101","name":"Cinema","ancestorRefs":[{"id":"100","name":"Entertainment"}],"hasChildren":true,"modifiedDate":"2022-01-01T12:00:00Z","sourceModifiedDate":"2021-10-01T12:55:02Z"},{"id":"102","name":"Movie","ancestorRefs":[{"id":"100","name":"Entertainment"},{"id":"101","name":"Cinema"}],"hasChildren":false,"modifiedDate":"2022-01-01T12:00:00Z","sourceModifiedDate":"2021-12-25T12:00:00Z"}]} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CommerceProductCategory` | [*shared.CommerceProductCategory](../../../pkg/models/shared/commerceproductcategory.md) | :heavy_minus_sign: | OK | {
"productCategories": [
{
"id": "100",
"name": "Entertainment",
"ancestorRefs": [],
"hasChildren": true,
"modifiedDate": "2022-01-01T12:00:00Z",
"sourceModifiedDate": "2021-10-01T12:53:21Z"
},
{
"id": "101",
"name": "Cinema",
"ancestorRefs": [
{
"id": "100",
"name": "Entertainment"
}
],
"hasChildren": true,
"modifiedDate": "2022-01-01T12:00:00Z",
"sourceModifiedDate": "2021-10-01T12:55:02Z"
},
{
"id": "102",
"name": "Movie",
"ancestorRefs": [
{
"id": "100",
"name": "Entertainment"
},
{
"id": "101",
"name": "Cinema"
}
],
"hasChildren": false,
"modifiedDate": "2022-01-01T12:00:00Z",
"sourceModifiedDate": "2021-12-25T12:00:00Z"
}
]
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getcompanyresponse.md b/lending/docs/pkg/models/operations/getcompanyresponse.md index d2fd90472..8bc3efda8 100644 --- a/lending/docs/pkg/models/operations/getcompanyresponse.md +++ b/lending/docs/pkg/models/operations/getcompanyresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Company` | [*shared.Company](../../../pkg/models/shared/company.md) | :heavy_minus_sign: | OK | {"id":"0498e921-9b53-4396-a412-4f2f5983b0a2","name":"string","platform":"string","redirect":"https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739","lastSync":"2022-01-01T12:00:00.000Z","created":"2022-01-01T12:00:00.000Z","createdByUserName":"string","dataConnections":[{"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"}],"groups":[{"id":"d7a6c4b4-dc87-45f6-b803-62f466398680"}]} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Company` | [*shared.Company](../../../pkg/models/shared/company.md) | :heavy_minus_sign: | OK | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739",
"lastSync": "2022-01-01T12:00:00.000Z",
"created": "2022-01-01T12:00:00.000Z",
"createdByUserName": "string",
"tags": {
"region": "us",
"uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"
},
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
]
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getconnectionresponse.md b/lending/docs/pkg/models/operations/getconnectionresponse.md index cec1bdb6e..30b35ef1b 100644 --- a/lending/docs/pkg/models/operations/getconnectionresponse.md +++ b/lending/docs/pkg/models/operations/getconnectionresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Connection` | [*shared.Connection](../../../pkg/models/shared/connection.md) | :heavy_minus_sign: | OK | {"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Connection` | [*shared.Connection](../../../pkg/models/shared/connection.md) | :heavy_minus_sign: | OK | {
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getdataintegritysummariesrequest.md b/lending/docs/pkg/models/operations/getdataintegritysummariesrequest.md index a2ca88e6d..f4a6736d1 100644 --- a/lending/docs/pkg/models/operations/getdataintegritysummariesrequest.md +++ b/lending/docs/pkg/models/operations/getdataintegritysummariesrequest.md @@ -7,4 +7,4 @@ | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | | `CompanyID` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `DataType` | [shared.DataIntegrityDataType](../../../pkg/models/shared/dataintegritydatatype.md) | :heavy_check_mark: | A key for a Codat data type. | banking-accounts | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getdatastatusdatastatuses.md b/lending/docs/pkg/models/operations/getdatastatusdatastatuses.md new file mode 100644 index 000000000..9b20b4637 --- /dev/null +++ b/lending/docs/pkg/models/operations/getdatastatusdatastatuses.md @@ -0,0 +1,52 @@ +# GetDataStatusDataStatuses + +OK + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountTransactions` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `BalanceSheet` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `BankAccounts` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `BankTransactions` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `BankingAccountBalances` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `BankingAccounts` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `BankingTransactionCategories` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `BankingTransactions` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `BillCreditNotes` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `BillPayments` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `Bills` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `CashFlowStatement` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `ChartOfAccounts` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `CommerceCompanyInfo` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `CommerceCustomers` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `CommerceDisputes` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `CommerceLocations` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `CommerceOrders` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `CommercePaymentMethods` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `CommercePayments` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `CommerceProductCategories` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `CommerceProducts` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `CommerceTaxComponents` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `CommerceTransactions` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `Company` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `CreditNotes` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `Customers` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `DirectCosts` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `DirectIncomes` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `Invoices` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `ItemReceipts` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `Items` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `JournalEntries` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `Journals` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `PaymentMethods` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `Payments` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `ProfitAndLoss` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `PurchaseOrders` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `SalesOrders` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `Suppliers` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `TaxRates` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `TrackingCategories` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `Transfers` | [*shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getdatastatusresponse.md b/lending/docs/pkg/models/operations/getdatastatusresponse.md index 28fc68ffa..9416981a4 100644 --- a/lending/docs/pkg/models/operations/getdatastatusresponse.md +++ b/lending/docs/pkg/models/operations/getdatastatusresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `DataStatuses` | map[string][shared.DataStatus](../../../pkg/models/shared/datastatus.md) | :heavy_minus_sign: | OK | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `DataStatuses` | [*operations.GetDataStatusDataStatuses](../../../pkg/models/operations/getdatastatusdatastatuses.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getloansummaryresponse.md b/lending/docs/pkg/models/operations/getloansummaryresponse.md index 5d7b4b6c0..4f5a29c86 100644 --- a/lending/docs/pkg/models/operations/getloansummaryresponse.md +++ b/lending/docs/pkg/models/operations/getloansummaryresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `LoanSummary` | [*shared.LoanSummary](../../../pkg/models/shared/loansummary.md) | :heavy_minus_sign: | OK | {"reportInfo":{"reportName":"LoanSummaryReport","companyName":"The Coffee shop","generatedDate":"2022-10-23T00:00:00Z"},"reportItems":[{"recordRef":{"id":"string","dataConnectionId":"DE34E8E3-089F-4DF4-89E9-F7C43618FCAAA","integrationType":"Accounting","recordRefType":"accounts"},"description":"string","startDate":"2021-01-01","totalInvestments":100000,"totalRepayments":83481.72,"balance":42513.18,"lenderName":"Barclays Bank"}]} | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `LoanSummary` | [*shared.LoanSummary](../../../pkg/models/shared/loansummary.md) | :heavy_minus_sign: | OK | {
"reportInfo": {
"reportName": "LoanSummaryReport",
"companyName": "The Coffee shop",
"generatedDate": "2022-10-23T00:00:00Z"
},
"reportItems": [
{
"recordRef": {
"id": "string",
"dataConnectionId": "DE34E8E3-089F-4DF4-89E9-F7C43618FCAAA",
"integrationType": "Accounting",
"recordRefType": "accounts"
},
"description": "string",
"startDate": "2021-01-01",
"totalInvestments": 100000,
"totalRepayments": 83481.72,
"balance": 42513.18,
"lender": "Barclays Bank"
}
]
} | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/getpulloperationresponse.md b/lending/docs/pkg/models/operations/getpulloperationresponse.md index be4d31b85..7568d1fbb 100644 --- a/lending/docs/pkg/models/operations/getpulloperationresponse.md +++ b/lending/docs/pkg/models/operations/getpulloperationresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `PullOperation` | [*shared.PullOperation](../../../pkg/models/shared/pulloperation.md) | :heavy_minus_sign: | OK | {"id":"97d60846-f07a-4d42-b5a0-0bdcc6ebf56b","companyId":"4645bd78-8988-45bc-ac9e-67ba5df6e4e5","connectionId":"51baa045-4836-4317-a42e-3542e991e581","dataType":"invoices","status":"Initial","statusDescription":"Paused until 2022-10-23T00:00:00.000Z","requested":"2022-11-14T11:18:37.2798351Z","progress":10,"isCompleted":false,"isErrored":false} | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `PullOperation` | [*shared.PullOperation](../../../pkg/models/shared/pulloperation.md) | :heavy_minus_sign: | OK | {
"id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b",
"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5",
"connectionId": "51baa045-4836-4317-a42e-3542e991e581",
"dataType": "invoices",
"status": "Initial",
"statusDescription": "Paused until 2022-10-23T00:00:00.000Z",
"requested": "2022-11-14T11:18:37.2798351Z",
"progress": 10,
"isCompleted": false,
"isErrored": false
} | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingaccountsrequest.md b/lending/docs/pkg/models/operations/listaccountingaccountsrequest.md index b0c178e60..b7781788b 100644 --- a/lending/docs/pkg/models/operations/listaccountingaccountsrequest.md +++ b/lending/docs/pkg/models/operations/listaccountingaccountsrequest.md @@ -9,4 +9,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingaccountsresponse.md b/lending/docs/pkg/models/operations/listaccountingaccountsresponse.md index 32305a289..1de74e983 100644 --- a/lending/docs/pkg/models/operations/listaccountingaccountsresponse.md +++ b/lending/docs/pkg/models/operations/listaccountingaccountsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingAccounts` | [*shared.AccountingAccounts](../../../pkg/models/shared/accountingaccounts.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingAccounts` | [*shared.AccountingAccounts](../../../pkg/models/shared/accountingaccounts.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingaccounttransactionsrequest.md b/lending/docs/pkg/models/operations/listaccountingaccounttransactionsrequest.md index 8f0ffe498..1d8ec59e1 100644 --- a/lending/docs/pkg/models/operations/listaccountingaccounttransactionsrequest.md +++ b/lending/docs/pkg/models/operations/listaccountingaccounttransactionsrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingaccounttransactionsresponse.md b/lending/docs/pkg/models/operations/listaccountingaccounttransactionsresponse.md index 53c7385a5..d2788b279 100644 --- a/lending/docs/pkg/models/operations/listaccountingaccounttransactionsresponse.md +++ b/lending/docs/pkg/models/operations/listaccountingaccounttransactionsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingAccountTransactions` | [*shared.AccountingAccountTransactions](../../../pkg/models/shared/accountingaccounttransactions.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingAccountTransactions` | [*shared.AccountingAccountTransactions](../../../pkg/models/shared/accountingaccounttransactions.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingbankaccountsrequest.md b/lending/docs/pkg/models/operations/listaccountingbankaccountsrequest.md index 4dce0bca6..6175f33c7 100644 --- a/lending/docs/pkg/models/operations/listaccountingbankaccountsrequest.md +++ b/lending/docs/pkg/models/operations/listaccountingbankaccountsrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingbankaccountsresponse.md b/lending/docs/pkg/models/operations/listaccountingbankaccountsresponse.md index 7c45be7b1..289e75d41 100644 --- a/lending/docs/pkg/models/operations/listaccountingbankaccountsresponse.md +++ b/lending/docs/pkg/models/operations/listaccountingbankaccountsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingBankAccounts` | [*shared.AccountingBankAccounts](../../../pkg/models/shared/accountingbankaccounts.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingBankAccounts` | [*shared.AccountingBankAccounts](../../../pkg/models/shared/accountingbankaccounts.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingbankaccounttransactionsrequest.md b/lending/docs/pkg/models/operations/listaccountingbankaccounttransactionsrequest.md index a0eec29b5..95bd7159c 100644 --- a/lending/docs/pkg/models/operations/listaccountingbankaccounttransactionsrequest.md +++ b/lending/docs/pkg/models/operations/listaccountingbankaccounttransactionsrequest.md @@ -11,4 +11,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingbankaccounttransactionsresponse.md b/lending/docs/pkg/models/operations/listaccountingbankaccounttransactionsresponse.md index 8d15b2379..7d2877393 100644 --- a/lending/docs/pkg/models/operations/listaccountingbankaccounttransactionsresponse.md +++ b/lending/docs/pkg/models/operations/listaccountingbankaccounttransactionsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingBankTransactions` | [*shared.AccountingBankTransactions](../../../pkg/models/shared/accountingbanktransactions.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingBankTransactions` | [*shared.AccountingBankTransactions](../../../pkg/models/shared/accountingbanktransactions.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingbillcreditnotesrequest.md b/lending/docs/pkg/models/operations/listaccountingbillcreditnotesrequest.md index d5c89b5ad..2dc0064a4 100644 --- a/lending/docs/pkg/models/operations/listaccountingbillcreditnotesrequest.md +++ b/lending/docs/pkg/models/operations/listaccountingbillcreditnotesrequest.md @@ -9,4 +9,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingbillcreditnotesresponse.md b/lending/docs/pkg/models/operations/listaccountingbillcreditnotesresponse.md index 2ee1cb979..c3be8dc81 100644 --- a/lending/docs/pkg/models/operations/listaccountingbillcreditnotesresponse.md +++ b/lending/docs/pkg/models/operations/listaccountingbillcreditnotesresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingBillCreditNotes` | [*shared.AccountingBillCreditNotes](../../../pkg/models/shared/accountingbillcreditnotes.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingBillCreditNotes` | [*shared.AccountingBillCreditNotes](../../../pkg/models/shared/accountingbillcreditnotes.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingbillpaymentsrequest.md b/lending/docs/pkg/models/operations/listaccountingbillpaymentsrequest.md index ed8651239..4c583ef57 100644 --- a/lending/docs/pkg/models/operations/listaccountingbillpaymentsrequest.md +++ b/lending/docs/pkg/models/operations/listaccountingbillpaymentsrequest.md @@ -9,4 +9,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingbillpaymentsresponse.md b/lending/docs/pkg/models/operations/listaccountingbillpaymentsresponse.md index 6ee2ede84..6b5231ef3 100644 --- a/lending/docs/pkg/models/operations/listaccountingbillpaymentsresponse.md +++ b/lending/docs/pkg/models/operations/listaccountingbillpaymentsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingBillPayments` | [*shared.AccountingBillPayments](../../../pkg/models/shared/accountingbillpayments.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingBillPayments` | [*shared.AccountingBillPayments](../../../pkg/models/shared/accountingbillpayments.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingbillsrequest.md b/lending/docs/pkg/models/operations/listaccountingbillsrequest.md index 2bb490c8f..9040fefaf 100644 --- a/lending/docs/pkg/models/operations/listaccountingbillsrequest.md +++ b/lending/docs/pkg/models/operations/listaccountingbillsrequest.md @@ -9,4 +9,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingbillsresponse.md b/lending/docs/pkg/models/operations/listaccountingbillsresponse.md index 8804e6e7a..ced4be017 100644 --- a/lending/docs/pkg/models/operations/listaccountingbillsresponse.md +++ b/lending/docs/pkg/models/operations/listaccountingbillsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingBills` | [*shared.AccountingBills](../../../pkg/models/shared/accountingbills.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingBills` | [*shared.AccountingBills](../../../pkg/models/shared/accountingbills.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingcreditnotesrequest.md b/lending/docs/pkg/models/operations/listaccountingcreditnotesrequest.md index 2a51ffe32..116083dd7 100644 --- a/lending/docs/pkg/models/operations/listaccountingcreditnotesrequest.md +++ b/lending/docs/pkg/models/operations/listaccountingcreditnotesrequest.md @@ -9,4 +9,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingcreditnotesresponse.md b/lending/docs/pkg/models/operations/listaccountingcreditnotesresponse.md index e9224f891..08dd1f82e 100644 --- a/lending/docs/pkg/models/operations/listaccountingcreditnotesresponse.md +++ b/lending/docs/pkg/models/operations/listaccountingcreditnotesresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingCreditNotes` | [*shared.AccountingCreditNotes](../../../pkg/models/shared/accountingcreditnotes.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingCreditNotes` | [*shared.AccountingCreditNotes](../../../pkg/models/shared/accountingcreditnotes.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingcustomersrequest.md b/lending/docs/pkg/models/operations/listaccountingcustomersrequest.md index 0b29c6fb1..aaf2d030d 100644 --- a/lending/docs/pkg/models/operations/listaccountingcustomersrequest.md +++ b/lending/docs/pkg/models/operations/listaccountingcustomersrequest.md @@ -9,4 +9,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingcustomersresponse.md b/lending/docs/pkg/models/operations/listaccountingcustomersresponse.md index 6e66326b7..5bf35c569 100644 --- a/lending/docs/pkg/models/operations/listaccountingcustomersresponse.md +++ b/lending/docs/pkg/models/operations/listaccountingcustomersresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingCustomers` | [*shared.AccountingCustomers](../../../pkg/models/shared/accountingcustomers.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingCustomers` | [*shared.AccountingCustomers](../../../pkg/models/shared/accountingcustomers.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingdirectcostsrequest.md b/lending/docs/pkg/models/operations/listaccountingdirectcostsrequest.md index afc28b958..c0d8cc2cc 100644 --- a/lending/docs/pkg/models/operations/listaccountingdirectcostsrequest.md +++ b/lending/docs/pkg/models/operations/listaccountingdirectcostsrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingdirectcostsresponse.md b/lending/docs/pkg/models/operations/listaccountingdirectcostsresponse.md index 03f00191a..23e01f86a 100644 --- a/lending/docs/pkg/models/operations/listaccountingdirectcostsresponse.md +++ b/lending/docs/pkg/models/operations/listaccountingdirectcostsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingDirectCosts` | [*shared.AccountingDirectCosts](../../../pkg/models/shared/accountingdirectcosts.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingDirectCosts` | [*shared.AccountingDirectCosts](../../../pkg/models/shared/accountingdirectcosts.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingdirectincomesrequest.md b/lending/docs/pkg/models/operations/listaccountingdirectincomesrequest.md index c854d629e..f94ad0846 100644 --- a/lending/docs/pkg/models/operations/listaccountingdirectincomesrequest.md +++ b/lending/docs/pkg/models/operations/listaccountingdirectincomesrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingdirectincomesresponse.md b/lending/docs/pkg/models/operations/listaccountingdirectincomesresponse.md index 84bd3cc27..641200448 100644 --- a/lending/docs/pkg/models/operations/listaccountingdirectincomesresponse.md +++ b/lending/docs/pkg/models/operations/listaccountingdirectincomesresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingDirectIncomes` | [*shared.AccountingDirectIncomes](../../../pkg/models/shared/accountingdirectincomes.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingDirectIncomes` | [*shared.AccountingDirectIncomes](../../../pkg/models/shared/accountingdirectincomes.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountinginvoicesrequest.md b/lending/docs/pkg/models/operations/listaccountinginvoicesrequest.md index 5c12a10f3..513b830d2 100644 --- a/lending/docs/pkg/models/operations/listaccountinginvoicesrequest.md +++ b/lending/docs/pkg/models/operations/listaccountinginvoicesrequest.md @@ -9,4 +9,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountinginvoicesresponse.md b/lending/docs/pkg/models/operations/listaccountinginvoicesresponse.md index 58ffc3fcc..d33ba4a9e 100644 --- a/lending/docs/pkg/models/operations/listaccountinginvoicesresponse.md +++ b/lending/docs/pkg/models/operations/listaccountinginvoicesresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingInvoices` | [*shared.AccountingInvoices](../../../pkg/models/shared/accountinginvoices.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingInvoices` | [*shared.AccountingInvoices](../../../pkg/models/shared/accountinginvoices.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingjournalentriesrequest.md b/lending/docs/pkg/models/operations/listaccountingjournalentriesrequest.md index 70dadc0e1..8f98ac705 100644 --- a/lending/docs/pkg/models/operations/listaccountingjournalentriesrequest.md +++ b/lending/docs/pkg/models/operations/listaccountingjournalentriesrequest.md @@ -9,4 +9,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingjournalentriesresponse.md b/lending/docs/pkg/models/operations/listaccountingjournalentriesresponse.md index 1ecb3f7c1..54e230485 100644 --- a/lending/docs/pkg/models/operations/listaccountingjournalentriesresponse.md +++ b/lending/docs/pkg/models/operations/listaccountingjournalentriesresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingJournalEntries` | [*shared.AccountingJournalEntries](../../../pkg/models/shared/accountingjournalentries.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingJournalEntries` | [*shared.AccountingJournalEntries](../../../pkg/models/shared/accountingjournalentries.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingjournalsrequest.md b/lending/docs/pkg/models/operations/listaccountingjournalsrequest.md index 09e4d8870..e27184014 100644 --- a/lending/docs/pkg/models/operations/listaccountingjournalsrequest.md +++ b/lending/docs/pkg/models/operations/listaccountingjournalsrequest.md @@ -9,4 +9,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingjournalsresponse.md b/lending/docs/pkg/models/operations/listaccountingjournalsresponse.md index 5567e11ca..90b129322 100644 --- a/lending/docs/pkg/models/operations/listaccountingjournalsresponse.md +++ b/lending/docs/pkg/models/operations/listaccountingjournalsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingJournals` | [*shared.AccountingJournals](../../../pkg/models/shared/accountingjournals.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingJournals` | [*shared.AccountingJournals](../../../pkg/models/shared/accountingjournals.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingpaymentsrequest.md b/lending/docs/pkg/models/operations/listaccountingpaymentsrequest.md index 4df24e739..7ef8baa8b 100644 --- a/lending/docs/pkg/models/operations/listaccountingpaymentsrequest.md +++ b/lending/docs/pkg/models/operations/listaccountingpaymentsrequest.md @@ -9,4 +9,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingpaymentsresponse.md b/lending/docs/pkg/models/operations/listaccountingpaymentsresponse.md index 854d02c9e..d2a791e32 100644 --- a/lending/docs/pkg/models/operations/listaccountingpaymentsresponse.md +++ b/lending/docs/pkg/models/operations/listaccountingpaymentsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingPayments` | [*shared.AccountingPayments](../../../pkg/models/shared/accountingpayments.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingPayments` | [*shared.AccountingPayments](../../../pkg/models/shared/accountingpayments.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingsuppliersrequest.md b/lending/docs/pkg/models/operations/listaccountingsuppliersrequest.md index c7787144d..a96748fb0 100644 --- a/lending/docs/pkg/models/operations/listaccountingsuppliersrequest.md +++ b/lending/docs/pkg/models/operations/listaccountingsuppliersrequest.md @@ -9,4 +9,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingsuppliersresponse.md b/lending/docs/pkg/models/operations/listaccountingsuppliersresponse.md index 29c5f1a99..cdafb2f10 100644 --- a/lending/docs/pkg/models/operations/listaccountingsuppliersresponse.md +++ b/lending/docs/pkg/models/operations/listaccountingsuppliersresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingSuppliers` | [*shared.AccountingSuppliers](../../../pkg/models/shared/accountingsuppliers.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingSuppliers` | [*shared.AccountingSuppliers](../../../pkg/models/shared/accountingsuppliers.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingtransfersrequest.md b/lending/docs/pkg/models/operations/listaccountingtransfersrequest.md index 7c162e000..baa58f378 100644 --- a/lending/docs/pkg/models/operations/listaccountingtransfersrequest.md +++ b/lending/docs/pkg/models/operations/listaccountingtransfersrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listaccountingtransfersresponse.md b/lending/docs/pkg/models/operations/listaccountingtransfersresponse.md index 4b8f35cd6..f38e21fad 100644 --- a/lending/docs/pkg/models/operations/listaccountingtransfersresponse.md +++ b/lending/docs/pkg/models/operations/listaccountingtransfersresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AccountingTransfers` | [*shared.AccountingTransfers](../../../pkg/models/shared/accountingtransfers.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingTransfers` | [*shared.AccountingTransfers](../../../pkg/models/shared/accountingtransfers.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listbankingaccountbalancesrequest.md b/lending/docs/pkg/models/operations/listbankingaccountbalancesrequest.md index cc575afcb..b81a93398 100644 --- a/lending/docs/pkg/models/operations/listbankingaccountbalancesrequest.md +++ b/lending/docs/pkg/models/operations/listbankingaccountbalancesrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listbankingaccountbalancesresponse.md b/lending/docs/pkg/models/operations/listbankingaccountbalancesresponse.md index 4188403a8..4ce2c279a 100644 --- a/lending/docs/pkg/models/operations/listbankingaccountbalancesresponse.md +++ b/lending/docs/pkg/models/operations/listbankingaccountbalancesresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `BankingAccountBalances` | [*shared.BankingAccountBalances](../../../pkg/models/shared/bankingaccountbalances.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `BankingAccountBalances` | [*shared.BankingAccountBalances](../../../pkg/models/shared/bankingaccountbalances.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listbankingaccountsrequest.md b/lending/docs/pkg/models/operations/listbankingaccountsrequest.md index 51c32d53d..9bbfea137 100644 --- a/lending/docs/pkg/models/operations/listbankingaccountsrequest.md +++ b/lending/docs/pkg/models/operations/listbankingaccountsrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listbankingaccountsresponse.md b/lending/docs/pkg/models/operations/listbankingaccountsresponse.md index f4bf166ea..45a767455 100644 --- a/lending/docs/pkg/models/operations/listbankingaccountsresponse.md +++ b/lending/docs/pkg/models/operations/listbankingaccountsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `BankingAccounts` | [*shared.BankingAccounts](../../../pkg/models/shared/bankingaccounts.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `BankingAccounts` | [*shared.BankingAccounts](../../../pkg/models/shared/bankingaccounts.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listbankingtransactioncategoriesrequest.md b/lending/docs/pkg/models/operations/listbankingtransactioncategoriesrequest.md index 65bac91ac..739f007b8 100644 --- a/lending/docs/pkg/models/operations/listbankingtransactioncategoriesrequest.md +++ b/lending/docs/pkg/models/operations/listbankingtransactioncategoriesrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listbankingtransactioncategoriesresponse.md b/lending/docs/pkg/models/operations/listbankingtransactioncategoriesresponse.md index e942711db..c8b196abd 100644 --- a/lending/docs/pkg/models/operations/listbankingtransactioncategoriesresponse.md +++ b/lending/docs/pkg/models/operations/listbankingtransactioncategoriesresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `BankingTransactionCategories` | [*shared.BankingTransactionCategories](../../../pkg/models/shared/bankingtransactioncategories.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `BankingTransactionCategories` | [*shared.BankingTransactionCategories](../../../pkg/models/shared/bankingtransactioncategories.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listbankingtransactionsrequest.md b/lending/docs/pkg/models/operations/listbankingtransactionsrequest.md index da0eaeaec..ea3a10c9e 100644 --- a/lending/docs/pkg/models/operations/listbankingtransactionsrequest.md +++ b/lending/docs/pkg/models/operations/listbankingtransactionsrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listbankingtransactionsresponse.md b/lending/docs/pkg/models/operations/listbankingtransactionsresponse.md index 822fd2179..ffc0c09f0 100644 --- a/lending/docs/pkg/models/operations/listbankingtransactionsresponse.md +++ b/lending/docs/pkg/models/operations/listbankingtransactionsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `BankingTransactions` | [*shared.BankingTransactions](../../../pkg/models/shared/bankingtransactions.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `BankingTransactions` | [*shared.BankingTransactions](../../../pkg/models/shared/bankingtransactions.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommercecustomersrequest.md b/lending/docs/pkg/models/operations/listcommercecustomersrequest.md index 12d46aa4a..2a45e0569 100644 --- a/lending/docs/pkg/models/operations/listcommercecustomersrequest.md +++ b/lending/docs/pkg/models/operations/listcommercecustomersrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommercecustomersresponse.md b/lending/docs/pkg/models/operations/listcommercecustomersresponse.md index bd5f19c32..5dfa31824 100644 --- a/lending/docs/pkg/models/operations/listcommercecustomersresponse.md +++ b/lending/docs/pkg/models/operations/listcommercecustomersresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `CommerceCustomers` | [*shared.CommerceCustomers](../../../pkg/models/shared/commercecustomers.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CommerceCustomers` | [*shared.CommerceCustomers](../../../pkg/models/shared/commercecustomers.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommercedisputesrequest.md b/lending/docs/pkg/models/operations/listcommercedisputesrequest.md index fc08988f5..99517afc5 100644 --- a/lending/docs/pkg/models/operations/listcommercedisputesrequest.md +++ b/lending/docs/pkg/models/operations/listcommercedisputesrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommercedisputesresponse.md b/lending/docs/pkg/models/operations/listcommercedisputesresponse.md index c0354f0b3..3fe07cad4 100644 --- a/lending/docs/pkg/models/operations/listcommercedisputesresponse.md +++ b/lending/docs/pkg/models/operations/listcommercedisputesresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `CommerceDisputes` | [*shared.CommerceDisputes](../../../pkg/models/shared/commercedisputes.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CommerceDisputes` | [*shared.CommerceDisputes](../../../pkg/models/shared/commercedisputes.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommercelocationsresponse.md b/lending/docs/pkg/models/operations/listcommercelocationsresponse.md index 1a9a153b9..74f08828a 100644 --- a/lending/docs/pkg/models/operations/listcommercelocationsresponse.md +++ b/lending/docs/pkg/models/operations/listcommercelocationsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `CommerceLocations` | [*shared.CommerceLocations](../../../pkg/models/shared/commercelocations.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CommerceLocations` | [*shared.CommerceLocations](../../../pkg/models/shared/commercelocations.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommerceordersrequest.md b/lending/docs/pkg/models/operations/listcommerceordersrequest.md index 83eee9650..e2e72b900 100644 --- a/lending/docs/pkg/models/operations/listcommerceordersrequest.md +++ b/lending/docs/pkg/models/operations/listcommerceordersrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommerceordersresponse.md b/lending/docs/pkg/models/operations/listcommerceordersresponse.md index 808cf7403..fee92c55d 100644 --- a/lending/docs/pkg/models/operations/listcommerceordersresponse.md +++ b/lending/docs/pkg/models/operations/listcommerceordersresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `CommerceOrders` | [*shared.CommerceOrders](../../../pkg/models/shared/commerceorders.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CommerceOrders` | [*shared.CommerceOrders](../../../pkg/models/shared/commerceorders.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommercepaymentmethodsrequest.md b/lending/docs/pkg/models/operations/listcommercepaymentmethodsrequest.md index 1fb19ff4c..f5cae54c6 100644 --- a/lending/docs/pkg/models/operations/listcommercepaymentmethodsrequest.md +++ b/lending/docs/pkg/models/operations/listcommercepaymentmethodsrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommercepaymentmethodsresponse.md b/lending/docs/pkg/models/operations/listcommercepaymentmethodsresponse.md index 975bfa703..7035d20e3 100644 --- a/lending/docs/pkg/models/operations/listcommercepaymentmethodsresponse.md +++ b/lending/docs/pkg/models/operations/listcommercepaymentmethodsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `CommercePaymentMethods` | [*shared.CommercePaymentMethods](../../../pkg/models/shared/commercepaymentmethods.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CommercePaymentMethods` | [*shared.CommercePaymentMethods](../../../pkg/models/shared/commercepaymentmethods.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommercepaymentsrequest.md b/lending/docs/pkg/models/operations/listcommercepaymentsrequest.md index c892270ce..077323e7f 100644 --- a/lending/docs/pkg/models/operations/listcommercepaymentsrequest.md +++ b/lending/docs/pkg/models/operations/listcommercepaymentsrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommercepaymentsresponse.md b/lending/docs/pkg/models/operations/listcommercepaymentsresponse.md index e15d76048..5aea47755 100644 --- a/lending/docs/pkg/models/operations/listcommercepaymentsresponse.md +++ b/lending/docs/pkg/models/operations/listcommercepaymentsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `CommercePayments` | [*shared.CommercePayments](../../../pkg/models/shared/commercepayments.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CommercePayments` | [*shared.CommercePayments](../../../pkg/models/shared/commercepayments.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommerceproductcategoriesrequest.md b/lending/docs/pkg/models/operations/listcommerceproductcategoriesrequest.md index b98290c3d..94b985c4b 100644 --- a/lending/docs/pkg/models/operations/listcommerceproductcategoriesrequest.md +++ b/lending/docs/pkg/models/operations/listcommerceproductcategoriesrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommerceproductcategoriesresponse.md b/lending/docs/pkg/models/operations/listcommerceproductcategoriesresponse.md index b3f85c513..6784dd894 100644 --- a/lending/docs/pkg/models/operations/listcommerceproductcategoriesresponse.md +++ b/lending/docs/pkg/models/operations/listcommerceproductcategoriesresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `CommerceProductCategories` | [*shared.CommerceProductCategories](../../../pkg/models/shared/commerceproductcategories.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CommerceProductCategories` | [*shared.CommerceProductCategories](../../../pkg/models/shared/commerceproductcategories.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommerceproductsrequest.md b/lending/docs/pkg/models/operations/listcommerceproductsrequest.md index c3676b9f2..b7c061521 100644 --- a/lending/docs/pkg/models/operations/listcommerceproductsrequest.md +++ b/lending/docs/pkg/models/operations/listcommerceproductsrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommerceproductsresponse.md b/lending/docs/pkg/models/operations/listcommerceproductsresponse.md index 60ab1231e..3eb05adb7 100644 --- a/lending/docs/pkg/models/operations/listcommerceproductsresponse.md +++ b/lending/docs/pkg/models/operations/listcommerceproductsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `CommerceProducts` | [*shared.CommerceProducts](../../../pkg/models/shared/commerceproducts.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CommerceProducts` | [*shared.CommerceProducts](../../../pkg/models/shared/commerceproducts.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommercetransactionsrequest.md b/lending/docs/pkg/models/operations/listcommercetransactionsrequest.md index ab99497ef..98db247e4 100644 --- a/lending/docs/pkg/models/operations/listcommercetransactionsrequest.md +++ b/lending/docs/pkg/models/operations/listcommercetransactionsrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcommercetransactionsresponse.md b/lending/docs/pkg/models/operations/listcommercetransactionsresponse.md index cddd9b9c5..ae0b228a4 100644 --- a/lending/docs/pkg/models/operations/listcommercetransactionsresponse.md +++ b/lending/docs/pkg/models/operations/listcommercetransactionsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `CommerceTransactions` | [*shared.CommerceTransactions](../../../pkg/models/shared/commercetransactions.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CommerceTransactions` | [*shared.CommerceTransactions](../../../pkg/models/shared/commercetransactions.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcompaniesrequest.md b/lending/docs/pkg/models/operations/listcompaniesrequest.md index ee176cc37..cccb983e3 100644 --- a/lending/docs/pkg/models/operations/listcompaniesrequest.md +++ b/lending/docs/pkg/models/operations/listcompaniesrequest.md @@ -8,4 +8,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcompaniesresponse.md b/lending/docs/pkg/models/operations/listcompaniesresponse.md index 41065cae0..5131f71f8 100644 --- a/lending/docs/pkg/models/operations/listcompaniesresponse.md +++ b/lending/docs/pkg/models/operations/listcompaniesresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `Companies` | [*shared.Companies](../../../pkg/models/shared/companies.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Companies` | [*shared.Companies](../../../pkg/models/shared/companies.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listconnectionsrequest.md b/lending/docs/pkg/models/operations/listconnectionsrequest.md index df5ebd3fc..c28099519 100644 --- a/lending/docs/pkg/models/operations/listconnectionsrequest.md +++ b/lending/docs/pkg/models/operations/listconnectionsrequest.md @@ -9,4 +9,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listconnectionsresponse.md b/lending/docs/pkg/models/operations/listconnectionsresponse.md index 27c58c5a4..44339a983 100644 --- a/lending/docs/pkg/models/operations/listconnectionsresponse.md +++ b/lending/docs/pkg/models/operations/listconnectionsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `Connections` | [*shared.Connections](../../../pkg/models/shared/connections.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Connections` | [*shared.Connections](../../../pkg/models/shared/connections.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcreateoperationsrequest.md b/lending/docs/pkg/models/operations/listcreateoperationsrequest.md index 4033b2bfc..d4736406c 100644 --- a/lending/docs/pkg/models/operations/listcreateoperationsrequest.md +++ b/lending/docs/pkg/models/operations/listcreateoperationsrequest.md @@ -9,4 +9,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listcreateoperationsresponse.md b/lending/docs/pkg/models/operations/listcreateoperationsresponse.md index 629baf02c..2746fc4f0 100644 --- a/lending/docs/pkg/models/operations/listcreateoperationsresponse.md +++ b/lending/docs/pkg/models/operations/listcreateoperationsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `PushOperations` | [*shared.PushOperations](../../../pkg/models/shared/pushoperations.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `PushOperations` | [*shared.PushOperations](../../../pkg/models/shared/pushoperations.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listdataintegritydetailsrequest.md b/lending/docs/pkg/models/operations/listdataintegritydetailsrequest.md index 9e7426580..442200288 100644 --- a/lending/docs/pkg/models/operations/listdataintegritydetailsrequest.md +++ b/lending/docs/pkg/models/operations/listdataintegritydetailsrequest.md @@ -10,4 +10,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listdataintegritydetailsresponse.md b/lending/docs/pkg/models/operations/listdataintegritydetailsresponse.md index afaa1d0f6..2bbc61c7a 100644 --- a/lending/docs/pkg/models/operations/listdataintegritydetailsresponse.md +++ b/lending/docs/pkg/models/operations/listdataintegritydetailsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `DataIntegrityDetails` | [*shared.DataIntegrityDetails](../../../pkg/models/shared/dataintegritydetails.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `DataIntegrityDetails` | [*shared.DataIntegrityDetails](../../../pkg/models/shared/dataintegritydetails.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listloantransactionsresponse.md b/lending/docs/pkg/models/operations/listloantransactionsresponse.md index 617a71071..d98f8cf4a 100644 --- a/lending/docs/pkg/models/operations/listloantransactionsresponse.md +++ b/lending/docs/pkg/models/operations/listloantransactionsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `LoanTransactions` | [*shared.LoanTransactions](../../../pkg/models/shared/loantransactions.md) | :heavy_minus_sign: | OK | {"reportInfo":{"pageNumber":1,"pageSize":1000,"totalResults":1,"reportName":"AccountingLoanTransactions","companyName":"Supermarket store","generatedDate":"2022-10-23T00:00:00Z"},"reportItems":[{"loanRef":{"id":"332","dataConnectionId":"ecd2d6be-5194-40a1-838f-5577a4881aaa","type":"chartOfAccount"},"itemRef":{"id":"755488","dataConnectionId":"ecd2d6be-5194-40a1-838f-5577a4881aaa","type":"journalEntry"},"date":"2020-08-02","amount":-455,"transactionType":"Repayment","lenderName":"Barclays Bank"}]} | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `LoanTransactions` | [*shared.LoanTransactions](../../../pkg/models/shared/loantransactions.md) | :heavy_minus_sign: | OK | {
"reportInfo": {
"pageNumber": 1,
"pageSize": 1000,
"totalResults": 1,
"reportName": "AccountingLoanTransactions",
"companyName": "Supermarket store",
"generatedDate": "2022-10-23T00:00:00Z"
},
"reportItems": [
{
"loanRef": {
"id": "332",
"dataConnectionId": "ecd2d6be-5194-40a1-838f-5577a4881aaa",
"type": "chartOfAccount"
},
"itemRef": {
"id": "755488",
"dataConnectionId": "ecd2d6be-5194-40a1-838f-5577a4881aaa",
"type": "journalEntry"
},
"date": "2020-08-02",
"amount": -455,
"transactionType": "Repayment",
"lender": "Barclays Bank"
}
]
} | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listpulloperationsrequest.md b/lending/docs/pkg/models/operations/listpulloperationsrequest.md index 6c5f80bfc..bfea8f9b6 100644 --- a/lending/docs/pkg/models/operations/listpulloperationsrequest.md +++ b/lending/docs/pkg/models/operations/listpulloperationsrequest.md @@ -9,4 +9,4 @@ | `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listpulloperationsresponse.md b/lending/docs/pkg/models/operations/listpulloperationsresponse.md index 92e76c190..0aceb5994 100644 --- a/lending/docs/pkg/models/operations/listpulloperationsresponse.md +++ b/lending/docs/pkg/models/operations/listpulloperationsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `PullOperations` | [*shared.PullOperations](../../../pkg/models/shared/pulloperations.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `PullOperations` | [*shared.PullOperations](../../../pkg/models/shared/pulloperations.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/listreconciledinvoicesrequest.md b/lending/docs/pkg/models/operations/listreconciledinvoicesrequest.md index 9a0780f69..f517e6d52 100644 --- a/lending/docs/pkg/models/operations/listreconciledinvoicesrequest.md +++ b/lending/docs/pkg/models/operations/listreconciledinvoicesrequest.md @@ -8,4 +8,4 @@ | `CompanyID` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/option.md b/lending/docs/pkg/models/operations/option.md index 9167702bf..35d8a1e2a 100644 --- a/lending/docs/pkg/models/operations/option.md +++ b/lending/docs/pkg/models/operations/option.md @@ -24,9 +24,9 @@ operations.WithTemplatedServerURL("http://{host}:{port}", map[string]string{ WithRetries allows customizing the default retry configuration. Only usable with methods that mention they support retries. ```go -operations.WithRetries(utils.RetryConfig{ +operations.WithRetries(retry.Config{ Strategy: "backoff", - Backoff: utils.BackoffStrategy{ + Backoff: retry.BackoffStrategy{ InitialInterval: 500 * time.Millisecond, MaxInterval: 60 * time.Second, Exponent: 1.5, diff --git a/lending/docs/pkg/models/operations/refreshdatatyperequest.md b/lending/docs/pkg/models/operations/refreshdatatyperequest.md index beaf79aa9..317f82d1c 100644 --- a/lending/docs/pkg/models/operations/refreshdatatyperequest.md +++ b/lending/docs/pkg/models/operations/refreshdatatyperequest.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `CompanyID` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `ConnectionID` | **string* | :heavy_minus_sign: | Optionally, provide a data connection id to only queue pull operations on that connection. | | -| `DataType` | [shared.SchemaDataType](../../../pkg/models/shared/schemadatatype.md) | :heavy_check_mark: | The key of a Codat data type | invoices | \ No newline at end of file +| `DataType` | [shared.SchemaDataType](../../../pkg/models/shared/schemadatatype.md) | :heavy_check_mark: | A key for a Codat data type. | invoices | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/refreshdatatyperesponse.md b/lending/docs/pkg/models/operations/refreshdatatyperesponse.md index 8072edeee..baddccc06 100644 --- a/lending/docs/pkg/models/operations/refreshdatatyperesponse.md +++ b/lending/docs/pkg/models/operations/refreshdatatyperesponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `PullOperation` | [*shared.PullOperation](../../../pkg/models/shared/pulloperation.md) | :heavy_minus_sign: | OK | {"id":"97d60846-f07a-4d42-b5a0-0bdcc6ebf56b","companyId":"4645bd78-8988-45bc-ac9e-67ba5df6e4e5","connectionId":"51baa045-4836-4317-a42e-3542e991e581","dataType":"invoices","status":"Initial","statusDescription":"Paused until 2022-10-23T00:00:00.000Z","requested":"2022-11-14T11:18:37.2798351Z","progress":10,"isCompleted":false,"isErrored":false} | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `PullOperation` | [*shared.PullOperation](../../../pkg/models/shared/pulloperation.md) | :heavy_minus_sign: | OK | {
"id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b",
"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5",
"connectionId": "51baa045-4836-4317-a42e-3542e991e581",
"dataType": "invoices",
"status": "Initial",
"statusDescription": "Paused until 2022-10-23T00:00:00.000Z",
"requested": "2022-11-14T11:18:37.2798351Z",
"progress": 10,
"isCompleted": false,
"isErrored": false
} | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/setbankstatementuploadconfigurationrequest.md b/lending/docs/pkg/models/operations/setbankstatementuploadconfigurationrequest.md new file mode 100644 index 000000000..86c8d7e35 --- /dev/null +++ b/lending/docs/pkg/models/operations/setbankstatementuploadconfigurationrequest.md @@ -0,0 +1,10 @@ +# SetBankStatementUploadConfigurationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `BankStatementUploadConfiguration` | [*shared.BankStatementUploadConfiguration](../../../pkg/models/shared/bankstatementuploadconfiguration.md) | :heavy_minus_sign: | N/A | | +| `CompanyID` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/setbankstatementuploadconfigurationresponse.md b/lending/docs/pkg/models/operations/setbankstatementuploadconfigurationresponse.md new file mode 100644 index 000000000..3e57e9bac --- /dev/null +++ b/lending/docs/pkg/models/operations/setbankstatementuploadconfigurationresponse.md @@ -0,0 +1,11 @@ +# SetBankStatementUploadConfigurationResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `BankStatementUploadConfiguration` | [*shared.BankStatementUploadConfiguration](../../../pkg/models/shared/bankstatementuploadconfiguration.md) | :heavy_minus_sign: | Success | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/startbankstatementuploadsessionrequest.md b/lending/docs/pkg/models/operations/startbankstatementuploadsessionrequest.md new file mode 100644 index 000000000..22e90fadf --- /dev/null +++ b/lending/docs/pkg/models/operations/startbankstatementuploadsessionrequest.md @@ -0,0 +1,10 @@ +# StartBankStatementUploadSessionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `StartUploadSessionRequest` | [*shared.StartUploadSessionRequest](../../../pkg/models/shared/startuploadsessionrequest.md) | :heavy_minus_sign: | N/A | | +| `CompanyID` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/startbankstatementuploadsessionresponse.md b/lending/docs/pkg/models/operations/startbankstatementuploadsessionresponse.md new file mode 100644 index 000000000..3993a8430 --- /dev/null +++ b/lending/docs/pkg/models/operations/startbankstatementuploadsessionresponse.md @@ -0,0 +1,11 @@ +# StartBankStatementUploadSessionResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `PullOperation` | [*shared.PullOperation](../../../pkg/models/shared/pulloperation.md) | :heavy_minus_sign: | Success | {
"id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b",
"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5",
"connectionId": "51baa045-4836-4317-a42e-3542e991e581",
"dataType": "invoices",
"status": "Initial",
"statusDescription": "Paused until 2022-10-23T00:00:00.000Z",
"requested": "2022-11-14T11:18:37.2798351Z",
"progress": 10,
"isCompleted": false,
"isErrored": false
} | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/unlinkconnectionresponse.md b/lending/docs/pkg/models/operations/unlinkconnectionresponse.md index cc9abe4fb..e407eadee 100644 --- a/lending/docs/pkg/models/operations/unlinkconnectionresponse.md +++ b/lending/docs/pkg/models/operations/unlinkconnectionresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Connection` | [*shared.Connection](../../../pkg/models/shared/connection.md) | :heavy_minus_sign: | OK | {"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Connection` | [*shared.Connection](../../../pkg/models/shared/connection.md) | :heavy_minus_sign: | OK | {
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/updatecompanyresponse.md b/lending/docs/pkg/models/operations/updatecompanyresponse.md index 39e3766ff..30b2e9856 100644 --- a/lending/docs/pkg/models/operations/updatecompanyresponse.md +++ b/lending/docs/pkg/models/operations/updatecompanyresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Company` | [*shared.Company](../../../pkg/models/shared/company.md) | :heavy_minus_sign: | OK | {"id":"0498e921-9b53-4396-a412-4f2f5983b0a2","name":"string","platform":"string","redirect":"https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739","lastSync":"2022-01-01T12:00:00.000Z","created":"2022-01-01T12:00:00.000Z","createdByUserName":"string","dataConnections":[{"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"}],"groups":[{"id":"d7a6c4b4-dc87-45f6-b803-62f466398680"}]} | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Company` | [*shared.Company](../../../pkg/models/shared/company.md) | :heavy_minus_sign: | OK | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739",
"lastSync": "2022-01-01T12:00:00.000Z",
"created": "2022-01-01T12:00:00.000Z",
"createdByUserName": "string",
"tags": {
"region": "us",
"uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"
},
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
]
} | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/uploadbankstatementdatarequest.md b/lending/docs/pkg/models/operations/uploadbankstatementdatarequest.md new file mode 100644 index 000000000..8509f36e0 --- /dev/null +++ b/lending/docs/pkg/models/operations/uploadbankstatementdatarequest.md @@ -0,0 +1,12 @@ +# UploadBankStatementDataRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `RequestBody` | [operations.UploadBankStatementDataRequestBody](../../../pkg/models/operations/uploadbankstatementdatarequestbody.md) | :heavy_check_mark: | N/A | | +| `CompanyID` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `DatasetID` | *string* | :heavy_check_mark: | Unique identifier for the dataset that completed its sync. | | +| `Path` | [*shared.Path](../../../pkg/models/shared/path.md) | :heavy_minus_sign: | The endpoint path of the third-party banking service that the request body originates from. Only required if the source is not `codat`. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/operations/uploadbankstatementdatarequestbody.md b/lending/docs/pkg/models/operations/uploadbankstatementdatarequestbody.md new file mode 100644 index 000000000..2702f7766 --- /dev/null +++ b/lending/docs/pkg/models/operations/uploadbankstatementdatarequestbody.md @@ -0,0 +1,23 @@ +# UploadBankStatementDataRequestBody + + +## Supported Types + +### BankingAccount + +```go +uploadBankStatementDataRequestBody := operations.CreateUploadBankStatementDataRequestBodyBankingAccount(shared.BankingAccount{/* values here */}) +``` + +### BankingTransactions + +```go +uploadBankStatementDataRequestBody := operations.CreateUploadBankStatementDataRequestBodyBankingTransactions(shared.BankingTransactions{/* values here */}) +``` + +### + +```go +uploadBankStatementDataRequestBody := operations.CreateUploadBankStatementDataRequestBodyAny(any{/* values here */}) +``` + diff --git a/lending/docs/pkg/models/operations/uploadbankstatementdataresponse.md b/lending/docs/pkg/models/operations/uploadbankstatementdataresponse.md new file mode 100644 index 000000000..28299e8df --- /dev/null +++ b/lending/docs/pkg/models/operations/uploadbankstatementdataresponse.md @@ -0,0 +1,10 @@ +# UploadBankStatementDataResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountbalance.md b/lending/docs/pkg/models/shared/accountbalance.md index afe626e0e..349ac0510 100644 --- a/lending/docs/pkg/models/shared/accountbalance.md +++ b/lending/docs/pkg/models/shared/accountbalance.md @@ -8,4 +8,4 @@ | `Available` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The account's current balance | | | `Currency` | **string* | :heavy_minus_sign: | The currency of the account | GBP | | `Pending` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Funds that are not yet available in the balance | | -| `Reserved` | *interface{}* | :heavy_minus_sign: | Funds reserved as holdings | | \ No newline at end of file +| `Reserved` | *any* | :heavy_minus_sign: | Funds reserved as holdings | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountcategoriesupdatedwebhook.md b/lending/docs/pkg/models/shared/accountcategoriesupdatedwebhook.md index 5f2c39e5d..74024e68d 100644 --- a/lending/docs/pkg/models/shared/accountcategoriesupdatedwebhook.md +++ b/lending/docs/pkg/models/shared/accountcategoriesupdatedwebhook.md @@ -1,18 +1,18 @@ # AccountCategoriesUpdatedWebhook -Webhook request body for account categories updated. +Webhook request body for the "Account categories updated" event. ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `AlertID` | **string* | :heavy_minus_sign: | Unique identifier of the webhook event. | | -| `ClientID` | **string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | | -| `ClientName` | **string* | :heavy_minus_sign: | Name of your client in Codat. | | -| `CompanyID` | **string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `Data` | [*shared.AccountCategoriesUpdatedWebhookData](../../../pkg/models/shared/accountcategoriesupdatedwebhookdata.md) | :heavy_minus_sign: | N/A | | -| `DataConnectionID` | **string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `Message` | **string* | :heavy_minus_sign: | A human readable message about the webhook. | | -| `RuleID` | **string* | :heavy_minus_sign: | Unique identifier for the rule. | | -| `RuleType` | **string* | :heavy_minus_sign: | The type of rule. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AlertID` | **string* | :heavy_minus_sign: | Unique identifier of the webhook event. | | +| `ClientID` | **string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | | +| `ClientName` | **string* | :heavy_minus_sign: | Name of your client in Codat. | | +| `CompanyID` | **string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `Data` | [*shared.AccountCategoriesUpdatedWebhookData](../../../pkg/models/shared/accountcategoriesupdatedwebhookdata.md) | :heavy_minus_sign: | N/A | | +| `DataConnectionID` | **string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `Message` | **string* | :heavy_minus_sign: | A human-readable message about the webhook. | | +| ~~`RuleID`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | | +| `RuleType` | **string* | :heavy_minus_sign: | The type of rule. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountcategoriesupdatedwebhookdata.md b/lending/docs/pkg/models/shared/accountcategoriesupdatedwebhookdata.md index fcdc421d7..efb769103 100644 --- a/lending/docs/pkg/models/shared/accountcategoriesupdatedwebhookdata.md +++ b/lending/docs/pkg/models/shared/accountcategoriesupdatedwebhookdata.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `ModifiedDate` | **string* | :heavy_minus_sign: | The date on which this account categories were last modified in Codat. | 2022-10-23 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `ModifiedDate` | **string* | :heavy_minus_sign: | The date on which the company's account categories were last modified in Codat. | 2022-10-23 | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingaccount.md b/lending/docs/pkg/models/shared/accountingaccount.md index b57708e32..b6ed2e0fa 100644 --- a/lending/docs/pkg/models/shared/accountingaccount.md +++ b/lending/docs/pkg/models/shared/accountingaccount.md @@ -47,6 +47,6 @@ To determine the list of allowed categories for a specific integration, you can: | `NominalCode` | **string* | :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 | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | | `Status` | [*shared.AccountStatus](../../../pkg/models/shared/accountstatus.md) | :heavy_minus_sign: | Status of the account | Active | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `Type` | [*shared.AccountType](../../../pkg/models/shared/accounttype.md) | :heavy_minus_sign: | Type of account | Asset | | `ValidDatatypeLinks` | [][shared.AccountingAccountValidDataTypeLinks](../../../pkg/models/shared/accountingaccountvaliddatatypelinks.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](/lending-api#/schemas/ValidDataTypeLinks). | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingaccounts.md b/lending/docs/pkg/models/shared/accountingaccounts.md index a494d7304..8fd8e70f3 100644 --- a/lending/docs/pkg/models/shared/accountingaccounts.md +++ b/lending/docs/pkg/models/shared/accountingaccounts.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingAccount](../../../pkg/models/shared/accountingaccount.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingAccount](../../../pkg/models/shared/accountingaccount.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingaccounttransaction.md b/lending/docs/pkg/models/shared/accountingaccounttransaction.md index 7cf370930..1f07996fb 100644 --- a/lending/docs/pkg/models/shared/accountingaccounttransaction.md +++ b/lending/docs/pkg/models/shared/accountingaccounttransaction.md @@ -1,12 +1,12 @@ # AccountingAccountTransaction -> **Language tip:** In Codat, account transactions represent all transactions posted to a bank account within an accounting platform. For bank transactions posted within a banking platform, refer to [Banking transactions](https://docs.codat.io/lending-api#/operations/list-all-banking-transactions). +> **Language tip:** In Codat, account transactions represent all transactions posted to a bank account within an accounting software. For bank transactions posted within a banking platform, refer to [Banking transactions](https://docs.codat.io/lending-api#/operations/list-all-banking-transactions). > View the coverage for account transactions in the Data coverage explorer. ## Overview -In Codat’s data model, account transactions represent bank activity within an accounting platform. All transactions that go through a bank account are recorded as account transactions. +In Codat’s data model, account transactions represent bank activity within an accounting software. All transactions that go through a bank account are recorded as account transactions. Account transactions are created as a result of different business activities, for example: @@ -21,18 +21,18 @@ Account transactions is the parent data type of [payments](https://docs.codat.io ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `BankAccountRef` | [*shared.BankAccountRef](../../../pkg/models/shared/bankaccountref.md) | :heavy_minus_sign: | Links to the Account transactions data type. | | -| `Currency` | **string* | :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 | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | -| `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `ID` | **string* | :heavy_minus_sign: | Identifier of the direct cost (unique to the company). | | -| `Lines` | [][shared.AccountTransactionLine](../../../pkg/models/shared/accounttransactionline.md) | :heavy_minus_sign: | Array of account transaction lines. | | -| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Note` | **string* | :heavy_minus_sign: | Additional information about the account transaction, if available. | | -| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Status` | [*shared.Status](../../../pkg/models/shared/status.md) | :heavy_minus_sign: | The status of the account transaction. | | -| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of the account transactions, inclusive of tax. | | -| `TransactionID` | **string* | :heavy_minus_sign: | Identifier of the transaction (unique to the company). | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `BankAccountRef` | [*shared.BankAccountRef](../../../pkg/models/shared/bankaccountref.md) | :heavy_minus_sign: | Links to the Account transactions data type. | | +| `Currency` | **string* | :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 | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `ID` | **string* | :heavy_minus_sign: | Identifier of the direct cost (unique to the company). | | +| `Lines` | [][shared.AccountTransactionLine](../../../pkg/models/shared/accounttransactionline.md) | :heavy_minus_sign: | Array of account transaction lines. | | +| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `Note` | **string* | :heavy_minus_sign: | Additional information about the account transaction, if available. | | +| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `Status` | [*shared.AccountingAccountTransactionStatus](../../../pkg/models/shared/accountingaccounttransactionstatus.md) | :heavy_minus_sign: | The status of the account transaction. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of the account transactions, inclusive of tax. | | +| `TransactionID` | **string* | :heavy_minus_sign: | Identifier of the transaction (unique to the company). | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingaccounttransactions.md b/lending/docs/pkg/models/shared/accountingaccounttransactions.md index 92ef04241..89217df7b 100644 --- a/lending/docs/pkg/models/shared/accountingaccounttransactions.md +++ b/lending/docs/pkg/models/shared/accountingaccounttransactions.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingAccountTransaction](../../../pkg/models/shared/accountingaccounttransaction.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingAccountTransaction](../../../pkg/models/shared/accountingaccounttransaction.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingaccounttransactionstatus.md b/lending/docs/pkg/models/shared/accountingaccounttransactionstatus.md new file mode 100644 index 000000000..35edd44d4 --- /dev/null +++ b/lending/docs/pkg/models/shared/accountingaccounttransactionstatus.md @@ -0,0 +1,13 @@ +# AccountingAccountTransactionStatus + +The status of the account transaction. + + +## Values + +| Name | Value | +| ------------------------------------------------ | ------------------------------------------------ | +| `AccountingAccountTransactionStatusUnknown` | Unknown | +| `AccountingAccountTransactionStatusUnreconciled` | Unreconciled | +| `AccountingAccountTransactionStatusReconciled` | Reconciled | +| `AccountingAccountTransactionStatusVoid` | Void | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingagedcreditorreport.md b/lending/docs/pkg/models/shared/accountingagedcreditorreport.md index 38b607896..fed2393eb 100644 --- a/lending/docs/pkg/models/shared/accountingagedcreditorreport.md +++ b/lending/docs/pkg/models/shared/accountingagedcreditorreport.md @@ -2,7 +2,7 @@ The Aged Creditors report shows the total balance owed by a business to its suppliers over time. -You can generate it for a company based on recently synced data from your customers' accounting platforms. The report is available in the **Reports** tab in the Codat portal. +You can generate it for a company based on recently synced data from your customers' accounting software. The report is available in the **Reports** tab in the Codat portal. Total assets or liabilities are grouped into 30-day periods for each supplier, up to the current date. You can adjust the report date, period length, and number of periods to show on each report. The data can be grouped by customer or currency. diff --git a/lending/docs/pkg/models/shared/accountingageddebtorreport.md b/lending/docs/pkg/models/shared/accountingageddebtorreport.md index 0c7d9ea41..6cde4cb24 100644 --- a/lending/docs/pkg/models/shared/accountingageddebtorreport.md +++ b/lending/docs/pkg/models/shared/accountingageddebtorreport.md @@ -2,7 +2,7 @@ The Aged Debtors report shows the total outstanding balance due from customers to the business over time. -You can generate it for a company based on recently synced data from your customers' accounting platforms. The report is available in the **Reports** tab in the Codat portal. +You can generate it for a company based on recently synced data from your customers' accounting software. The report is available in the **Reports** tab in the Codat portal. Total assets or liabilities are grouped into 30-day periods for each customer, up to the current date. You can adjust the report date, period length, and number of periods to show on each report. The data can be grouped by customer or currency. diff --git a/lending/docs/pkg/models/shared/accountingattachment.md b/lending/docs/pkg/models/shared/accountingattachment.md index 4778aeed7..079fe787c 100644 --- a/lending/docs/pkg/models/shared/accountingattachment.md +++ b/lending/docs/pkg/models/shared/accountingattachment.md @@ -28,8 +28,8 @@ View the coverage for each integration in the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `FileSize` | **int* | :heavy_minus_sign: | File size in bytes. For example, if this reads **46153**, then the file size is 46kb. | | -| `ID` | **string* | :heavy_minus_sign: | Identifier for the attachment, unique for the company in the accounting platform. | | -| `IncludeWhenSent` | **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. | | +| `ID` | **string* | :heavy_minus_sign: | Identifier for the attachment, unique for the company in the accounting software. | | +| `IncludeWhenSent` | **bool* | :heavy_minus_sign: | If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. | | | `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | | `Name` | **string* | :heavy_minus_sign: | Name of the attachment file. | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingbalancesheet.md b/lending/docs/pkg/models/shared/accountingbalancesheet.md index 0a09fcb2b..eb1e82a56 100644 --- a/lending/docs/pkg/models/shared/accountingbalancesheet.md +++ b/lending/docs/pkg/models/shared/accountingbalancesheet.md @@ -11,13 +11,13 @@ The balance sheet is a snapshot of a company's accounts at a single point in tim > A profit and loss report summarises the total revenue, expenses, and profit or loss during a specified time period. A balance sheet report shows the financial position of a company at a specific moment in time. **Structure of this report** -This report will reflect the structure and line descriptions that the business has set in their own accounting platform. +This report will reflect the structure and line descriptions that the business has set in their own accounting software. **History** By default, Codat pulls (up to) 24 months of balance sheets for a company. You can adjust this to fetch more history, where available, by updating the `monthsToSync` value for `balanceSheet` on the [data type settings endpoint](https://docs.codat.io/lending-api#/operations/update-sync-settings). **Want to pull this in a standardised structure?** -Our [Enhanced Financials](https://docs.codat.io/assess/enhanced-financials/overview) endpoints provide the same report under standardized headings, allowing you to pull it in the same format for all of your business customers. +Our [Enhanced Financials](https://docs.codat.io/lending/features/financial-statements-overview) endpoints provide the same report under standardized headings, allowing you to pull it in the same format for all of your business customers. ## Fields diff --git a/lending/docs/pkg/models/shared/accountingbankaccount.md b/lending/docs/pkg/models/shared/accountingbankaccount.md index 5b0cfd0cf..fefc1ede2 100644 --- a/lending/docs/pkg/models/shared/accountingbankaccount.md +++ b/lending/docs/pkg/models/shared/accountingbankaccount.md @@ -13,7 +13,7 @@ A list of bank accounts associated with a company and a specific data connection. Bank accounts data includes: -* The name and ID of the account in the accounting platform. +* The name and ID of the account in the accounting software. * The currency and balance of the account. * The sort code and account number. @@ -22,14 +22,14 @@ Bank accounts data includes: | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AccountName` | **string* | :heavy_minus_sign: | Name of the bank account in the accounting platform. | | +| `AccountName` | **string* | :heavy_minus_sign: | Name of the bank account in the accounting software. | | | `AccountNumber` | **string* | :heavy_minus_sign: | Account number for the bank account.

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

FreeAgent integrations
For Credit accounts, only the last four digits are required. For other types, the field is optional. | | | `AccountType` | [*shared.AccountingBankAccountType](../../../pkg/models/shared/accountingbankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | | `AvailableBalance` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. | | | `Balance` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Balance of the bank account. | | | `Currency` | **string* | :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 | | `IBan` | **string* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | | -| `ID` | **string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting platform. | | +| `ID` | **string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting software. | | | `Institution` | **string* | :heavy_minus_sign: | The institution of the bank account. | | | `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | @@ -37,4 +37,5 @@ Bank accounts data includes: | `OverdraftLimit` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Pre-arranged overdraft limit of the account.

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

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | \ No newline at end of file +| `Status` | [*shared.BankAccountStatus](../../../pkg/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | Status of the bank account. | Active | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingbankaccounts.md b/lending/docs/pkg/models/shared/accountingbankaccounts.md index c0e5a2fd7..f1dca0d56 100644 --- a/lending/docs/pkg/models/shared/accountingbankaccounts.md +++ b/lending/docs/pkg/models/shared/accountingbankaccounts.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingBankAccount](../../../pkg/models/shared/accountingbankaccount.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingBankAccount](../../../pkg/models/shared/accountingbankaccount.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingbanktransaction.md b/lending/docs/pkg/models/shared/accountingbanktransaction.md index fd075c386..3f9e96af9 100644 --- a/lending/docs/pkg/models/shared/accountingbanktransaction.md +++ b/lending/docs/pkg/models/shared/accountingbanktransaction.md @@ -27,8 +27,8 @@ Bank transactions include the: | `Balance` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The remaining balance in the account with ID `accountId`. | | | `ClearedOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `Description` | **string* | :heavy_minus_sign: | Description of the bank transaction. | | -| `ID` | **string* | :heavy_minus_sign: | Identifier for the bank transaction, unique to the company in the accounting platform. | | +| `ID` | **string* | :heavy_minus_sign: | Identifier for the bank transaction, unique to the company in the accounting software. | | | `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Reconciled` | **bool* | :heavy_minus_sign: | `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting platform. | | +| `Reconciled` | **bool* | :heavy_minus_sign: | `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting software. | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | | `TransactionType` | [*shared.BankTransactionType](../../../pkg/models/shared/banktransactiontype.md) | :heavy_minus_sign: | Type of transaction for the bank statement line. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingbanktransactions.md b/lending/docs/pkg/models/shared/accountingbanktransactions.md index 102d1cde3..b74d4503f 100644 --- a/lending/docs/pkg/models/shared/accountingbanktransactions.md +++ b/lending/docs/pkg/models/shared/accountingbanktransactions.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingBankTransaction](../../../pkg/models/shared/accountingbanktransaction.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingBankTransaction](../../../pkg/models/shared/accountingbanktransaction.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingbill.md b/lending/docs/pkg/models/shared/accountingbill.md index 78f42f211..84b4cc0d0 100644 --- a/lending/docs/pkg/models/shared/accountingbill.md +++ b/lending/docs/pkg/models/shared/accountingbill.md @@ -16,33 +16,33 @@ In Codat, a bill contains details of: * 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*. +Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's *expenses*. You can find these types of transactions in our [Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) data model. ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AmountDue` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount outstanding on the bill. | | -| `Currency` | **string* | :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 | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | -| `DueDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `ID` | **string* | :heavy_minus_sign: | Identifier for the bill, unique for the company in the accounting platform. | | -| `IssueDate` | *string* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `LineItems` | [][shared.BillLineItem](../../../pkg/models/shared/billlineitem.md) | :heavy_minus_sign: | Array of Bill line items. | | -| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Note` | **string* | :heavy_minus_sign: | Any private, company notes about the bill, such as payment information. | | -| `PaymentAllocations` | [][shared.AccountingPaymentAllocation](../../../pkg/models/shared/accountingpaymentallocation.md) | :heavy_minus_sign: | An array of payment allocations. | | -| `PurchaseOrderRefs` | [][shared.PurchaseOrderReference](../../../pkg/models/shared/purchaseorderreference.md) | :heavy_minus_sign: | N/A | | -| `Reference` | **string* | :heavy_minus_sign: | User-friendly reference for the bill. | | -| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Status` | [shared.BillStatus](../../../pkg/models/shared/billstatus.md) | :heavy_check_mark: | Current state of the bill. | | -| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Total amount of the bill, excluding any taxes. | | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | -| `SupplierRef` | [*shared.SupplierRef](../../../pkg/models/shared/supplierref.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | -| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of tax on the bill. | | -| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of the bill, including tax. | | -| `WithholdingTax` | [][shared.WithholdingTax](../../../pkg/models/shared/withholdingtax.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AmountDue` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount outstanding on the bill. | | +| `Currency` | **string* | :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 | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `DueDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `ID` | **string* | :heavy_minus_sign: | Identifier for the bill, unique for the company in the accounting software. | | +| `IssueDate` | *string* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `LineItems` | [][shared.BillLineItem](../../../pkg/models/shared/billlineitem.md) | :heavy_minus_sign: | Array of Bill line items. | | +| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `Note` | **string* | :heavy_minus_sign: | Any private, company notes about the bill, such as payment information. | | +| `PaymentAllocations` | [][shared.AccountingPaymentAllocation](../../../pkg/models/shared/accountingpaymentallocation.md) | :heavy_minus_sign: | An array of payment allocations. | | +| `PurchaseOrderRefs` | [][shared.PurchaseOrderReference](../../../pkg/models/shared/purchaseorderreference.md) | :heavy_minus_sign: | N/A | | +| `Reference` | **string* | :heavy_minus_sign: | User-friendly reference for the bill. | | +| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `Status` | [shared.BillStatus](../../../pkg/models/shared/billstatus.md) | :heavy_check_mark: | Current state of the bill. | | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Total amount of the bill, excluding any taxes. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `SupplierRef` | [*shared.SupplierRef](../../../pkg/models/shared/supplierref.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | +| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of tax on the bill. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of the bill, including tax. | | +| `WithholdingTax` | [][shared.WithholdingTax](../../../pkg/models/shared/withholdingtax.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingbillcreditnote.md b/lending/docs/pkg/models/shared/accountingbillcreditnote.md index d18ae9707..ca3702384 100644 --- a/lending/docs/pkg/models/shared/accountingbillcreditnote.md +++ b/lending/docs/pkg/models/shared/accountingbillcreditnote.md @@ -20,27 +20,28 @@ A bill credit note includes details of: ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AllocatedOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `BillCreditNoteNumber` | **string* | :heavy_minus_sign: | Friendly reference for the bill credit note. | 91fe2a83-e161-4c21-929d-c5c10c4b07e5 | -| `Currency` | **string* | :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 | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | -| `DiscountPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Percentage rate of any discount applied to the bill credit note. | 0 | -| `ID` | **string* | :heavy_minus_sign: | Identifier for the bill credit note that is unique to a company in the accounting platform. | 1509398f-98e2-436d-8a5d-c042e0c74ffc | -| `IssueDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `LineItems` | [][shared.BillCreditNoteLineItem](../../../pkg/models/shared/billcreditnotelineitem.md) | :heavy_minus_sign: | An array of line | | -| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Note` | **string* | :heavy_minus_sign: | Any additional information about the bill credit note. | Bill Credit Note with 1 line items, totaling 805.78 | -| `PaymentAllocations` | [][shared.AccountingPaymentAllocation](../../../pkg/models/shared/accountingpaymentallocation.md) | :heavy_minus_sign: | An array of payment allocations. | | -| `RemainingCredit` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of the bill credit note that is still outstanding. | 0 | -| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Status` | [shared.BillCreditNoteStatus](../../../pkg/models/shared/billcreditnotestatus.md) | :heavy_check_mark: | Current state of the bill credit note | Paid | -| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Total amount of the bill credit note, including discounts but excluding tax. | 805.78 | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | -| `SupplierRef` | [*shared.SupplierRef](../../../pkg/models/shared/supplierref.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | -| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax. | 805.78 | -| `TotalDiscount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Total value of any discounts applied. | 0 | -| `TotalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of tax included in the bill credit note. | 0 | -| `WithholdingTax` | [][shared.WithholdingTaxItems](../../../pkg/models/shared/withholdingtaxitems.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllocatedOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `BillCreditNoteNumber` | **string* | :heavy_minus_sign: | Friendly reference for the bill credit note. | 91fe2a83-e161-4c21-929d-c5c10c4b07e5 | +| `CreatedFromRefs` | [][shared.RecordRef](../../../pkg/models/shared/recordref.md) | :heavy_minus_sign: | An array of records the credit note was created from. | | +| `Currency` | **string* | :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 | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `DiscountPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Percentage rate of any discount applied to the bill credit note. | 0 | +| `ID` | **string* | :heavy_minus_sign: | Identifier for the bill credit note that is unique to a company in the accounting software. | 1509398f-98e2-436d-8a5d-c042e0c74ffc | +| `IssueDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `LineItems` | [][shared.BillCreditNoteLineItem](../../../pkg/models/shared/billcreditnotelineitem.md) | :heavy_minus_sign: | An array of line | | +| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `Note` | **string* | :heavy_minus_sign: | Any additional information about the bill credit note. | Bill Credit Note with 1 line items, totaling 805.78 | +| `PaymentAllocations` | [][shared.AccountingPaymentAllocation](../../../pkg/models/shared/accountingpaymentallocation.md) | :heavy_minus_sign: | An array of payment allocations. | | +| `RemainingCredit` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of the bill credit note that is still outstanding. | 0 | +| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `Status` | [shared.BillCreditNoteStatus](../../../pkg/models/shared/billcreditnotestatus.md) | :heavy_check_mark: | Current state of the bill credit note | Paid | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Total amount of the bill credit note, including discounts but excluding tax. | 805.78 | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `SupplierRef` | [*shared.SupplierRef](../../../pkg/models/shared/supplierref.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax. | 805.78 | +| `TotalDiscount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Total value of any discounts applied. | 0 | +| `TotalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of tax included in the bill credit note. | 0 | +| `WithholdingTax` | [][shared.Items](../../../pkg/models/shared/items.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingbillcreditnotes.md b/lending/docs/pkg/models/shared/accountingbillcreditnotes.md index fc1c374f8..a7ea32082 100644 --- a/lending/docs/pkg/models/shared/accountingbillcreditnotes.md +++ b/lending/docs/pkg/models/shared/accountingbillcreditnotes.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingBillCreditNote](../../../pkg/models/shared/accountingbillcreditnote.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingBillCreditNote](../../../pkg/models/shared/accountingbillcreditnote.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingbillpayment.md b/lending/docs/pkg/models/shared/accountingbillpayment.md index 543dcd9f2..717332cab 100644 --- a/lending/docs/pkg/models/shared/accountingbillpayment.md +++ b/lending/docs/pkg/models/shared/accountingbillpayment.md @@ -18,7 +18,7 @@ A bill payment in Codat usually represents an allocation of money within any cus - 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. +Depending on the bill payments which are allowed by the underlying accounting software, some of these types may be combined. Please see the example data section for samples of what these cases look like. In Codat, a bill payment contains details of: @@ -27,7 +27,7 @@ In Codat, a bill payment contains details of: - 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/lending-api#/schemas/DirectCost) data model. +Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's _expenses_. You can find these types of transactions in our [Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) data model. Bill payments is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). @@ -130,7 +130,7 @@ The line linked to the bill payment has the following properties: > 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. +> Not all accounting software support linked payments in this way. In these platforms you may see a payment on account and a refund on account. ## Foreign currencies @@ -155,20 +155,20 @@ These two rates allow the calculation of currency loss or gain for any of the tr ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AccountRef` | [*shared.AccountRef](../../../pkg/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` | **string* | :heavy_minus_sign: | N/A | GBP | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | -| `Date` | *string* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `ID` | **string* | :heavy_minus_sign: | Identifier for the bill payment, unique for the company in the accounting platform. | 3d5a8e00-d108-4045-8823-7f342676cffa | -| `Lines` | [][shared.BillPaymentLine](../../../pkg/models/shared/billpaymentline.md) | :heavy_minus_sign: | An array of bill payment lines. | | -| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Note` | **string* | :heavy_minus_sign: | Additional information associated with the payment. | Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44 | -| `PaymentMethodRef` | [*shared.PaymentMethodRef](../../../pkg/models/shared/paymentmethodref.md) | :heavy_minus_sign: | N/A | {"id":"EILBDVJVNUAGVKRQ","name":"AliPay"} | -| `Reference` | **string* | :heavy_minus_sign: | Additional information associated with the payment. | | -| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | -| `SupplierRef` | [*shared.SupplierRef](../../../pkg/models/shared/supplierref.md) | :heavy_minus_sign: | N/A | | -| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountRef` | [*shared.AccountRef](../../../pkg/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` | **string* | :heavy_minus_sign: | N/A | GBP | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

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

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `SupplierRef` | [*shared.SupplierRef](../../../pkg/models/shared/supplierref.md) | :heavy_minus_sign: | N/A | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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/lending/docs/pkg/models/shared/accountingbillpayments.md b/lending/docs/pkg/models/shared/accountingbillpayments.md index 9f3868b05..9a62cd5d3 100644 --- a/lending/docs/pkg/models/shared/accountingbillpayments.md +++ b/lending/docs/pkg/models/shared/accountingbillpayments.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingBillPayment](../../../pkg/models/shared/accountingbillpayment.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingBillPayment](../../../pkg/models/shared/accountingbillpayment.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingbills.md b/lending/docs/pkg/models/shared/accountingbills.md index c42a2918e..e7db58dab 100644 --- a/lending/docs/pkg/models/shared/accountingbills.md +++ b/lending/docs/pkg/models/shared/accountingbills.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingBill](../../../pkg/models/shared/accountingbill.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingBill](../../../pkg/models/shared/accountingbill.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingcompanyinfo.md b/lending/docs/pkg/models/shared/accountingcompanyinfo.md index b43b50eb9..9fdcc7a39 100644 --- a/lending/docs/pkg/models/shared/accountingcompanyinfo.md +++ b/lending/docs/pkg/models/shared/accountingcompanyinfo.md @@ -6,16 +6,16 @@ Company info provides standard details about a linked company such as their addr > **Company information or companies?** > -> Company profile is standard information that is held in the accounting platform about a company. `Companies` is an endpoint that lists businesses in the Codat system that have linked and shared their data sources. +> Company profile is standard information that is held in the accounting software about a company. `Companies` is an endpoint that lists businesses in the Codat system that have linked and shared their data sources. ## Fields | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AccountingPlatformRef` | **string* | :heavy_minus_sign: | Identifier or reference for the company in the accounting platform. | | +| `AccountingPlatformRef` | **string* | :heavy_minus_sign: | Identifier or reference for the company in the accounting software. | | | `Addresses` | [][shared.AccountingAddress](../../../pkg/models/shared/accountingaddress.md) | :heavy_minus_sign: | An array of Addresses. | | -| `BaseCurrency` | **string* | :heavy_minus_sign: | Currency set in the accounting platform of the linked company. Used by the currency rate. | | +| `BaseCurrency` | **string* | :heavy_minus_sign: | Currency set in the accounting software of the linked company. Used by the currency rate. | | | `CompanyLegalName` | **string* | :heavy_minus_sign: | Registered legal name of the linked company. | | | `CompanyName` | **string* | :heavy_minus_sign: | Name of the linked company. | | | `CreatedDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | @@ -24,6 +24,6 @@ Company info provides standard details about a linked company such as their addr | `PhoneNumbers` | [][shared.PhoneNumber](../../../pkg/models/shared/phonenumber.md) | :heavy_minus_sign: | An array of phone numbers. | | | `RegistrationNumber` | **string* | :heavy_minus_sign: | Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. | | | `SourceUrls` | map[string]*string* | :heavy_minus_sign: | URL addresses for the accounting source.

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

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `TaxNumber` | **string* | :heavy_minus_sign: | Company tax number. | | | `WebLinks` | [][shared.WebLink](../../../pkg/models/shared/weblink.md) | :heavy_minus_sign: | An array of weblinks. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingcreateaccountresponse.md b/lending/docs/pkg/models/shared/accountingcreateaccountresponse.md index 852b46587..19966ae5e 100644 --- a/lending/docs/pkg/models/shared/accountingcreateaccountresponse.md +++ b/lending/docs/pkg/models/shared/accountingcreateaccountresponse.md @@ -10,7 +10,7 @@ | `CompletedOnUtc` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `Data` | [*shared.AccountingCreateAccountResponseAccountingAccount](../../../pkg/models/shared/accountingcreateaccountresponseaccountingaccount.md) | :heavy_minus_sign: | N/A | | | `DataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `ErrorMessage` | **string* | :heavy_minus_sign: | A message about the error. | | | `PushOperationKey` | *string* | :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. | | | `RequestedOnUtc` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | diff --git a/lending/docs/pkg/models/shared/accountingcreateaccountresponseaccountingaccount.md b/lending/docs/pkg/models/shared/accountingcreateaccountresponseaccountingaccount.md index 3fd465c79..80d20913c 100644 --- a/lending/docs/pkg/models/shared/accountingcreateaccountresponseaccountingaccount.md +++ b/lending/docs/pkg/models/shared/accountingcreateaccountresponseaccountingaccount.md @@ -49,6 +49,6 @@ To determine the list of allowed categories for a specific integration, you can: | `NominalCode` | **string* | :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 | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | | `Status` | [*shared.AccountStatus](../../../pkg/models/shared/accountstatus.md) | :heavy_minus_sign: | Status of the account | Active | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `Type` | [*shared.AccountType](../../../pkg/models/shared/accounttype.md) | :heavy_minus_sign: | Type of account | Asset | | `ValidDatatypeLinks` | [][shared.AccountingCreateAccountResponseValidDataTypeLinks](../../../pkg/models/shared/accountingcreateaccountresponsevaliddatatypelinks.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](/lending-api#/schemas/ValidDataTypeLinks). | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingcreatebankaccountresponse.md b/lending/docs/pkg/models/shared/accountingcreatebankaccountresponse.md index d9cc2d5b9..817007725 100644 --- a/lending/docs/pkg/models/shared/accountingcreatebankaccountresponse.md +++ b/lending/docs/pkg/models/shared/accountingcreatebankaccountresponse.md @@ -10,7 +10,7 @@ | `CompletedOnUtc` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `Data` | [*shared.AccountingCreateBankAccountResponseAccountingBankAccount](../../../pkg/models/shared/accountingcreatebankaccountresponseaccountingbankaccount.md) | :heavy_minus_sign: | N/A | | | `DataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `ErrorMessage` | **string* | :heavy_minus_sign: | A message about the error. | | | `PushOperationKey` | *string* | :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. | | | `RequestedOnUtc` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | diff --git a/lending/docs/pkg/models/shared/accountingcreatebankaccountresponseaccountingbankaccount.md b/lending/docs/pkg/models/shared/accountingcreatebankaccountresponseaccountingbankaccount.md index fd16bd405..6d40aeaad 100644 --- a/lending/docs/pkg/models/shared/accountingcreatebankaccountresponseaccountingbankaccount.md +++ b/lending/docs/pkg/models/shared/accountingcreatebankaccountresponseaccountingbankaccount.md @@ -13,7 +13,7 @@ A list of bank accounts associated with a company and a specific data connection. Bank accounts data includes: -* The name and ID of the account in the accounting platform. +* The name and ID of the account in the accounting software. * The currency and balance of the account. * The sort code and account number. @@ -24,14 +24,14 @@ Bank accounts data includes: | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AccountName` | **string* | :heavy_minus_sign: | Name of the bank account in the accounting platform. | | +| `AccountName` | **string* | :heavy_minus_sign: | Name of the bank account in the accounting software. | | | `AccountNumber` | **string* | :heavy_minus_sign: | Account number for the bank account.

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

FreeAgent integrations
For Credit accounts, only the last four digits are required. For other types, the field is optional. | | | `AccountType` | [*shared.AccountingBankAccountType](../../../pkg/models/shared/accountingbankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | | `AvailableBalance` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. | | | `Balance` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Balance of the bank account. | | | `Currency` | **string* | :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 | | `IBan` | **string* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | | -| `ID` | **string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting platform. | | +| `ID` | **string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting software. | | | `Institution` | **string* | :heavy_minus_sign: | The institution of the bank account. | | | `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | @@ -39,4 +39,5 @@ Bank accounts data includes: | `OverdraftLimit` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Pre-arranged overdraft limit of the account.

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

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | \ No newline at end of file +| `Status` | [*shared.BankAccountStatus](../../../pkg/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | Status of the bank account. | Active | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingcreatebanktransactionsresponse.md b/lending/docs/pkg/models/shared/accountingcreatebanktransactionsresponse.md index fc1a3d5fb..ad8f790f7 100644 --- a/lending/docs/pkg/models/shared/accountingcreatebanktransactionsresponse.md +++ b/lending/docs/pkg/models/shared/accountingcreatebanktransactionsresponse.md @@ -10,7 +10,7 @@ | `CompletedOnUtc` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `Data` | [*shared.AccountingCreateBankAccountTransactions](../../../pkg/models/shared/accountingcreatebankaccounttransactions.md) | :heavy_minus_sign: | N/A | | | `DataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `ErrorMessage` | **string* | :heavy_minus_sign: | A message about the error. | | | `PushOperationKey` | *string* | :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. | | | `RequestedOnUtc` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | diff --git a/lending/docs/pkg/models/shared/accountingcreatedirectcostresponse.md b/lending/docs/pkg/models/shared/accountingcreatedirectcostresponse.md index 1a058e235..aa1195d62 100644 --- a/lending/docs/pkg/models/shared/accountingcreatedirectcostresponse.md +++ b/lending/docs/pkg/models/shared/accountingcreatedirectcostresponse.md @@ -10,7 +10,7 @@ | `CompletedOnUtc` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `Data` | [*shared.AccountingCreateDirectCostResponseAccountingDirectCost](../../../pkg/models/shared/accountingcreatedirectcostresponseaccountingdirectcost.md) | :heavy_minus_sign: | N/A | | | `DataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `ErrorMessage` | **string* | :heavy_minus_sign: | A message about the error. | | | `PushOperationKey` | *string* | :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. | | | `RequestedOnUtc` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | diff --git a/lending/docs/pkg/models/shared/accountingcreatedirectcostresponseaccountingdirectcost.md b/lending/docs/pkg/models/shared/accountingcreatedirectcostresponseaccountingdirectcost.md index 9e666b965..21001239d 100644 --- a/lending/docs/pkg/models/shared/accountingcreatedirectcostresponseaccountingdirectcost.md +++ b/lending/docs/pkg/models/shared/accountingcreatedirectcostresponseaccountingdirectcost.md @@ -1,6 +1,6 @@ # ~~AccountingCreateDirectCostResponseAccountingDirectCost~~ -> **Language tip:** Direct costs may also be referred to as **Spend transactions**, **Spend money transactions**, or **Payments** in various accounting platforms. +> **Language tip:** Direct costs may also be referred to as **Spend transactions**, **Spend money transactions**, or **Payments** in various accounting software. > View the coverage for direct costs in the Data coverage explorer. @@ -21,21 +21,21 @@ Direct costs is a child data type of [account transactions](https://docs.codat.i ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContactRef` | [*shared.AccountingCreateDirectCostResponseContactReference](../../../pkg/models/shared/accountingcreatedirectcostresponsecontactreference.md) | :heavy_minus_sign: | A customer or supplier associated with the direct cost. | | -| `Currency` | *string* | :heavy_check_mark: | 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 | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | -| `ID` | **string* | :heavy_minus_sign: | Identifier of the direct cost, unique for the company. | | -| `IssueDate` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `LineItems` | [][shared.DirectCostLineItem](../../../pkg/models/shared/directcostlineitem.md) | :heavy_check_mark: | An array of line items. | | -| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Note` | **string* | :heavy_minus_sign: | A note attached to the direct cost. | | -| `PaymentAllocations` | [][shared.AccountingPaymentAllocation](../../../pkg/models/shared/accountingpaymentallocation.md) | :heavy_check_mark: | An array of payment allocations. | | -| `Reference` | **string* | :heavy_minus_sign: | User-friendly reference for the direct cost. | | -| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of the direct costs, excluding any taxes. | | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | -| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of tax on the direct costs. | | -| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The amount of the direct costs, inclusive of tax. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContactRef` | [*shared.ContactRef](../../../pkg/models/shared/contactref.md) | :heavy_minus_sign: | N/A | | +| `Currency` | *string* | :heavy_check_mark: | 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 | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `ID` | **string* | :heavy_minus_sign: | Identifier of the direct cost, unique for the company. | | +| `IssueDate` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `LineItems` | [][shared.DirectCostLineItem](../../../pkg/models/shared/directcostlineitem.md) | :heavy_check_mark: | An array of line items. | | +| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `Note` | **string* | :heavy_minus_sign: | A note attached to the direct cost. | | +| `PaymentAllocations` | [][shared.AccountingPaymentAllocation](../../../pkg/models/shared/accountingpaymentallocation.md) | :heavy_check_mark: | An array of payment allocations. | | +| `Reference` | **string* | :heavy_minus_sign: | User-friendly reference for the direct cost. | | +| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of the direct costs, excluding any taxes. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of tax on the direct costs. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The amount of the direct costs, inclusive of tax. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingcreatedirectcostresponsecontactreference.md b/lending/docs/pkg/models/shared/accountingcreatedirectcostresponsecontactreference.md deleted file mode 100644 index 766d14ebe..000000000 --- a/lending/docs/pkg/models/shared/accountingcreatedirectcostresponsecontactreference.md +++ /dev/null @@ -1,11 +0,0 @@ -# AccountingCreateDirectCostResponseContactReference - -A customer or supplier associated with the direct cost. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `DataType` | [*shared.AccountingCreateDirectCostResponseDataType](../../../pkg/models/shared/accountingcreatedirectcostresponsedatatype.md) | :heavy_minus_sign: | Allowed name of the 'dataType'. | -| `ID` | *string* | :heavy_check_mark: | Unique identifier for a customer or supplier. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingcreatedirectcostresponsedatatype.md b/lending/docs/pkg/models/shared/accountingcreatedirectcostresponsedatatype.md deleted file mode 100644 index 692744333..000000000 --- a/lending/docs/pkg/models/shared/accountingcreatedirectcostresponsedatatype.md +++ /dev/null @@ -1,11 +0,0 @@ -# AccountingCreateDirectCostResponseDataType - -Allowed name of the 'dataType'. - - -## Values - -| Name | Value | -| ----------------------------------------------------- | ----------------------------------------------------- | -| `AccountingCreateDirectCostResponseDataTypeCustomers` | customers | -| `AccountingCreateDirectCostResponseDataTypeSuppliers` | suppliers | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingcreatepaymentresponse.md b/lending/docs/pkg/models/shared/accountingcreatepaymentresponse.md index 521d00872..caa0db5a3 100644 --- a/lending/docs/pkg/models/shared/accountingcreatepaymentresponse.md +++ b/lending/docs/pkg/models/shared/accountingcreatepaymentresponse.md @@ -10,7 +10,7 @@ | `CompletedOnUtc` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `Data` | [*shared.AccountingCreatePaymentResponseAccountingPayment](../../../pkg/models/shared/accountingcreatepaymentresponseaccountingpayment.md) | :heavy_minus_sign: | N/A | | | `DataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `ErrorMessage` | **string* | :heavy_minus_sign: | A message about the error. | | | `PushOperationKey` | *string* | :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. | | | `RequestedOnUtc` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | diff --git a/lending/docs/pkg/models/shared/accountingcreatepaymentresponseaccountingpayment.md b/lending/docs/pkg/models/shared/accountingcreatepaymentresponseaccountingpayment.md index a910dfd42..047fc2392 100644 --- a/lending/docs/pkg/models/shared/accountingcreatepaymentresponseaccountingpayment.md +++ b/lending/docs/pkg/models/shared/accountingcreatepaymentresponseaccountingpayment.md @@ -16,7 +16,7 @@ A payment in Codat usually represents an allocation of money within any customer - An allocation of a customer's credit note, either to an invoice or maybe a refund. - A payment made directly to that accounts receivable account. This might be an overpayment or a prepayment. It might also be the refund of a payment made directly to an accounts receivable account. -Depending on the payments allowed by the underlying accounting package, some payment types may be combined. Please see the example for more details. +Depending on the payments allowed by the underlying accounting software, some payment types may be combined. Please see the example for more details. In Codat, a payment contains details of: @@ -121,7 +121,7 @@ The **line** linked to the payment has the following properties: > **Support for linked payments** > -> Not all accounting packages support linking payments in this way. In some platforms, you may see a payment on account and a refund on account. +> Not all accounting software support linking payments in this way. In some platforms, you may see a payment on account and a refund on account. ## Foreign currencies @@ -684,20 +684,20 @@ In this example, a payment on account is used to pay the same invoice in January ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AccountRef` | [*shared.AccountRef](../../../pkg/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` | **string* | :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 | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | -| `CustomerRef` | [*shared.AccountingCustomerRef](../../../pkg/models/shared/accountingcustomerref.md) | :heavy_minus_sign: | N/A | | -| `Date` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `ID` | **string* | :heavy_minus_sign: | Identifier for the payment, unique to the company in the accounting platform. | | -| `Lines` | [][shared.PaymentLine](../../../pkg/models/shared/paymentline.md) | :heavy_minus_sign: | An array of payment lines. | | -| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Note` | **string* | :heavy_minus_sign: | Any additional information associated with the payment. | | -| `PaymentMethodRef` | [*shared.PaymentMethodRef](../../../pkg/models/shared/paymentmethodref.md) | :heavy_minus_sign: | The payment method the record is linked to in the accounting or commerce platform. | {"id":"EILBDVJVNUAGVKRQ","name":"AliPay"} | -| `Reference` | **string* | :heavy_minus_sign: | Friendly reference for the payment. | | -| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | -| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountRef` | [*shared.AccountRef](../../../pkg/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` | **string* | :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 | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `CustomerRef` | [*shared.AccountingCustomerRef](../../../pkg/models/shared/accountingcustomerref.md) | :heavy_minus_sign: | N/A | | +| `Date` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `ID` | **string* | :heavy_minus_sign: | Identifier for the payment, unique to the company in the accounting software. | | +| `Lines` | [][shared.PaymentLine](../../../pkg/models/shared/paymentline.md) | :heavy_minus_sign: | An array of payment lines. | | +| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `Note` | **string* | :heavy_minus_sign: | Any additional information associated with the payment. | | +| `PaymentMethodRef` | [*shared.PaymentMethodRef](../../../pkg/models/shared/paymentmethodref.md) | :heavy_minus_sign: | The payment method the record is linked to in the accounting or commerce software. | {
"id": "EILBDVJVNUAGVKRQ",
"name": "AliPay"
} | +| `Reference` | **string* | :heavy_minus_sign: | Friendly reference for the payment. | | +| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingcreatesupplierresponse.md b/lending/docs/pkg/models/shared/accountingcreatesupplierresponse.md index 2cd5b6ead..582f38839 100644 --- a/lending/docs/pkg/models/shared/accountingcreatesupplierresponse.md +++ b/lending/docs/pkg/models/shared/accountingcreatesupplierresponse.md @@ -8,9 +8,9 @@ | `Changes` | [][shared.PushOperationChange](../../../pkg/models/shared/pushoperationchange.md) | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | | `CompanyID` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `CompletedOnUtc` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `Data` | [*shared.AccountingCreateSupplierResponseAccountingSupplier](../../../pkg/models/shared/accountingcreatesupplierresponseaccountingsupplier.md) | :heavy_minus_sign: | N/A | {"id":"C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F","supplierName":"Kelly's Industrial Supplies","contactName":"Kelly's Industrial Supplies","emailAddress":"sales@kellysupplies.com","phone":"07999 999999","addresses":[{"type":"Billing","line1":"Unit 51","line2":"Bakersfield Industrial Estate","city":"Bakersfield","region":"California","country":"USA","postalcode":"93308"}],"registrationNumber":"string","taxNumber":"string","status":"Unknown","defaultCurrency":"string","metadata":{"isDeleted":true},"supplementalData":{"content":{"property1":{"property1":null,"property2":null},"property2":{"property1":null,"property2":null}}},"modifiedDate":"2022-10-23T00:00:00Z","sourceModifiedDate":"2022-10-23T00:00:00Z"} | +| `Data` | [*shared.AccountingCreateSupplierResponseAccountingSupplier](../../../pkg/models/shared/accountingcreatesupplierresponseaccountingsupplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | | `DataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `ErrorMessage` | **string* | :heavy_minus_sign: | A message about the error. | | | `PushOperationKey` | *string* | :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. | | | `RequestedOnUtc` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | diff --git a/lending/docs/pkg/models/shared/accountingcreatesupplierresponseaccountingsupplier.md b/lending/docs/pkg/models/shared/accountingcreatesupplierresponseaccountingsupplier.md index 357c119d4..678dc9325 100644 --- a/lending/docs/pkg/models/shared/accountingcreatesupplierresponseaccountingsupplier.md +++ b/lending/docs/pkg/models/shared/accountingcreatesupplierresponseaccountingsupplier.md @@ -17,13 +17,13 @@ From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers | `ContactName` | **string* | :heavy_minus_sign: | Name of the main contact for the supplier. | | | `DefaultCurrency` | **string* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | | `EmailAddress` | **string* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | -| `ID` | **string* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting platform. | | +| `ID` | **string* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | | `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | | `Phone` | **string* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | | `RegistrationNumber` | **string* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | | `Status` | [shared.SupplierStatus](../../../pkg/models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `SupplierName` | **string* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | | `TaxNumber` | **string* | :heavy_minus_sign: | Supplier's company tax number. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingcreatetransferresponse.md b/lending/docs/pkg/models/shared/accountingcreatetransferresponse.md index a6ca3586a..5013f441f 100644 --- a/lending/docs/pkg/models/shared/accountingcreatetransferresponse.md +++ b/lending/docs/pkg/models/shared/accountingcreatetransferresponse.md @@ -10,7 +10,7 @@ | `CompletedOnUtc` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `Data` | [*shared.AccountingCreateTransferResponseAccountingTransfer](../../../pkg/models/shared/accountingcreatetransferresponseaccountingtransfer.md) | :heavy_minus_sign: | N/A | | | `DataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `ErrorMessage` | **string* | :heavy_minus_sign: | A message about the error. | | | `PushOperationKey` | *string* | :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. | | | `RequestedOnUtc` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | diff --git a/lending/docs/pkg/models/shared/accountingcreatetransferresponseaccountingtransfer.md b/lending/docs/pkg/models/shared/accountingcreatetransferresponseaccountingtransfer.md index d53ab7292..06ffb5754 100644 --- a/lending/docs/pkg/models/shared/accountingcreatetransferresponseaccountingtransfer.md +++ b/lending/docs/pkg/models/shared/accountingcreatetransferresponseaccountingtransfer.md @@ -11,7 +11,7 @@ A transfer records the movement of money between two bank accounts, or between a | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContactRef` | [*shared.ContactRef](../../../pkg/models/shared/contactref.md) | :heavy_minus_sign: | A customer or supplier associated with the direct cost. | | +| `ContactRef` | [*shared.ContactRef](../../../pkg/models/shared/contactref.md) | :heavy_minus_sign: | N/A | | | `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `DepositedRecordRefs` | [][shared.RecordRef](../../../pkg/models/shared/recordref.md) | :heavy_minus_sign: | List of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the _undeposited funds_ (or other holding) account within the transfer. | | | `Description` | **string* | :heavy_minus_sign: | Description of the transfer. | | @@ -20,6 +20,6 @@ A transfer records the movement of money between two bank accounts, or between a | `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `To` | [*shared.TransferAccount](../../../pkg/models/shared/transferaccount.md) | :heavy_minus_sign: | Account details of the account sending or receiving the transfer. | | | `TrackingCategoryRefs` | [][shared.TrackingCategoryRef](../../../pkg/models/shared/trackingcategoryref.md) | :heavy_minus_sign: | Reference to the tracking categories this transfer is being tracked against. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingcreditnote.md b/lending/docs/pkg/models/shared/accountingcreditnote.md index bc5e8535b..10a125f33 100644 --- a/lending/docs/pkg/models/shared/accountingcreditnote.md +++ b/lending/docs/pkg/models/shared/accountingcreditnote.md @@ -16,29 +16,29 @@ It contains details of: ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AdditionalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Additional tax amount applied to credit note. | | -| `AdditionalTaxPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Percentage rate of any additional tax applied to the credit note. | | -| `AllocatedOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `CreditNoteNumber` | **string* | :heavy_minus_sign: | Friendly reference for the credit note. | | -| `Currency` | **string* | :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 | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | -| `CustomerRef` | [*shared.AccountingCustomerRef](../../../pkg/models/shared/accountingcustomerref.md) | :heavy_minus_sign: | N/A | | -| `DiscountPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Percentage rate (from 0 to 100) of discounts applied to the credit note. | | -| `ID` | **string* | :heavy_minus_sign: | Identifier for the credit note, unique to the company in the accounting platform. | | -| `IssueDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `LineItems` | [][shared.CreditNoteLineItem](../../../pkg/models/shared/creditnotelineitem.md) | :heavy_minus_sign: | N/A | | -| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Note` | **string* | :heavy_minus_sign: | Any additional information about the credit note. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when a credit note is emailed from the accounting platform to the customer. | | -| `PaymentAllocations` | [][shared.AccountingPaymentAllocation](../../../pkg/models/shared/accountingpaymentallocation.md) | :heavy_minus_sign: | An array of payment allocations. | | -| `RemainingCredit` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Unused balance of totalAmount originally raised. | | -| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Status` | [shared.CreditNoteStatus](../../../pkg/models/shared/creditnotestatus.md) | :heavy_check_mark: | Current state of the credit note. | | -| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Value of the credit note, including discounts and excluding tax. | | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | -| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Total amount of credit that has been applied to the customer's accounts receivable | | -| `TotalDiscount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Any discounts applied to the credit note amount. | | -| `TotalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Any tax applied to the credit note amount. | | -| `WithholdingTax` | [][shared.WithholdingTaxItems](../../../pkg/models/shared/withholdingtaxitems.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AdditionalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Additional tax amount applied to credit note. | | +| `AdditionalTaxPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Percentage rate of any additional tax applied to the credit note. | | +| `AllocatedOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `CreditNoteNumber` | **string* | :heavy_minus_sign: | Friendly reference for the credit note. | | +| `Currency` | **string* | :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 | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `CustomerRef` | [*shared.AccountingCustomerRef](../../../pkg/models/shared/accountingcustomerref.md) | :heavy_minus_sign: | N/A | | +| `DiscountPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Percentage rate (from 0 to 100) of discounts applied to the credit note. | | +| `ID` | **string* | :heavy_minus_sign: | Identifier for the credit note, unique to the company in the accounting software. | | +| `IssueDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `LineItems` | [][shared.CreditNoteLineItem](../../../pkg/models/shared/creditnotelineitem.md) | :heavy_minus_sign: | N/A | | +| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `Note` | **string* | :heavy_minus_sign: | Any additional information about the credit note. Where possible, Codat links to a data field in the accounting software that is publicly available. This means that the contents of the note field are included when a credit note is emailed from the accounting software to the customer. | | +| `PaymentAllocations` | [][shared.AccountingPaymentAllocation](../../../pkg/models/shared/accountingpaymentallocation.md) | :heavy_minus_sign: | An array of payment allocations. | | +| `RemainingCredit` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Unused balance of totalAmount originally raised. | | +| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `Status` | [shared.CreditNoteStatus](../../../pkg/models/shared/creditnotestatus.md) | :heavy_check_mark: | Current state of the credit note. | | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Value of the credit note, including discounts and excluding tax. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Total amount of credit that has been applied to the customer's accounts receivable | | +| `TotalDiscount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Any discounts applied to the credit note amount. | | +| `TotalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Any tax applied to the credit note amount. | | +| `WithholdingTax` | [][shared.Items](../../../pkg/models/shared/items.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingcreditnotes.md b/lending/docs/pkg/models/shared/accountingcreditnotes.md index f2db0f062..c24a6c109 100644 --- a/lending/docs/pkg/models/shared/accountingcreditnotes.md +++ b/lending/docs/pkg/models/shared/accountingcreditnotes.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingCreditNote](../../../pkg/models/shared/accountingcreditnote.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingCreditNote](../../../pkg/models/shared/accountingcreditnote.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingcustomer.md b/lending/docs/pkg/models/shared/accountingcustomer.md index 60ed58ee6..7f2d3f730 100644 --- a/lending/docs/pkg/models/shared/accountingcustomer.md +++ b/lending/docs/pkg/models/shared/accountingcustomer.md @@ -20,12 +20,12 @@ Customers' data links to accounts receivable [invoices](https://docs.codat.io/le | `CustomerName` | **string* | :heavy_minus_sign: | Name of the customer as recorded in the accounting system, typically the company name. | | | `DefaultCurrency` | **string* | :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 | | `EmailAddress` | **string* | :heavy_minus_sign: | Email address the customer can be contacted by. | | -| `ID` | **string* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting platform. | | +| `ID` | **string* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting software. | | | `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | | `Phone` | **string* | :heavy_minus_sign: | Phone number the customer can be contacted by. | | | `RegistrationNumber` | **string* | :heavy_minus_sign: | Company number. In the UK, this is typically the Companies House company registration number. | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | | `Status` | [shared.CustomerStatus](../../../pkg/models/shared/customerstatus.md) | :heavy_check_mark: | Status of customer. | | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `TaxNumber` | **string* | :heavy_minus_sign: | Company tax number. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingcustomers.md b/lending/docs/pkg/models/shared/accountingcustomers.md index 55e189b1d..c25c2982a 100644 --- a/lending/docs/pkg/models/shared/accountingcustomers.md +++ b/lending/docs/pkg/models/shared/accountingcustomers.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingCustomer](../../../pkg/models/shared/accountingcustomer.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingCustomer](../../../pkg/models/shared/accountingcustomer.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingdirectcost.md b/lending/docs/pkg/models/shared/accountingdirectcost.md index e26c9b24f..ce92f3937 100644 --- a/lending/docs/pkg/models/shared/accountingdirectcost.md +++ b/lending/docs/pkg/models/shared/accountingdirectcost.md @@ -1,6 +1,6 @@ # AccountingDirectCost -> **Language tip:** Direct costs may also be referred to as **Spend transactions**, **Spend money transactions**, or **Payments** in various accounting platforms. +> **Language tip:** Direct costs may also be referred to as **Spend transactions**, **Spend money transactions**, or **Payments** in various accounting software. > View the coverage for direct costs in the Data coverage explorer. @@ -19,21 +19,21 @@ Direct costs is a child data type of [account transactions](https://docs.codat.i ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContactRef` | [*shared.AccountingDirectCostContactReference](../../../pkg/models/shared/accountingdirectcostcontactreference.md) | :heavy_minus_sign: | A customer or supplier associated with the direct cost. | | -| `Currency` | *string* | :heavy_check_mark: | 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 | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | -| `ID` | **string* | :heavy_minus_sign: | Identifier of the direct cost, unique for the company. | | -| `IssueDate` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `LineItems` | [][shared.DirectCostLineItem](../../../pkg/models/shared/directcostlineitem.md) | :heavy_check_mark: | An array of line items. | | -| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Note` | **string* | :heavy_minus_sign: | A note attached to the direct cost. | | -| `PaymentAllocations` | [][shared.AccountingPaymentAllocation](../../../pkg/models/shared/accountingpaymentallocation.md) | :heavy_check_mark: | An array of payment allocations. | | -| `Reference` | **string* | :heavy_minus_sign: | User-friendly reference for the direct cost. | | -| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of the direct costs, excluding any taxes. | | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | -| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of tax on the direct costs. | | -| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The amount of the direct costs, inclusive of tax. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContactRef` | [*shared.ContactRef](../../../pkg/models/shared/contactref.md) | :heavy_minus_sign: | N/A | | +| `Currency` | *string* | :heavy_check_mark: | 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 | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `ID` | **string* | :heavy_minus_sign: | Identifier of the direct cost, unique for the company. | | +| `IssueDate` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `LineItems` | [][shared.DirectCostLineItem](../../../pkg/models/shared/directcostlineitem.md) | :heavy_check_mark: | An array of line items. | | +| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `Note` | **string* | :heavy_minus_sign: | A note attached to the direct cost. | | +| `PaymentAllocations` | [][shared.AccountingPaymentAllocation](../../../pkg/models/shared/accountingpaymentallocation.md) | :heavy_check_mark: | An array of payment allocations. | | +| `Reference` | **string* | :heavy_minus_sign: | User-friendly reference for the direct cost. | | +| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of the direct costs, excluding any taxes. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of tax on the direct costs. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The amount of the direct costs, inclusive of tax. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingdirectcostcontactreference.md b/lending/docs/pkg/models/shared/accountingdirectcostcontactreference.md deleted file mode 100644 index d8a63920e..000000000 --- a/lending/docs/pkg/models/shared/accountingdirectcostcontactreference.md +++ /dev/null @@ -1,11 +0,0 @@ -# AccountingDirectCostContactReference - -A customer or supplier associated with the direct cost. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `DataType` | [*shared.AccountingDirectCostDataType](../../../pkg/models/shared/accountingdirectcostdatatype.md) | :heavy_minus_sign: | Allowed name of the 'dataType'. | -| `ID` | *string* | :heavy_check_mark: | Unique identifier for a customer or supplier. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingdirectcostdatatype.md b/lending/docs/pkg/models/shared/accountingdirectcostdatatype.md deleted file mode 100644 index 2e4c28fab..000000000 --- a/lending/docs/pkg/models/shared/accountingdirectcostdatatype.md +++ /dev/null @@ -1,11 +0,0 @@ -# AccountingDirectCostDataType - -Allowed name of the 'dataType'. - - -## Values - -| Name | Value | -| --------------------------------------- | --------------------------------------- | -| `AccountingDirectCostDataTypeCustomers` | customers | -| `AccountingDirectCostDataTypeSuppliers` | suppliers | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingdirectcosts.md b/lending/docs/pkg/models/shared/accountingdirectcosts.md index 89c29c4ed..b5a8f41ca 100644 --- a/lending/docs/pkg/models/shared/accountingdirectcosts.md +++ b/lending/docs/pkg/models/shared/accountingdirectcosts.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingDirectCost](../../../pkg/models/shared/accountingdirectcost.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingDirectCost](../../../pkg/models/shared/accountingdirectcost.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingdirectincome.md b/lending/docs/pkg/models/shared/accountingdirectincome.md index da7a1499c..31c8e6feb 100644 --- a/lending/docs/pkg/models/shared/accountingdirectincome.md +++ b/lending/docs/pkg/models/shared/accountingdirectincome.md @@ -1,6 +1,6 @@ # AccountingDirectIncome -> **Language tip:** Direct incomes may also be referred to as **Receive transactions**, **Receive money transactions**, **Sales receipts**, or **Cash sales** in various accounting platforms. +> **Language tip:** Direct incomes may also be referred to as **Receive transactions**, **Receive money transactions**, **Sales receipts**, or **Cash sales** in various accounting software. > View the coverage for direct incomes in the Data coverage explorer. @@ -20,21 +20,21 @@ Direct incomes is a child data type of [account transactions](https://docs.codat ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContactRef` | [*shared.ContactRef](../../../pkg/models/shared/contactref.md) | :heavy_minus_sign: | A customer or supplier associated with the direct cost. | | -| `Currency` | *string* | :heavy_check_mark: | 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 | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | -| `ID` | **string* | :heavy_minus_sign: | Identifier of the direct income, unique for the company. | | -| `IssueDate` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `LineItems` | [][shared.DirectIncomeLineItem](../../../pkg/models/shared/directincomelineitem.md) | :heavy_check_mark: | An array of line items. | | -| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Note` | **string* | :heavy_minus_sign: | An optional note on the direct income that can be used to assign the direct income with a reference ID in your application. | | -| `PaymentAllocations` | [][shared.AccountingPaymentAllocation](../../../pkg/models/shared/accountingpaymentallocation.md) | :heavy_check_mark: | N/A | | -| `Reference` | **string* | :heavy_minus_sign: | User-friendly reference for the direct income. | | -| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of the direct incomes, excluding any taxes. | | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | -| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of tax on the direct incomes. | | -| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The amount of the direct incomes, inclusive of tax. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContactRef` | [*shared.ContactRef](../../../pkg/models/shared/contactref.md) | :heavy_minus_sign: | N/A | | +| `Currency` | *string* | :heavy_check_mark: | 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 | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `ID` | **string* | :heavy_minus_sign: | Identifier of the direct income, unique for the company. | | +| `IssueDate` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `LineItems` | [][shared.DirectIncomeLineItem](../../../pkg/models/shared/directincomelineitem.md) | :heavy_check_mark: | An array of line items. | | +| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `Note` | **string* | :heavy_minus_sign: | An optional note on the direct income that can be used to assign the direct income with a reference ID in your application. | | +| `PaymentAllocations` | [][shared.AccountingPaymentAllocation](../../../pkg/models/shared/accountingpaymentallocation.md) | :heavy_check_mark: | N/A | | +| `Reference` | **string* | :heavy_minus_sign: | User-friendly reference for the direct income. | | +| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of the direct incomes, excluding any taxes. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of tax on the direct incomes. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The amount of the direct incomes, inclusive of tax. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingdirectincomes.md b/lending/docs/pkg/models/shared/accountingdirectincomes.md index c492e63a6..a3914b6e6 100644 --- a/lending/docs/pkg/models/shared/accountingdirectincomes.md +++ b/lending/docs/pkg/models/shared/accountingdirectincomes.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingDirectIncome](../../../pkg/models/shared/accountingdirectincome.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingDirectIncome](../../../pkg/models/shared/accountingdirectincome.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountinginvoice.md b/lending/docs/pkg/models/shared/accountinginvoice.md index 172f8251b..807135ffa 100644 --- a/lending/docs/pkg/models/shared/accountinginvoice.md +++ b/lending/docs/pkg/models/shared/accountinginvoice.md @@ -33,31 +33,31 @@ In Codat, an invoice contains details of: ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AdditionalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Additional tax amount applied to invoice. | | -| `AdditionalTaxPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Percentage rate of any additional tax applied to the invoice. | | -| `AmountDue` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount outstanding on the invoice. | | -| `Currency` | **string* | :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 | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | -| `CustomerRef` | [*shared.AccountingCustomerRef](../../../pkg/models/shared/accountingcustomerref.md) | :heavy_minus_sign: | N/A | | -| `DiscountPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Percentage rate (from 0 to 100) of discounts applied to the invoice. For example: A 5% discount will return a value of `5`, not `0.05`. | | -| `DueDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `ID` | **string* | :heavy_minus_sign: | Identifier for the invoice, unique to the company in the accounting platform. | | -| `InvoiceNumber` | **string* | :heavy_minus_sign: | Friendly reference for the invoice. If available, this appears in the file name of invoice attachments. | | -| `IssueDate` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `LineItems` | [][shared.InvoiceLineItem](../../../pkg/models/shared/invoicelineitem.md) | :heavy_minus_sign: | An array of line items. | | -| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Note` | **string* | :heavy_minus_sign: | Any additional information about the invoice. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when an invoice is emailed from the accounting platform to the customer. | | -| `PaidOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `PaymentAllocations` | [][shared.AccountingPaymentAllocation](../../../pkg/models/shared/accountingpaymentallocation.md) | :heavy_minus_sign: | An array of payment allocations. | | -| `SalesOrderRefs` | [][shared.SalesOrderReference](../../../pkg/models/shared/salesorderreference.md) | :heavy_minus_sign: | List of references to related Sales orders. | | -| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Status` | [shared.InvoiceStatus](../../../pkg/models/shared/invoicestatus.md) | :heavy_check_mark: | Current state of the invoice:

- `Draft` - Invoice hasn't been submitted to the supplier. It may be in a pending state or is scheduled for future submission, for example by email.
- `Submitted` - Invoice is no longer a draft. It has been processed and, or, sent to the customer. In this state, it will impact the ledger. It also has no payments made against it (amountDue == totalAmount).
- `PartiallyPaid` - The balance paid against the invoice is positive, but less than the total invoice amount (0 < amountDue < totalAmount).
- `Paid` - Invoice is paid in full. This includes if the invoice has been credited or overpaid (amountDue == 0).
- `Void` - An invoice can become Void when it's deleted, refunded, written off, or cancelled. A voided invoice may still be PartiallyPaid, and so all outstanding amounts on voided invoices are removed from the accounts receivable account. | | -| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of the invoice excluding any taxes. | | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | -| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of the invoice, inclusive of tax. | | -| `TotalDiscount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Numerical value of discounts applied to the invoice. | | -| `TotalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of tax on the invoice. | | -| `WithholdingTax` | [][shared.WithholdingTaxItems](../../../pkg/models/shared/withholdingtaxitems.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AdditionalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Additional tax amount applied to invoice. | | +| `AdditionalTaxPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Percentage rate of any additional tax applied to the invoice. | | +| `AmountDue` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount outstanding on the invoice. | | +| `Currency` | **string* | :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 | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `CustomerRef` | [*shared.AccountingCustomerRef](../../../pkg/models/shared/accountingcustomerref.md) | :heavy_minus_sign: | N/A | | +| `DiscountPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Percentage rate (from 0 to 100) of discounts applied to the invoice. For example: A 5% discount will return a value of `5`, not `0.05`. | | +| `DueDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `ID` | **string* | :heavy_minus_sign: | Identifier for the invoice, unique to the company in the accounting software. | | +| `InvoiceNumber` | **string* | :heavy_minus_sign: | Friendly reference for the invoice. If available, this appears in the file name of invoice attachments. | | +| `IssueDate` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `LineItems` | [][shared.InvoiceLineItem](../../../pkg/models/shared/invoicelineitem.md) | :heavy_minus_sign: | An array of line items. | | +| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `Note` | **string* | :heavy_minus_sign: | Any additional information about the invoice. Where possible, Codat links to a data field in the accounting software that is publicly available. This means that the contents of the note field are included when an invoice is emailed from the accounting software to the customer. | | +| `PaidOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `PaymentAllocations` | [][shared.AccountingPaymentAllocation](../../../pkg/models/shared/accountingpaymentallocation.md) | :heavy_minus_sign: | An array of payment allocations. | | +| `SalesOrderRefs` | [][shared.SalesOrderReference](../../../pkg/models/shared/salesorderreference.md) | :heavy_minus_sign: | List of references to related Sales orders. | | +| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `Status` | [shared.InvoiceStatus](../../../pkg/models/shared/invoicestatus.md) | :heavy_check_mark: | Current state of the invoice:

- `Draft` - Invoice hasn't been submitted to the supplier. It may be in a pending state or is scheduled for future submission, for example by email.
- `Submitted` - Invoice is no longer a draft. It has been processed and, or, sent to the customer. In this state, it will impact the ledger. It also has no payments made against it (amountDue == totalAmount).
- `PartiallyPaid` - The balance paid against the invoice is positive, but less than the total invoice amount (0 < amountDue < totalAmount).
- `Paid` - Invoice is paid in full. This includes if the invoice has been credited or overpaid (amountDue == 0).
- `Void` - An invoice can become Void when it's deleted, refunded, written off, or cancelled. A voided invoice may still be PartiallyPaid, and so all outstanding amounts on voided invoices are removed from the accounts receivable account. | | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of the invoice excluding any taxes. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of the invoice, inclusive of tax. | | +| `TotalDiscount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Numerical value of discounts applied to the invoice. | | +| `TotalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of tax on the invoice. | | +| `WithholdingTax` | [][shared.Items](../../../pkg/models/shared/items.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountinginvoices.md b/lending/docs/pkg/models/shared/accountinginvoices.md index f5058fde2..30135e29d 100644 --- a/lending/docs/pkg/models/shared/accountinginvoices.md +++ b/lending/docs/pkg/models/shared/accountinginvoices.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingInvoice](../../../pkg/models/shared/accountinginvoice.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingInvoice](../../../pkg/models/shared/accountinginvoice.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingjournal.md b/lending/docs/pkg/models/shared/accountingjournal.md index 2b8d45302..921bc7410 100644 --- a/lending/docs/pkg/models/shared/accountingjournal.md +++ b/lending/docs/pkg/models/shared/accountingjournal.md @@ -21,7 +21,7 @@ Multiple journals or subjournals are used in the following Codat integrations: - [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. +> When pushing journal entries to an accounting software that doesn’t support multiple journals (multi-book accounting), the entries will be linked to the platform-generic journal. The Journals data type will only include one object. diff --git a/lending/docs/pkg/models/shared/accountingjournalentries.md b/lending/docs/pkg/models/shared/accountingjournalentries.md index 2a99cc90f..e0c638e1b 100644 --- a/lending/docs/pkg/models/shared/accountingjournalentries.md +++ b/lending/docs/pkg/models/shared/accountingjournalentries.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingJournalEntry](../../../pkg/models/shared/accountingjournalentry.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingJournalEntry](../../../pkg/models/shared/accountingjournalentry.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingjournalentry.md b/lending/docs/pkg/models/shared/accountingjournalentry.md index 284298921..be1270b65 100644 --- a/lending/docs/pkg/models/shared/accountingjournalentry.md +++ b/lending/docs/pkg/models/shared/accountingjournalentry.md @@ -30,7 +30,7 @@ In Codat a journal entry contains details of: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `CreatedOn` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `Description` | **string* | :heavy_minus_sign: | Optional description of the journal entry. | | -| `ID` | **string* | :heavy_minus_sign: | Unique identifier of the journal entry for the company in the accounting platform. | | +| `ID` | **string* | :heavy_minus_sign: | Unique identifier of the journal entry for the company in the accounting software. | | | `JournalLines` | [][shared.JournalLine](../../../pkg/models/shared/journalline.md) | :heavy_minus_sign: | An array of journal lines. | | | `JournalRef` | [*shared.JournalRef](../../../pkg/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` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | @@ -38,5 +38,5 @@ In Codat a journal entry contains details of: | `PostedOn` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `RecordRef` | [*shared.JournalEntryRecordRef](../../../pkg/models/shared/journalentryrecordref.md) | :heavy_minus_sign: | Links a journal entry to the underlying record that created it. | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `UpdatedOn` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingjournals.md b/lending/docs/pkg/models/shared/accountingjournals.md index fe4e313d3..a0b9641d8 100644 --- a/lending/docs/pkg/models/shared/accountingjournals.md +++ b/lending/docs/pkg/models/shared/accountingjournals.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingJournal](../../../pkg/models/shared/accountingjournal.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingJournal](../../../pkg/models/shared/accountingjournal.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingpayment.md b/lending/docs/pkg/models/shared/accountingpayment.md index ea538bd27..c747c3f3f 100644 --- a/lending/docs/pkg/models/shared/accountingpayment.md +++ b/lending/docs/pkg/models/shared/accountingpayment.md @@ -16,7 +16,7 @@ A payment in Codat usually represents an allocation of money within any customer - An allocation of a customer's credit note, either to an invoice or maybe a refund. - A payment made directly to that accounts receivable account. This might be an overpayment or a prepayment. It might also be the refund of a payment made directly to an accounts receivable account. -Depending on the payments allowed by the underlying accounting package, some payment types may be combined. Please see the example for more details. +Depending on the payments allowed by the underlying accounting software, some payment types may be combined. Please see the example for more details. In Codat, a payment contains details of: @@ -121,7 +121,7 @@ The **line** linked to the payment has the following properties: > **Support for linked payments** > -> Not all accounting packages support linking payments in this way. In some platforms, you may see a payment on account and a refund on account. +> Not all accounting software support linking payments in this way. In some platforms, you may see a payment on account and a refund on account. ## Foreign currencies @@ -682,20 +682,20 @@ In this example, a payment on account is used to pay the same invoice in January ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AccountRef` | [*shared.AccountRef](../../../pkg/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` | **string* | :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 | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | -| `CustomerRef` | [*shared.AccountingCustomerRef](../../../pkg/models/shared/accountingcustomerref.md) | :heavy_minus_sign: | N/A | | -| `Date` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `ID` | **string* | :heavy_minus_sign: | Identifier for the payment, unique to the company in the accounting platform. | | -| `Lines` | [][shared.PaymentLine](../../../pkg/models/shared/paymentline.md) | :heavy_minus_sign: | An array of payment lines. | | -| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `Note` | **string* | :heavy_minus_sign: | Any additional information associated with the payment. | | -| `PaymentMethodRef` | [*shared.PaymentMethodRef](../../../pkg/models/shared/paymentmethodref.md) | :heavy_minus_sign: | The payment method the record is linked to in the accounting or commerce platform. | {"id":"EILBDVJVNUAGVKRQ","name":"AliPay"} | -| `Reference` | **string* | :heavy_minus_sign: | Friendly reference for the payment. | | -| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | -| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountRef` | [*shared.AccountRef](../../../pkg/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` | **string* | :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 | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `CustomerRef` | [*shared.AccountingCustomerRef](../../../pkg/models/shared/accountingcustomerref.md) | :heavy_minus_sign: | N/A | | +| `Date` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `ID` | **string* | :heavy_minus_sign: | Identifier for the payment, unique to the company in the accounting software. | | +| `Lines` | [][shared.PaymentLine](../../../pkg/models/shared/paymentline.md) | :heavy_minus_sign: | An array of payment lines. | | +| `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `Note` | **string* | :heavy_minus_sign: | Any additional information associated with the payment. | | +| `PaymentMethodRef` | [*shared.PaymentMethodRef](../../../pkg/models/shared/paymentmethodref.md) | :heavy_minus_sign: | The payment method the record is linked to in the accounting or commerce software. | {
"id": "EILBDVJVNUAGVKRQ",
"name": "AliPay"
} | +| `Reference` | **string* | :heavy_minus_sign: | Friendly reference for the payment. | | +| `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingpayments.md b/lending/docs/pkg/models/shared/accountingpayments.md index 70bbf8506..12809cb57 100644 --- a/lending/docs/pkg/models/shared/accountingpayments.md +++ b/lending/docs/pkg/models/shared/accountingpayments.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingPayment](../../../pkg/models/shared/accountingpayment.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingPayment](../../../pkg/models/shared/accountingpayment.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingprofitandlossreport.md b/lending/docs/pkg/models/shared/accountingprofitandlossreport.md index 241696ff5..78dc67491 100644 --- a/lending/docs/pkg/models/shared/accountingprofitandlossreport.md +++ b/lending/docs/pkg/models/shared/accountingprofitandlossreport.md @@ -15,13 +15,13 @@ A profit and loss report shows a company's total income and expenses for a speci **Structure of this report** -This report will reflect the structure and line descriptions that the business has set in their own accounting platform. +This report will reflect the structure and line descriptions that the business has set in their own accounting software. **History** By default, Codat pulls (up to) 24 months of profit and loss history for a company. You can adjust this to fetch more history, where available, by updating the `monthsToSync` value for `profitAndLoss` on the [data type settings endpoint](https://docs.codat.io/lending-api#/operations/post-profile-syncSettings). **Want to pull this in a standardised structure?** -Our [Enhanced Financials](https://docs.codat.io/assess/reports/enhanced-financials/financials) endpoints provide the same report under standardized headings, allowing you to pull it in the same format for all of your business customers. +Our [Enhanced Financials](https://docs.codat.io/lending/features/financial-statements-overview) endpoints provide the same report under standardized headings, allowing you to pull it in the same format for all of your business customers. ## Fields diff --git a/lending/docs/pkg/models/shared/accountingsupplier.md b/lending/docs/pkg/models/shared/accountingsupplier.md index 72b7f5dba..28bcfa5e1 100644 --- a/lending/docs/pkg/models/shared/accountingsupplier.md +++ b/lending/docs/pkg/models/shared/accountingsupplier.md @@ -15,13 +15,13 @@ From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers | `ContactName` | **string* | :heavy_minus_sign: | Name of the main contact for the supplier. | | | `DefaultCurrency` | **string* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | | `EmailAddress` | **string* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | -| `ID` | **string* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting platform. | | +| `ID` | **string* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | | `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | | `Phone` | **string* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | | `RegistrationNumber` | **string* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | | `Status` | [shared.SupplierStatus](../../../pkg/models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `SupplierName` | **string* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | | `TaxNumber` | **string* | :heavy_minus_sign: | Supplier's company tax number. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingsuppliers.md b/lending/docs/pkg/models/shared/accountingsuppliers.md index 9bc4aeb2e..79a1acb7e 100644 --- a/lending/docs/pkg/models/shared/accountingsuppliers.md +++ b/lending/docs/pkg/models/shared/accountingsuppliers.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingSupplier](../../../pkg/models/shared/accountingsupplier.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingSupplier](../../../pkg/models/shared/accountingsupplier.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingtransfer.md b/lending/docs/pkg/models/shared/accountingtransfer.md index 65a4651d1..393f05428 100644 --- a/lending/docs/pkg/models/shared/accountingtransfer.md +++ b/lending/docs/pkg/models/shared/accountingtransfer.md @@ -9,7 +9,7 @@ A transfer records the movement of money between two bank accounts, or between a | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContactRef` | [*shared.ContactRef](../../../pkg/models/shared/contactref.md) | :heavy_minus_sign: | A customer or supplier associated with the direct cost. | | +| `ContactRef` | [*shared.ContactRef](../../../pkg/models/shared/contactref.md) | :heavy_minus_sign: | N/A | | | `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `DepositedRecordRefs` | [][shared.RecordRef](../../../pkg/models/shared/recordref.md) | :heavy_minus_sign: | List of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the _undeposited funds_ (or other holding) account within the transfer. | | | `Description` | **string* | :heavy_minus_sign: | Description of the transfer. | | @@ -18,6 +18,6 @@ A transfer records the movement of money between two bank accounts, or between a | `Metadata` | [*shared.Metadata](../../../pkg/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `To` | [*shared.TransferAccount](../../../pkg/models/shared/transferaccount.md) | :heavy_minus_sign: | Account details of the account sending or receiving the transfer. | | | `TrackingCategoryRefs` | [][shared.TrackingCategoryRef](../../../pkg/models/shared/trackingcategoryref.md) | :heavy_minus_sign: | Reference to the tracking categories this transfer is being tracked against. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountingtransfers.md b/lending/docs/pkg/models/shared/accountingtransfers.md index a6f9d8394..2e0e82fa2 100644 --- a/lending/docs/pkg/models/shared/accountingtransfers.md +++ b/lending/docs/pkg/models/shared/accountingtransfers.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.AccountingTransfer](../../../pkg/models/shared/accountingtransfer.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.AccountingTransfer](../../../pkg/models/shared/accountingtransfer.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accountprototype.md b/lending/docs/pkg/models/shared/accountprototype.md index 5045ba2a3..910532c89 100644 --- a/lending/docs/pkg/models/shared/accountprototype.md +++ b/lending/docs/pkg/models/shared/accountprototype.md @@ -14,6 +14,6 @@ | `Name` | **string* | :heavy_minus_sign: | Name of the account. | Accounts Receivable | | `NominalCode` | **string* | :heavy_minus_sign: | Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. | 610 | | `Status` | [*shared.AccountStatus](../../../pkg/models/shared/accountstatus.md) | :heavy_minus_sign: | Status of the account | Active | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `Type` | [*shared.AccountType](../../../pkg/models/shared/accounttype.md) | :heavy_minus_sign: | Type of account | Asset | | `ValidDatatypeLinks` | [][shared.ValidDataTypeLinks](../../../pkg/models/shared/validdatatypelinks.md) | :heavy_minus_sign: | The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/accounts.md b/lending/docs/pkg/models/shared/accounts.md index 20ee5e04f..888e29a37 100644 --- a/lending/docs/pkg/models/shared/accounts.md +++ b/lending/docs/pkg/models/shared/accounts.md @@ -11,4 +11,4 @@ | `Currency` | **string* | :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 | | `CurrentBalance` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The balance of the bank account. | | | `PlatformName` | **string* | :heavy_minus_sign: | Name of the banking data source, e.g. "Plaid". | | -| `SourceRef` | [*shared.SourceRef](../../../pkg/models/shared/sourceref.md) | :heavy_minus_sign: | A source reference containing the `sourceType` object "Banking". | {"Example":{"value":{"sourceRef":{"sourceType":"Banking"}}}} | \ No newline at end of file +| `SourceRef` | [*shared.SourceRef](../../../pkg/models/shared/sourceref.md) | :heavy_minus_sign: | A source reference containing the `sourceType` object "Banking". | {
"Example": {
"value": {
"sourceRef": {
"sourceType": "Banking"
}
}
}
} | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/allocation.md b/lending/docs/pkg/models/shared/allocation.md index 8982baae5..169c1064a 100644 --- a/lending/docs/pkg/models/shared/allocation.md +++ b/lending/docs/pkg/models/shared/allocation.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AllocatedOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `Currency` | **string* | :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 | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | -| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The total amount that has been allocated. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllocatedOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `Currency` | **string* | :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 | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The total amount that has been allocated. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/balancesheet.md b/lending/docs/pkg/models/shared/balancesheet.md index 3d5e242ba..f16ca2d7b 100644 --- a/lending/docs/pkg/models/shared/balancesheet.md +++ b/lending/docs/pkg/models/shared/balancesheet.md @@ -7,6 +7,6 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Assets` | [*shared.ReportLine](../../../pkg/models/shared/reportline.md) | :heavy_minus_sign: | N/A | | | `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `Equity` | [*shared.ReportLineInput](../../../pkg/models/shared/reportlineinput.md) | :heavy_minus_sign: | N/A | | -| `Liabilities` | [*shared.ReportLineInput](../../../pkg/models/shared/reportlineinput.md) | :heavy_minus_sign: | N/A | | +| `Equity` | [*shared.ReportLine](../../../pkg/models/shared/reportline.md) | :heavy_minus_sign: | N/A | | +| `Liabilities` | [*shared.ReportLine](../../../pkg/models/shared/reportline.md) | :heavy_minus_sign: | N/A | | | `NetAssets` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Value of net assets for a company in their base currency. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/bankaccountstatus.md b/lending/docs/pkg/models/shared/bankaccountstatus.md new file mode 100644 index 000000000..40d8b757e --- /dev/null +++ b/lending/docs/pkg/models/shared/bankaccountstatus.md @@ -0,0 +1,13 @@ +# BankAccountStatus + +Status of the bank account. + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `BankAccountStatusUnknown` | Unknown | +| `BankAccountStatusActive` | Active | +| `BankAccountStatusArchived` | Archived | +| `BankAccountStatusPending` | Pending | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/bankingaccountbalances.md b/lending/docs/pkg/models/shared/bankingaccountbalances.md index 7b0cd3e9a..7b39e8f42 100644 --- a/lending/docs/pkg/models/shared/bankingaccountbalances.md +++ b/lending/docs/pkg/models/shared/bankingaccountbalances.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.BankingAccountBalance](../../../pkg/models/shared/bankingaccountbalance.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.BankingAccountBalance](../../../pkg/models/shared/bankingaccountbalance.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/bankingaccounts.md b/lending/docs/pkg/models/shared/bankingaccounts.md index 841d74253..89be801d7 100644 --- a/lending/docs/pkg/models/shared/bankingaccounts.md +++ b/lending/docs/pkg/models/shared/bankingaccounts.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.BankingAccount](../../../pkg/models/shared/bankingaccount.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.BankingAccount](../../../pkg/models/shared/bankingaccount.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/bankingtransactioncategories.md b/lending/docs/pkg/models/shared/bankingtransactioncategories.md index 6fcf44965..94a9e88e1 100644 --- a/lending/docs/pkg/models/shared/bankingtransactioncategories.md +++ b/lending/docs/pkg/models/shared/bankingtransactioncategories.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.BankingTransactionCategory](../../../pkg/models/shared/bankingtransactioncategory.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.BankingTransactionCategory](../../../pkg/models/shared/bankingtransactioncategory.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/bankingtransactions.md b/lending/docs/pkg/models/shared/bankingtransactions.md index 1348d881e..bcecb61fb 100644 --- a/lending/docs/pkg/models/shared/bankingtransactions.md +++ b/lending/docs/pkg/models/shared/bankingtransactions.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.BankingTransaction](../../../pkg/models/shared/bankingtransaction.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.BankingTransaction](../../../pkg/models/shared/bankingtransaction.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/bankstatementuploadconfiguration.md b/lending/docs/pkg/models/shared/bankstatementuploadconfiguration.md new file mode 100644 index 000000000..e33663b08 --- /dev/null +++ b/lending/docs/pkg/models/shared/bankstatementuploadconfiguration.md @@ -0,0 +1,12 @@ +# BankStatementUploadConfiguration + +Configuration settings for uploading banking data to Codat + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `AccountID` | **string* | :heavy_minus_sign: | The ID of the account in the third-party platform | +| `ProviderID` | **string* | :heavy_minus_sign: | TrueLayer provider ID (only required if source is TrueLayer) | +| `Source` | [*shared.Source](../../../pkg/models/shared/source.md) | :heavy_minus_sign: | The source of the banking data that determines its format | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/billcreditnotelineitem.md b/lending/docs/pkg/models/shared/billcreditnotelineitem.md index d80a594a3..2c21fd313 100644 --- a/lending/docs/pkg/models/shared/billcreditnotelineitem.md +++ b/lending/docs/pkg/models/shared/billcreditnotelineitem.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountRef` | [*shared.AccountRef](../../../pkg/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. | +| `CreatedFromLineRef` | [*shared.Zero](../../../pkg/models/shared/zero.md) | :heavy_minus_sign: | Links the current record line to the underlying record line that created it.

For example, if a bill is generated from a purchase order, this property allows you to connect the bill line item to the purchase order line item in our data model. | | `Description` | **string* | :heavy_minus_sign: | Friendly name of each line item. For example, the goods or service for which credit has been received. | | `DiscountAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Value of any discounts applied. | | `DiscountPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Percentage rate of any discount applied to the line item. | @@ -17,4 +18,5 @@ | `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of the line item, including discounts and tax. | | `Tracking` | [*shared.AccountsPayableTracking](../../../pkg/models/shared/accountspayabletracking.md) | :heavy_minus_sign: | Categories, and a project and customer, against which the item is tracked. | | ~~`TrackingCategoryRefs`~~ | [][shared.TrackingCategoryRef](../../../pkg/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. | -| `UnitAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Unit price of the goods or service. | \ No newline at end of file +| `UnitAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Unit price of the goods or service. | +| `UnitOfMeasurement` | **string* | :heavy_minus_sign: | The measurement which defines a unit for this item (e.g. 'kilogram', 'litre'). | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/billedtotype1.md b/lending/docs/pkg/models/shared/billedtotype1.md deleted file mode 100644 index 8bd4aad41..000000000 --- a/lending/docs/pkg/models/shared/billedtotype1.md +++ /dev/null @@ -1,12 +0,0 @@ -# BilledToType1 - -Defines if the bill or bill credit note is billed/rebilled to a project. - - -## Values - -| Name | Value | -| ---------------------------- | ---------------------------- | -| `BilledToType1Unknown` | Unknown | -| `BilledToType1NotApplicable` | NotApplicable | -| `BilledToType1Project` | Project | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/billlineitemdatatype.md b/lending/docs/pkg/models/shared/billlineitemdatatype.md index b2bac4b23..93c93798d 100644 --- a/lending/docs/pkg/models/shared/billlineitemdatatype.md +++ b/lending/docs/pkg/models/shared/billlineitemdatatype.md @@ -7,4 +7,5 @@ Allowed name of the 'dataType'. | Name | Value | | ------------------------------------ | ------------------------------------ | -| `BillLineItemDataTypePurchaseOrders` | purchaseOrders | \ No newline at end of file +| `BillLineItemDataTypePurchaseOrders` | purchaseOrders | +| `BillLineItemDataTypeBills` | bills | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/billpaymentlinelink.md b/lending/docs/pkg/models/shared/billpaymentlinelink.md index 8b083134b..3592f5140 100644 --- a/lending/docs/pkg/models/shared/billpaymentlinelink.md +++ b/lending/docs/pkg/models/shared/billpaymentlinelink.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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. | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | -| `ID` | **string* | :heavy_minus_sign: | Unique identifier of the transaction represented by the link. | -| `Type` | [shared.BillPaymentLineLinkType](../../../pkg/models/shared/billpaymentlinelinktype.md) | :heavy_check_mark: | Types of links to bill payment lines. | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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. | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | +| `ID` | **string* | :heavy_minus_sign: | Unique identifier of the transaction represented by the link. | +| `Type` | [shared.BillPaymentLineLinkType](../../../pkg/models/shared/billpaymentlinelinktype.md) | :heavy_check_mark: | Types of links to bill payment lines. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/cashflowstatement.md b/lending/docs/pkg/models/shared/cashflowstatement.md index b82769ef4..a5cd567a3 100644 --- a/lending/docs/pkg/models/shared/cashflowstatement.md +++ b/lending/docs/pkg/models/shared/cashflowstatement.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `CashPayments` | [*shared.ReportLineInput](../../../pkg/models/shared/reportlineinput.md) | :heavy_minus_sign: | N/A | | -| `CashReceipts` | [*shared.ReportLineInput](../../../pkg/models/shared/reportlineinput.md) | :heavy_minus_sign: | N/A | | +| `CashPayments` | [*shared.ReportLine](../../../pkg/models/shared/reportline.md) | :heavy_minus_sign: | N/A | | +| `CashReceipts` | [*shared.ReportLine](../../../pkg/models/shared/reportline.md) | :heavy_minus_sign: | N/A | | | `FromDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `ToDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/clientratelimitreachedwebhook.md b/lending/docs/pkg/models/shared/clientratelimitreachedwebhook.md index 90223a07a..9d358404f 100644 --- a/lending/docs/pkg/models/shared/clientratelimitreachedwebhook.md +++ b/lending/docs/pkg/models/shared/clientratelimitreachedwebhook.md @@ -5,12 +5,12 @@ Webhook request body for a client that has reached their rate limit. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `AlertID` | **string* | :heavy_minus_sign: | Unique identifier of the webhook event. | -| `ClientID` | **string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | -| `ClientName` | **string* | :heavy_minus_sign: | Name of your client in Codat. | -| `Data` | [*shared.ClientRateLimitReachedWebhookData](../../../pkg/models/shared/clientratelimitreachedwebhookdata.md) | :heavy_minus_sign: | N/A | -| `Message` | **string* | :heavy_minus_sign: | A human readable message about the webhook. | -| `RuleID` | **string* | :heavy_minus_sign: | Unique identifier for the rule. | -| `RuleType` | **string* | :heavy_minus_sign: | The type of rule. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AlertID` | **string* | :heavy_minus_sign: | Unique identifier of the webhook event. | +| `ClientID` | **string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | +| `ClientName` | **string* | :heavy_minus_sign: | Name of your client in Codat. | +| `Data` | [*shared.ClientRateLimitReachedWebhookData](../../../pkg/models/shared/clientratelimitreachedwebhookdata.md) | :heavy_minus_sign: | N/A | +| `Message` | **string* | :heavy_minus_sign: | A human-readable message about the webhook. | +| ~~`RuleID`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | +| `RuleType` | **string* | :heavy_minus_sign: | The type of rule. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/clientratelimitresetwebhook.md b/lending/docs/pkg/models/shared/clientratelimitresetwebhook.md index 07a4bdf32..8223885e3 100644 --- a/lending/docs/pkg/models/shared/clientratelimitresetwebhook.md +++ b/lending/docs/pkg/models/shared/clientratelimitresetwebhook.md @@ -5,12 +5,12 @@ Webhook request body for a client that has had their rate limit reset. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `AlertID` | **string* | :heavy_minus_sign: | Unique identifier of the webhook event. | -| `ClientID` | **string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | -| `ClientName` | **string* | :heavy_minus_sign: | Name of your client in Codat. | -| `Data` | [*shared.ClientRateLimitResetWebhookData](../../../pkg/models/shared/clientratelimitresetwebhookdata.md) | :heavy_minus_sign: | N/A | -| `Message` | **string* | :heavy_minus_sign: | A human readable message about the webhook. | -| `RuleID` | **string* | :heavy_minus_sign: | Unique identifier for the rule. | -| `RuleType` | **string* | :heavy_minus_sign: | The type of rule. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AlertID` | **string* | :heavy_minus_sign: | Unique identifier of the webhook event. | +| `ClientID` | **string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | +| `ClientName` | **string* | :heavy_minus_sign: | Name of your client in Codat. | +| `Data` | [*shared.ClientRateLimitResetWebhookData](../../../pkg/models/shared/clientratelimitresetwebhookdata.md) | :heavy_minus_sign: | N/A | +| `Message` | **string* | :heavy_minus_sign: | A human-readable message about the webhook. | +| ~~`RuleID`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | +| `RuleType` | **string* | :heavy_minus_sign: | The type of rule. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/clientratelimitresetwebhookdata.md b/lending/docs/pkg/models/shared/clientratelimitresetwebhookdata.md index b06f48df7..f5af03570 100644 --- a/lending/docs/pkg/models/shared/clientratelimitresetwebhookdata.md +++ b/lending/docs/pkg/models/shared/clientratelimitresetwebhookdata.md @@ -7,5 +7,5 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `DailyQuota` | **int64* | :heavy_minus_sign: | The number of available requests per day. | | | `ExpiresUtc` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `QuotaRemaining` | **int64* | :heavy_minus_sign: | Total number of request remaining for your client. | | +| `QuotaRemaining` | **int64* | :heavy_minus_sign: | Total number of requests remaining for your client. | | | `ResetReason` | **string* | :heavy_minus_sign: | The reason for your rate limit quota being reset. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/clientratelimitwebhook.md b/lending/docs/pkg/models/shared/clientratelimitwebhook.md new file mode 100644 index 000000000..99c7948dd --- /dev/null +++ b/lending/docs/pkg/models/shared/clientratelimitwebhook.md @@ -0,0 +1,11 @@ +# ClientRateLimitWebhook + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `EventType` | **string* | :heavy_minus_sign: | The type of event. | client.rateLimit.reset | +| `GeneratedDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `ID` | **string* | :heavy_minus_sign: | Unique identifier of the event. | 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b | +| `Payload` | [*shared.ClientRateLimitWebhookPayload](../../../pkg/models/shared/clientratelimitwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/clientratelimitwebhookpayload.md b/lending/docs/pkg/models/shared/clientratelimitwebhookpayload.md new file mode 100644 index 000000000..1688f2650 --- /dev/null +++ b/lending/docs/pkg/models/shared/clientratelimitwebhookpayload.md @@ -0,0 +1,10 @@ +# ClientRateLimitWebhookPayload + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `DailyQuota` | **int64* | :heavy_minus_sign: | The number of available requests per day. | | +| `ExpiryDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `QuotaRemaining` | **int64* | :heavy_minus_sign: | Total number of requests remaining for your client. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/codatfile.md b/lending/docs/pkg/models/shared/codatfile.md index 0f76ad4e2..27ca6f0e2 100644 --- a/lending/docs/pkg/models/shared/codatfile.md +++ b/lending/docs/pkg/models/shared/codatfile.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `Content` | *[]byte* | :heavy_check_mark: | N/A | +| `Content` | *any* | :heavy_check_mark: | N/A | | `FileName` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/commercecompanyinfo.md b/lending/docs/pkg/models/shared/commercecompanyinfo.md index 64e7971b9..fcb2b1e66 100644 --- a/lending/docs/pkg/models/shared/commercecompanyinfo.md +++ b/lending/docs/pkg/models/shared/commercecompanyinfo.md @@ -14,7 +14,7 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | `AccountBalances` | [][shared.AccountBalance](../../../pkg/models/shared/accountbalance.md) | :heavy_minus_sign: | The available and current cash balances for the company's accounts | | | `Addresses` | [][shared.CommerceAddress](../../../pkg/models/shared/commerceaddress.md) | :heavy_minus_sign: | Addresses associated with the company | | | `BaseCurrency` | **string* | :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 | -| `CommercePlatformRef` | **string* | :heavy_minus_sign: | Identifier or reference for the company in the commerce platform | | +| `CommercePlatformRef` | **string* | :heavy_minus_sign: | Identifier or reference for the company in the commerce software | | | `CompanyLegalName` | **string* | :heavy_minus_sign: | The full legal name of the company | Codat Limited | | `CompanyName` | **string* | :heavy_minus_sign: | The name of the company | Codat | | `CreatedDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | @@ -22,5 +22,5 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | `PhoneNumbers` | [][shared.PhoneNumber](../../../pkg/models/shared/phonenumber.md) | :heavy_minus_sign: | Phone numbers associated with the company | | | `RegistrationNumber` | **string* | :heavy_minus_sign: | The registration number of the company | 10480375 | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `SourceUrls` | map[string]*string* | :heavy_minus_sign: | URL addresses for the originating system. For example, potential use cases include 'deeplinking' to the originating system | {"url1":"https://connect.sandbox.com/v2/customers","url2":"https://connect.sandbox.com/v2/disputes"} | +| `SourceUrls` | map[string]*string* | :heavy_minus_sign: | URL addresses for the originating system. For example, potential use cases include 'deeplinking' to the originating system | {
"url1": "https://connect.sandbox.com/v2/customers",
"url2": "https://connect.sandbox.com/v2/disputes"
} | | `WebLinks` | [][shared.WebLink](../../../pkg/models/shared/weblink.md) | :heavy_minus_sign: | Weblinks associated with the company | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/commercecustomers.md b/lending/docs/pkg/models/shared/commercecustomers.md index e21e0ab46..36d60036c 100644 --- a/lending/docs/pkg/models/shared/commercecustomers.md +++ b/lending/docs/pkg/models/shared/commercecustomers.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.CommerceCustomer](../../../pkg/models/shared/commercecustomer.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.CommerceCustomer](../../../pkg/models/shared/commercecustomer.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/commercedispute.md b/lending/docs/pkg/models/shared/commercedispute.md index 5b9a9c802..f63e80364 100644 --- a/lending/docs/pkg/models/shared/commercedispute.md +++ b/lending/docs/pkg/models/shared/commercedispute.md @@ -23,4 +23,4 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | `Reason` | **string* | :heavy_minus_sign: | Reason for the dispute | Unhappy with product | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | | `Status` | [*shared.DisputeStatus](../../../pkg/models/shared/disputestatus.md) | :heavy_minus_sign: | Current status of the dispute | EvidenceRequired | -| `TotalAmount` | *interface{}* | :heavy_minus_sign: | Total transaction amount that is under dispute. | 194.12 | \ No newline at end of file +| `TotalAmount` | *any* | :heavy_minus_sign: | Total transaction amount that is under dispute. | 194.12 | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/commercedisputes.md b/lending/docs/pkg/models/shared/commercedisputes.md index 0796c774c..dc9dd4300 100644 --- a/lending/docs/pkg/models/shared/commercedisputes.md +++ b/lending/docs/pkg/models/shared/commercedisputes.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.CommerceDispute](../../../pkg/models/shared/commercedispute.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.CommerceDispute](../../../pkg/models/shared/commercedispute.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/commercelocations.md b/lending/docs/pkg/models/shared/commercelocations.md index bc8db9f6c..2c66c6cdb 100644 --- a/lending/docs/pkg/models/shared/commercelocations.md +++ b/lending/docs/pkg/models/shared/commercelocations.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.CommerceLocation](../../../pkg/models/shared/commercelocation.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.CommerceLocation](../../../pkg/models/shared/commercelocation.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/commerceorder.md b/lending/docs/pkg/models/shared/commerceorder.md index 7f058ef8f..322ed339a 100644 --- a/lending/docs/pkg/models/shared/commerceorder.md +++ b/lending/docs/pkg/models/shared/commerceorder.md @@ -23,7 +23,7 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | `Payments` | [][shared.PaymentRef](../../../pkg/models/shared/paymentref.md) | :heavy_minus_sign: | N/A | | | `ServiceCharges` | [][shared.ServiceCharge](../../../pkg/models/shared/servicecharge.md) | :heavy_minus_sign: | N/A | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of the order, including discounts, refunds, and tax, but excluding gratuities. | | | `TotalDiscount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of any discounts applied to the order, excluding tax. This is typically positive (for discounts which decrease the amount of the order), but can also be negative (for discounts which increase the amount of the order). | | | `TotalGratuity` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Extra amount added to the order. | | diff --git a/lending/docs/pkg/models/shared/commerceorders.md b/lending/docs/pkg/models/shared/commerceorders.md index 1da134c4f..57d4f87e5 100644 --- a/lending/docs/pkg/models/shared/commerceorders.md +++ b/lending/docs/pkg/models/shared/commerceorders.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.CommerceOrder](../../../pkg/models/shared/commerceorder.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.CommerceOrder](../../../pkg/models/shared/commerceorder.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/commercepayment.md b/lending/docs/pkg/models/shared/commercepayment.md index 67d55d53a..f101f3c97 100644 --- a/lending/docs/pkg/models/shared/commercepayment.md +++ b/lending/docs/pkg/models/shared/commercepayment.md @@ -19,8 +19,8 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | `DueDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `ID` | *string* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | | `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `PaymentMethodRef` | [*shared.PaymentMethodRef](../../../pkg/models/shared/paymentmethodref.md) | :heavy_minus_sign: | The payment method the record is linked to in the accounting or commerce platform. | {"id":"EILBDVJVNUAGVKRQ","name":"AliPay"} | +| `PaymentMethodRef` | [*shared.PaymentMethodRef](../../../pkg/models/shared/paymentmethodref.md) | :heavy_minus_sign: | The payment method the record is linked to in the accounting or commerce software. | {
"id": "EILBDVJVNUAGVKRQ",
"name": "AliPay"
} | | `PaymentProvider` | **string* | :heavy_minus_sign: | Service provider of the payment, if applicable. | Amazon Pay | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | | `Status` | [*shared.PaymentStatus](../../../pkg/models/shared/paymentstatus.md) | :heavy_minus_sign: | Status of the payment. | | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | \ No newline at end of file +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/commercepaymentmethods.md b/lending/docs/pkg/models/shared/commercepaymentmethods.md index 35f471aa2..8f422a1e1 100644 --- a/lending/docs/pkg/models/shared/commercepaymentmethods.md +++ b/lending/docs/pkg/models/shared/commercepaymentmethods.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.CommercePaymentMethod](../../../pkg/models/shared/commercepaymentmethod.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.CommercePaymentMethod](../../../pkg/models/shared/commercepaymentmethod.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/commercepayments.md b/lending/docs/pkg/models/shared/commercepayments.md index 115ecb0a0..00ddebf0c 100644 --- a/lending/docs/pkg/models/shared/commercepayments.md +++ b/lending/docs/pkg/models/shared/commercepayments.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.CommercePayment](../../../pkg/models/shared/commercepayment.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.CommercePayment](../../../pkg/models/shared/commercepayment.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/commerceproduct.md b/lending/docs/pkg/models/shared/commerceproduct.md index f41f25a8e..1eac9e341 100644 --- a/lending/docs/pkg/models/shared/commerceproduct.md +++ b/lending/docs/pkg/models/shared/commerceproduct.md @@ -15,5 +15,5 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | `ID` | *string* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | | `IsGiftCard` | **bool* | :heavy_minus_sign: | Whether the product represents a gift card or voucher that
can be redeemed in the commerce or POS platform.
| | | `Name` | **string* | :heavy_minus_sign: | Name of the product in the commerce or POS system | Hard Drive | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `Variants` | [][shared.ProductVariant](../../../pkg/models/shared/productvariant.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/commerceproductcategories.md b/lending/docs/pkg/models/shared/commerceproductcategories.md index a2ea23d25..e10faa156 100644 --- a/lending/docs/pkg/models/shared/commerceproductcategories.md +++ b/lending/docs/pkg/models/shared/commerceproductcategories.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.CommerceProductCategory](../../../pkg/models/shared/commerceproductcategory.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.CommerceProductCategory](../../../pkg/models/shared/commerceproductcategory.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/commerceproducts.md b/lending/docs/pkg/models/shared/commerceproducts.md index 1df8d4370..e33c18c27 100644 --- a/lending/docs/pkg/models/shared/commerceproducts.md +++ b/lending/docs/pkg/models/shared/commerceproducts.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.CommerceProduct](../../../pkg/models/shared/commerceproduct.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.CommerceProduct](../../../pkg/models/shared/commerceproduct.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/commercetransaction.md b/lending/docs/pkg/models/shared/commercetransaction.md index 6032d8622..c50e1f8c9 100644 --- a/lending/docs/pkg/models/shared/commercetransaction.md +++ b/lending/docs/pkg/models/shared/commercetransaction.md @@ -22,8 +22,8 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | | `SourceCreatedDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `SubType` | **string* | :heavy_minus_sign: | Non-standardised transaction type data from the commerce platform | CardPayment | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | +| `SubType` | **string* | :heavy_minus_sign: | Non-standardised transaction type data from the commerce software | CardPayment | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The total transaction amount | 194.12 | | `TransactionSourceRef` | [*shared.TransactionSourceRef](../../../pkg/models/shared/transactionsourceref.md) | :heavy_minus_sign: | Link to the source event which triggered this transaction | | | `Type` | [*shared.TransactionType](../../../pkg/models/shared/transactiontype.md) | :heavy_minus_sign: | The type of the platform transaction:
- `Unknown`
- `FailedPayout` — Failed transfer of funds from the seller's merchant account to their bank account.
- `Payment` — Credit and debit card payments.
- `PaymentFee` — Payment provider's fee on each card payment.
- `PaymentFeeRefund` — Payment provider's fee that has been refunded to the seller.
- `Payout` — Transfer of funds from the seller's merchant account to their bank account.
- `Refund` — Refunds to a customer's credit or debit card.
- `Transfer` — Secure transfer of funds to the seller's bank account. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/commercetransactions.md b/lending/docs/pkg/models/shared/commercetransactions.md index 71deb2569..bbfde3de4 100644 --- a/lending/docs/pkg/models/shared/commercetransactions.md +++ b/lending/docs/pkg/models/shared/commercetransactions.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.CommerceTransaction](../../../pkg/models/shared/commercetransaction.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.CommerceTransaction](../../../pkg/models/shared/commercetransaction.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/companies.md b/lending/docs/pkg/models/shared/companies.md index 156a1bbad..320f6c913 100644 --- a/lending/docs/pkg/models/shared/companies.md +++ b/lending/docs/pkg/models/shared/companies.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.Company](../../../pkg/models/shared/company.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.Company](../../../pkg/models/shared/company.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/company.md b/lending/docs/pkg/models/shared/company.md index cc25c3a96..61cfcc924 100644 --- a/lending/docs/pkg/models/shared/company.md +++ b/lending/docs/pkg/models/shared/company.md @@ -15,9 +15,8 @@ When you create a company, you can specify a `name` and we will automatically ge | `CreatedByUserName` | **string* | :heavy_minus_sign: | Name of user that created the company in Codat. | | | `DataConnections` | [][shared.Connection](../../../pkg/models/shared/connection.md) | :heavy_minus_sign: | N/A | | | `Description` | **string* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | -| `Groups` | [][shared.GroupReference](../../../pkg/models/shared/groupreference.md) | :heavy_minus_sign: | An array of groups the company has been assigned to. | | | `ID` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `LastSync` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `Name` | *string* | :heavy_check_mark: | The name of the company | Codat Ltd. | -| ~~`Platform`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

`platformKeys` name used when creating the company. | Xero | -| `Redirect` | *string* | :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 +| `Redirect` | *string* | :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 | +| `Tags` | [*shared.Tags](../../../pkg/models/shared/tags.md) | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/companyrequestbody.md b/lending/docs/pkg/models/shared/companyrequestbody.md index ce44d69ac..0b7b5533c 100644 --- a/lending/docs/pkg/models/shared/companyrequestbody.md +++ b/lending/docs/pkg/models/shared/companyrequestbody.md @@ -6,5 +6,5 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | | `Description` | **string* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | -| `Groups` | [][shared.Items](../../../pkg/models/shared/items.md) | :heavy_minus_sign: | Reference to the groups that the company is assigned to. | | +| `Groups` | [][shared.GroupReference](../../../pkg/models/shared/groupreference.md) | :heavy_minus_sign: | Reference to the groups that the company is assigned to. | | | `Name` | *string* | :heavy_check_mark: | Name of company being connected. | Bank of Dave | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/connection.md b/lending/docs/pkg/models/shared/connection.md index b9eca0011..943b6c532 100644 --- a/lending/docs/pkg/models/shared/connection.md +++ b/lending/docs/pkg/models/shared/connection.md @@ -16,7 +16,7 @@ Before you can use a data connection to pull or push data, the company must gran | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AdditionalProperties` | *interface{}* | :heavy_minus_sign: | N/A | | +| `AdditionalProperties` | *any* | :heavy_minus_sign: | N/A | | | `ConnectionInfo` | map[string]*string* | :heavy_minus_sign: | N/A | | | `Created` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `DataConnectionErrors` | [][shared.DataConnectionError](../../../pkg/models/shared/dataconnectionerror.md) | :heavy_minus_sign: | N/A | | diff --git a/lending/docs/pkg/models/shared/connections.md b/lending/docs/pkg/models/shared/connections.md index 7a7decfe8..4fe3ef571 100644 --- a/lending/docs/pkg/models/shared/connections.md +++ b/lending/docs/pkg/models/shared/connections.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.Connection](../../../pkg/models/shared/connection.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.Connection](../../../pkg/models/shared/connection.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/contactref.md b/lending/docs/pkg/models/shared/contactref.md index 421065be1..ab733d1b2 100644 --- a/lending/docs/pkg/models/shared/contactref.md +++ b/lending/docs/pkg/models/shared/contactref.md @@ -1,7 +1,5 @@ # ContactRef -A customer or supplier associated with the direct cost. - ## Fields diff --git a/lending/docs/pkg/models/shared/contactreference.md b/lending/docs/pkg/models/shared/contactreference.md index 4af48aff9..2bdc8bae1 100644 --- a/lending/docs/pkg/models/shared/contactreference.md +++ b/lending/docs/pkg/models/shared/contactreference.md @@ -1,11 +1,9 @@ # ContactReference -A customer or supplier associated with the direct cost. - ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `DataType` | [*shared.DirectCostPrototypeDataType](../../../pkg/models/shared/directcostprototypedatatype.md) | :heavy_minus_sign: | Allowed name of the 'dataType'. | -| `ID` | *string* | :heavy_check_mark: | Unique identifier for a customer or supplier. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `DataType` | [*shared.JournalLineDataType](../../../pkg/models/shared/journallinedatatype.md) | :heavy_minus_sign: | Allowed name of the 'dataType'. | +| `ID` | *string* | :heavy_check_mark: | Unique identifier for a customer or supplier. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/createbankaccounttransaction.md b/lending/docs/pkg/models/shared/createbankaccounttransaction.md index 7607626fd..64fbdbb68 100644 --- a/lending/docs/pkg/models/shared/createbankaccounttransaction.md +++ b/lending/docs/pkg/models/shared/createbankaccounttransaction.md @@ -9,4 +9,4 @@ | `Balance` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The remaining balance in the account with ID `accountId`. | | | `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `Description` | **string* | :heavy_minus_sign: | Description of the bank transaction. | | -| `ID` | **string* | :heavy_minus_sign: | Identifier for the bank account transaction, unique for the company in the accounting platform. | | \ No newline at end of file +| `ID` | **string* | :heavy_minus_sign: | Identifier for the bank account transaction, unique for the company in the accounting software. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/dataconnectionerror.md b/lending/docs/pkg/models/shared/dataconnectionerror.md index 350df632c..1d234b89a 100644 --- a/lending/docs/pkg/models/shared/dataconnectionerror.md +++ b/lending/docs/pkg/models/shared/dataconnectionerror.md @@ -5,7 +5,9 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ErrorMessage` | **string* | :heavy_minus_sign: | A brief message about the error. | | +| `ErrorMessage` | **string* | :heavy_minus_sign: | A message about a error returned by Codat. | | | `ErroredOnUtc` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `StatusCode` | **string* | :heavy_minus_sign: | The HTTP status code returned by the error. | | -| `StatusText` | **string* | :heavy_minus_sign: | A non-numeric status code/text. | | \ No newline at end of file +| `ResolvedOnUtc` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `Status` | [*shared.ErrorStatus](../../../pkg/models/shared/errorstatus.md) | :heavy_minus_sign: | The current status of a transient error. Null statuses indicate that the error is not transient. | | +| `StatusCode` | **string* | :heavy_minus_sign: | The HTTP status code returned by the source platform when the error occurred. | | +| `StatusText` | **string* | :heavy_minus_sign: | A non-numeric status code/text returned by the source platform when the error occurred. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/dataintegritydetails.md b/lending/docs/pkg/models/shared/dataintegritydetails.md index 02dd4dacc..e08cedf6d 100644 --- a/lending/docs/pkg/models/shared/dataintegritydetails.md +++ b/lending/docs/pkg/models/shared/dataintegritydetails.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.DataIntegrityDetail](../../../pkg/models/shared/dataintegritydetail.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.DataIntegrityDetail](../../../pkg/models/shared/dataintegritydetail.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/datasetstatus.md b/lending/docs/pkg/models/shared/datasetstatus.md new file mode 100644 index 000000000..c9fa2f03b --- /dev/null +++ b/lending/docs/pkg/models/shared/datasetstatus.md @@ -0,0 +1,30 @@ +# DatasetStatus + +The current status of the dataset. + + +## Values + +| Name | Value | +| --------------------------------- | --------------------------------- | +| `DatasetStatusInitial` | Initial | +| `DatasetStatusQueued` | Queued | +| `DatasetStatusFetching` | Fetching | +| `DatasetStatusMapQueued` | MapQueued | +| `DatasetStatusMapping` | Mapping | +| `DatasetStatusComplete` | Complete | +| `DatasetStatusFetchError` | FetchError | +| `DatasetStatusMapError` | MapError | +| `DatasetStatusInternalError` | InternalError | +| `DatasetStatusProcessingQueued` | ProcessingQueued | +| `DatasetStatusProcessing` | Processing | +| `DatasetStatusProcessingError` | ProcessingError | +| `DatasetStatusValidationQueued` | ValidationQueued | +| `DatasetStatusValidating` | Validating | +| `DatasetStatusValidationError` | ValidationError | +| `DatasetStatusAuthError` | AuthError | +| `DatasetStatusCancelled` | Cancelled | +| `DatasetStatusNotSupported` | NotSupported | +| `DatasetStatusRateLimitError` | RateLimitError | +| `DatasetStatusPermissionsError` | PermissionsError | +| `DatasetStatusPrerequisiteNotMet` | PrerequisiteNotMet | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/datastatus.md b/lending/docs/pkg/models/shared/datastatus.md index 7411ca2c9..08183a434 100644 --- a/lending/docs/pkg/models/shared/datastatus.md +++ b/lending/docs/pkg/models/shared/datastatus.md @@ -7,8 +7,8 @@ Describes the state of data in the Codat cache for a company and data type | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `CurrentStatus` | *string* | :heavy_check_mark: | The current status of the dataset in Codat's cache. | | -| `DataType` | [shared.DataTypes](../../../pkg/models/shared/datatypes.md) | :heavy_check_mark: | Available Data types | invoices | +| `CurrentStatus` | [shared.Status](../../../pkg/models/shared/status.md) | :heavy_check_mark: | The current status of the dataset. | | +| `DataType` | [shared.DataTypes](../../../pkg/models/shared/datatypes.md) | :heavy_check_mark: | Available data types | invoices | | `LastSuccessfulSync` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `LatestSuccessfulSyncID` | **string* | :heavy_minus_sign: | Unique identifier for the most recent successful sync of data type. | 8220fc90-55b6-47bc-9417-48ac6ea93101 | | `LatestSyncID` | **string* | :heavy_minus_sign: | Unique identifier for most recent sync of data type. | ad474a37-2003-478e-baee-9af9f1ec2fe3 | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/datatype.md b/lending/docs/pkg/models/shared/datatype.md index 550f76533..a44e87a38 100644 --- a/lending/docs/pkg/models/shared/datatype.md +++ b/lending/docs/pkg/models/shared/datatype.md @@ -1,6 +1,6 @@ # DataType -Available Data types +Available data types ## Values diff --git a/lending/docs/pkg/models/shared/datatypes.md b/lending/docs/pkg/models/shared/datatypes.md index 3aa7e83b1..61fa6bc31 100644 --- a/lending/docs/pkg/models/shared/datatypes.md +++ b/lending/docs/pkg/models/shared/datatypes.md @@ -1,6 +1,6 @@ # DataTypes -Available Data types +Available data types ## Values diff --git a/lending/docs/pkg/models/shared/directcostprototype.md b/lending/docs/pkg/models/shared/directcostprototype.md index f9653f0ad..18f529300 100644 --- a/lending/docs/pkg/models/shared/directcostprototype.md +++ b/lending/docs/pkg/models/shared/directcostprototype.md @@ -3,17 +3,17 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContactRef` | [*shared.ContactReference](../../../pkg/models/shared/contactreference.md) | :heavy_minus_sign: | A customer or supplier associated with the direct cost. | | -| `Currency` | *string* | :heavy_check_mark: | 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 | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | -| `IssueDate` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `LineItems` | [][shared.DirectCostLineItem](../../../pkg/models/shared/directcostlineitem.md) | :heavy_check_mark: | An array of line items. | | -| `Note` | **string* | :heavy_minus_sign: | A note attached to the direct cost. | | -| `PaymentAllocations` | [][shared.AccountingPaymentAllocation](../../../pkg/models/shared/accountingpaymentallocation.md) | :heavy_check_mark: | An array of payment allocations. | | -| `Reference` | **string* | :heavy_minus_sign: | User-friendly reference for the direct cost. | | -| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of the direct costs, excluding any taxes. | | -| `SupplementalData` | [*shared.SupplementalData](../../../pkg/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/supplemental-data/overview) about supplemental data. | | -| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of tax on the direct costs. | | -| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The amount of the direct costs, inclusive of tax. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContactRef` | [*shared.ContactRef](../../../pkg/models/shared/contactref.md) | :heavy_minus_sign: | N/A | | +| `Currency` | *string* | :heavy_check_mark: | 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 | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `IssueDate` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `LineItems` | [][shared.DirectCostLineItem](../../../pkg/models/shared/directcostlineitem.md) | :heavy_check_mark: | An array of line items. | | +| `Note` | **string* | :heavy_minus_sign: | A note attached to the direct cost. | | +| `PaymentAllocations` | [][shared.AccountingPaymentAllocation](../../../pkg/models/shared/accountingpaymentallocation.md) | :heavy_check_mark: | An array of payment allocations. | | +| `Reference` | **string* | :heavy_minus_sign: | User-friendly reference for the direct cost. | | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of the direct costs, excluding any taxes. | | +| `SupplementalData` | [*shared.SupplementalData](../../../pkg/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of tax on the direct costs. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The amount of the direct costs, inclusive of tax. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/directcostprototypedatatype.md b/lending/docs/pkg/models/shared/directcostprototypedatatype.md deleted file mode 100644 index 867352c23..000000000 --- a/lending/docs/pkg/models/shared/directcostprototypedatatype.md +++ /dev/null @@ -1,11 +0,0 @@ -# DirectCostPrototypeDataType - -Allowed name of the 'dataType'. - - -## Values - -| Name | Value | -| -------------------------------------- | -------------------------------------- | -| `DirectCostPrototypeDataTypeCustomers` | customers | -| `DirectCostPrototypeDataTypeSuppliers` | suppliers | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/enduploadsessionrequest.md b/lending/docs/pkg/models/shared/enduploadsessionrequest.md new file mode 100644 index 000000000..4ded490d4 --- /dev/null +++ b/lending/docs/pkg/models/shared/enduploadsessionrequest.md @@ -0,0 +1,8 @@ +# EndUploadSessionRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `Status` | [*shared.EndUploadSessionRequestStatus](../../../pkg/models/shared/enduploadsessionrequeststatus.md) | :heavy_minus_sign: | An indicator to cancel the dataset processing or trigger ingestion and enrichment of data. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/enduploadsessionrequeststatus.md b/lending/docs/pkg/models/shared/enduploadsessionrequeststatus.md new file mode 100644 index 000000000..7699f2ef3 --- /dev/null +++ b/lending/docs/pkg/models/shared/enduploadsessionrequeststatus.md @@ -0,0 +1,11 @@ +# EndUploadSessionRequestStatus + +An indicator to cancel the dataset processing or trigger ingestion and enrichment of data. + + +## Values + +| Name | Value | +| -------------------------------------- | -------------------------------------- | +| `EndUploadSessionRequestStatusCancel` | Cancel | +| `EndUploadSessionRequestStatusProcess` | Process | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/enhancedcashflowtransaction.md b/lending/docs/pkg/models/shared/enhancedcashflowtransaction.md index b40d08e0a..038bbd8d6 100644 --- a/lending/docs/pkg/models/shared/enhancedcashflowtransaction.md +++ b/lending/docs/pkg/models/shared/enhancedcashflowtransaction.md @@ -7,10 +7,12 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountRef` | [*shared.AccountRef](../../../pkg/models/shared/accountref.md) | :heavy_minus_sign: | An account reference containing the account id and name. | | | `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The bank transaction amount. | | +| `CounterpartyNames` | []*string* | :heavy_minus_sign: | An array of counterparty names involved in the transaction. | | | `Currency` | **string* | :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 | | `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `Description` | **string* | :heavy_minus_sign: | The description of the bank transaction. | | | `ID` | **string* | :heavy_minus_sign: | The unique identifier of the bank transaction. | | +| `ModifiedDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `PlatformName` | **string* | :heavy_minus_sign: | Returns the payment processor responsible for the transaction. | | -| `SourceRef` | [*shared.SourceRef](../../../pkg/models/shared/sourceref.md) | :heavy_minus_sign: | A source reference containing the `sourceType` object "Banking". | {"Example":{"value":{"sourceRef":{"sourceType":"Banking"}}}} | -| `TransactionCategory` | [*shared.TransactionCategory](../../../pkg/models/shared/transactioncategory.md) | :heavy_minus_sign: | N/A | {"Example":{"value":{"transactionCategory":{"confidence":92.7,"levels":["Asset","Current","Bank","BankTransfers","ShareholderTransfers"]}}}} | \ No newline at end of file +| `SourceRef` | [*shared.SourceRef](../../../pkg/models/shared/sourceref.md) | :heavy_minus_sign: | A source reference containing the `sourceType` object "Banking". | {
"Example": {
"value": {
"sourceRef": {
"sourceType": "Banking"
}
}
}
} | +| `TransactionCategory` | [*shared.TransactionCategory](../../../pkg/models/shared/transactioncategory.md) | :heavy_minus_sign: | N/A | {
"Example": {
"value": {
"transactionCategory": {
"confidence": 92.7,
"levels": [
"Asset",
"Current",
"Bank",
"BankTransfers",
"ShareholderTransfers"
],
"confidences": [
92.7,
95,
96,
97.5,
100
]
}
}
}
} | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/enhancedcashflowtransactions.md b/lending/docs/pkg/models/shared/enhancedcashflowtransactions.md index dce5fe6c1..4567c1a7d 100644 --- a/lending/docs/pkg/models/shared/enhancedcashflowtransactions.md +++ b/lending/docs/pkg/models/shared/enhancedcashflowtransactions.md @@ -9,8 +9,8 @@ The Enhanced Cash Flow Transactions endpoint provides a fully categorized list o ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `DataSources` | [][shared.DataSource](../../../pkg/models/shared/datasource.md) | :heavy_minus_sign: | N/A | | -| `ReportInfo` | [*shared.ReportInfo](../../../pkg/models/shared/reportinfo.md) | :heavy_minus_sign: | Report additional information, which is specific to Lending API reports. | {"Example 1":{"value":{"pageNumber":0,"pageSize":0,"totalResults":0,"reportName":"string","companyName":"string","generatedDate":"2023-01-26T07:36:40.487Z"}}} | -| `ReportItems` | [][shared.EnhancedCashFlowItem](../../../pkg/models/shared/enhancedcashflowitem.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `DataSources` | [][shared.DataSource](../../../pkg/models/shared/datasource.md) | :heavy_minus_sign: | N/A | | +| `ReportInfo` | [*shared.ReportInfo](../../../pkg/models/shared/reportinfo.md) | :heavy_minus_sign: | Report additional information, which is specific to Lending API reports. | {
"Example 1": {
"value": {
"pageNumber": 0,
"pageSize": 0,
"totalResults": 0,
"reportName": "string",
"companyName": "string",
"generatedDate": "2023-01-26T07:36:40.487Z"
}
}
} | +| `ReportItems` | [][shared.EnhancedCashFlowItem](../../../pkg/models/shared/enhancedcashflowitem.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/enhancedinvoicereportitem.md b/lending/docs/pkg/models/shared/enhancedinvoicereportitem.md index 1165d9622..986e50a3b 100644 --- a/lending/docs/pkg/models/shared/enhancedinvoicereportitem.md +++ b/lending/docs/pkg/models/shared/enhancedinvoicereportitem.md @@ -9,7 +9,7 @@ | `Currency` | **string* | :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 | | `CustomerRef` | [*shared.LendingCustomerRef](../../../pkg/models/shared/lendingcustomerref.md) | :heavy_minus_sign: | N/A | | | `DueDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `ID` | **string* | :heavy_minus_sign: | ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. | | +| `ID` | **string* | :heavy_minus_sign: | ID of the invoice, which may be a GUID but it may be something else depending on the accounting software. | | | `InvoiceNumber` | **string* | :heavy_minus_sign: | Invoice number. | | | `IssueDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | diff --git a/lending/docs/pkg/models/shared/enhancedinvoicesreport.md b/lending/docs/pkg/models/shared/enhancedinvoicesreport.md index 04cfcc6c4..280559d3f 100644 --- a/lending/docs/pkg/models/shared/enhancedinvoicesreport.md +++ b/lending/docs/pkg/models/shared/enhancedinvoicesreport.md @@ -1,11 +1,11 @@ # EnhancedInvoicesReport -The enhanced invoices report takes the key elements of the Invoices report verifying those marked as paid in the accounting platform have actually been paid by matching with the bank statement. +The enhanced invoices report takes the key elements of the Invoices report verifying those marked as paid in the accounting software have actually been paid by matching with the bank statement. ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ReportInfo` | [*shared.ReportInfo](../../../pkg/models/shared/reportinfo.md) | :heavy_minus_sign: | Report additional information, which is specific to Lending API reports. | {"Example 1":{"value":{"pageNumber":0,"pageSize":0,"totalResults":0,"reportName":"string","companyName":"string","generatedDate":"2023-01-26T07:36:40.487Z"}}} | -| `ReportItems` | [][shared.EnhancedInvoiceReportItem](../../../pkg/models/shared/enhancedinvoicereportitem.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ReportInfo` | [*shared.ReportInfo](../../../pkg/models/shared/reportinfo.md) | :heavy_minus_sign: | Report additional information, which is specific to Lending API reports. | {
"Example 1": {
"value": {
"pageNumber": 0,
"pageSize": 0,
"totalResults": 0,
"reportName": "string",
"companyName": "string",
"generatedDate": "2023-01-26T07:36:40.487Z"
}
}
} | +| `ReportItems` | [][shared.EnhancedInvoiceReportItem](../../../pkg/models/shared/enhancedinvoicereportitem.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/errorstatus.md b/lending/docs/pkg/models/shared/errorstatus.md new file mode 100644 index 000000000..0164bbe93 --- /dev/null +++ b/lending/docs/pkg/models/shared/errorstatus.md @@ -0,0 +1,11 @@ +# ErrorStatus + +The current status of a transient error. Null statuses indicate that the error is not transient. + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `ErrorStatusActive` | Active | +| `ErrorStatusResolved` | Resolved | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/itemreference.md b/lending/docs/pkg/models/shared/itemreference.md index 6429ed0da..8793340d1 100644 --- a/lending/docs/pkg/models/shared/itemreference.md +++ b/lending/docs/pkg/models/shared/itemreference.md @@ -7,5 +7,5 @@ Reference to the item the line is linked to. | Field | Type | Required | Description | | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `ID` | *string* | :heavy_check_mark: | Unique identifier for the item in the accounting platform. | -| `Name` | **string* | :heavy_minus_sign: | Name of the item in the accounting platform. | \ No newline at end of file +| `ID` | *string* | :heavy_check_mark: | Unique identifier for the item in the accounting software. | +| `Name` | **string* | :heavy_minus_sign: | Name of the item in the accounting software. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/items.md b/lending/docs/pkg/models/shared/items.md index db633610b..afc239acc 100644 --- a/lending/docs/pkg/models/shared/items.md +++ b/lending/docs/pkg/models/shared/items.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `ID` | **string* | :heavy_minus_sign: | Unique identifier for the group. | 60d2fa12-8a04-11ee-b9d1-0242ac120002 | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of tax withheld. | +| `Name` | *string* | :heavy_check_mark: | Name assigned to withheld tax. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/journalline.md b/lending/docs/pkg/models/shared/journalline.md index 951513850..426b6a087 100644 --- a/lending/docs/pkg/models/shared/journalline.md +++ b/lending/docs/pkg/models/shared/journalline.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountRef` | [*shared.AccountRef](../../../pkg/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. | +| `ContactRef` | [*shared.ContactReference](../../../pkg/models/shared/contactreference.md) | :heavy_minus_sign: | N/A | | `Currency` | **string* | :heavy_minus_sign: | Currency for the journal line item. | | `Description` | **string* | :heavy_minus_sign: | Description of the journal line item. | | `NetAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative. | diff --git a/lending/docs/pkg/models/shared/journallinedatatype.md b/lending/docs/pkg/models/shared/journallinedatatype.md new file mode 100644 index 000000000..32b204bed --- /dev/null +++ b/lending/docs/pkg/models/shared/journallinedatatype.md @@ -0,0 +1,11 @@ +# JournalLineDataType + +Allowed name of the 'dataType'. + + +## Values + +| Name | Value | +| ------------------------------ | ------------------------------ | +| `JournalLineDataTypeCustomers` | customers | +| `JournalLineDataTypeSuppliers` | suppliers | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/loansummaryreportitem.md b/lending/docs/pkg/models/shared/loansummaryreportitem.md index 12c82d509..999b5b55a 100644 --- a/lending/docs/pkg/models/shared/loansummaryreportitem.md +++ b/lending/docs/pkg/models/shared/loansummaryreportitem.md @@ -7,7 +7,7 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Balance` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The loan outstanding balance. This may not equal totalDrawdowns - totalRepayments due to interest which has been accrued. | | | `Description` | **string* | :heavy_minus_sign: | The description of the object being referred to. E.g. the account. | | -| `LenderName` | **string* | :heavy_minus_sign: | The name of lender providing the loan. | | +| `Lender` | **string* | :heavy_minus_sign: | The name of lender providing the loan. | | | `RecordRef` | [*shared.LoanSummaryRecordRef](../../../pkg/models/shared/loansummaryrecordref.md) | :heavy_minus_sign: | N/A | | | `StartDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `TotalDrawdowns` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The total loan drawdowns. | | diff --git a/lending/docs/pkg/models/shared/loantransactions.md b/lending/docs/pkg/models/shared/loantransactions.md index 7879d4731..59f9af2e2 100644 --- a/lending/docs/pkg/models/shared/loantransactions.md +++ b/lending/docs/pkg/models/shared/loantransactions.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `Errors` | []*interface{}* | :heavy_minus_sign: | If there are no errors, an empty array is returned. | +| `Errors` | []*any* | :heavy_minus_sign: | If there are no errors, an empty array is returned. | | `ReportInfo` | [*shared.LoanTransactionsReportInfo](../../../pkg/models/shared/loantransactionsreportinfo.md) | :heavy_minus_sign: | N/A | | `ReportItems` | [][shared.ReportItems](../../../pkg/models/shared/reportitems.md) | :heavy_minus_sign: | Contains object of reporting properties. The loan ref will reference a different object depending on the integration type. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/path.md b/lending/docs/pkg/models/shared/path.md new file mode 100644 index 000000000..8edc52c43 --- /dev/null +++ b/lending/docs/pkg/models/shared/path.md @@ -0,0 +1,8 @@ +# Path + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `PathAuthGet` | auth/get | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/payment.md b/lending/docs/pkg/models/shared/payment.md index 48b95265f..ebdae3e04 100644 --- a/lending/docs/pkg/models/shared/payment.md +++ b/lending/docs/pkg/models/shared/payment.md @@ -3,12 +3,12 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Payment amount. | | -| `BankingTransactionRefs` | [][shared.BankingTransactionRef](../../../pkg/models/shared/bankingtransactionref.md) | :heavy_minus_sign: | N/A | | -| `Currency` | **string* | :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 | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | -| `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `ID` | **string* | :heavy_minus_sign: | ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. | | -| `PaymentType` | **string* | :heavy_minus_sign: | The type of payment. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Payment amount. | | +| `BankingTransactionRefs` | [][shared.BankingTransactionRef](../../../pkg/models/shared/bankingtransactionref.md) | :heavy_minus_sign: | N/A | | +| `Currency` | **string* | :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 | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `ID` | **string* | :heavy_minus_sign: | ID of the invoice, which may be a GUID but it may be something else depending on the accounting software. | | +| `PaymentType` | **string* | :heavy_minus_sign: | The type of payment. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/paymentallocationpayment.md b/lending/docs/pkg/models/shared/paymentallocationpayment.md index 8ebeed6df..0bdf3baf0 100644 --- a/lending/docs/pkg/models/shared/paymentallocationpayment.md +++ b/lending/docs/pkg/models/shared/paymentallocationpayment.md @@ -3,13 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AccountRef` | [*shared.AccountRef](../../../pkg/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` | **string* | :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 | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | -| `ID` | **string* | :heavy_minus_sign: | Identifier of the allocated payment. | | -| `Note` | **string* | :heavy_minus_sign: | Notes attached to the allocated payment. | | -| `PaidOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `Reference` | **string* | :heavy_minus_sign: | Reference to the allocated payment. | | -| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount that was paid. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountRef` | [*shared.AccountRef](../../../pkg/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` | **string* | :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 | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `ID` | **string* | :heavy_minus_sign: | Identifier of the allocated payment. | | +| `Note` | **string* | :heavy_minus_sign: | Notes attached to the allocated payment. | | +| `PaidOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `Reference` | **string* | :heavy_minus_sign: | Reference to the allocated payment. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount that was paid. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/paymentlinelink.md b/lending/docs/pkg/models/shared/paymentlinelink.md index 4e1d51696..7111605a0 100644 --- a/lending/docs/pkg/models/shared/paymentlinelink.md +++ b/lending/docs/pkg/models/shared/paymentlinelink.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 receivable account.
A positive link amount _increases_ the outstanding amount on the accounts receivable account. | -| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | -| `ID` | **string* | :heavy_minus_sign: | Unique identifier of the transaction represented by the link. | -| `Type` | [shared.PaymentLinkType](../../../pkg/models/shared/paymentlinktype.md) | :heavy_check_mark: | Types of payment line links, either:
`Unknown`
`Unlinked` - Not used
`Invoice` - ID refers to the invoice
`CreditNote` - ID refers to the credit note
`Refund` - ID refers to the sibling payment
`Payment` - ID refers to the sibling payment
`PaymentOnAccount` - ID refers to the customer
`Other` - ID refers to the customer
`Manual Journal`
`Discount` - ID refers to the payment | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 receivable account.
A positive link amount _increases_ the outstanding amount on the accounts receivable account. | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | +| `ID` | **string* | :heavy_minus_sign: | Unique identifier of the transaction represented by the link. | +| `Type` | [shared.PaymentLinkType](../../../pkg/models/shared/paymentlinktype.md) | :heavy_check_mark: | Types of payment line links, either:
`Unknown`
`Unlinked` - Not used
`Invoice` - ID refers to the invoice
`CreditNote` - ID refers to the credit note
`Refund` - ID refers to the sibling payment
`Payment` - ID refers to the sibling payment
`PaymentOnAccount` - ID refers to the customer
`Other` - ID refers to the customer
`Manual Journal`
`Discount` - ID refers to the payment | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/paymentmethodref.md b/lending/docs/pkg/models/shared/paymentmethodref.md index 26eaa8224..1b66d5c93 100644 --- a/lending/docs/pkg/models/shared/paymentmethodref.md +++ b/lending/docs/pkg/models/shared/paymentmethodref.md @@ -1,6 +1,6 @@ # PaymentMethodRef -The payment method the record is linked to in the accounting or commerce platform. +The payment method the record is linked to in the accounting or commerce software. ## Fields diff --git a/lending/docs/pkg/models/shared/phonenumber.md b/lending/docs/pkg/models/shared/phonenumber.md index 88c4ff1fc..4533beed7 100644 --- a/lending/docs/pkg/models/shared/phonenumber.md +++ b/lending/docs/pkg/models/shared/phonenumber.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `Number` | *string* | :heavy_check_mark: | A phone number. | +44 25691 154789 | +| `Number` | **string* | :heavy_minus_sign: | A phone number. | +44 25691 154789 | | `Type` | [shared.PhoneNumberType](../../../pkg/models/shared/phonenumbertype.md) | :heavy_check_mark: | The type of phone number | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/profitandlossreport.md b/lending/docs/pkg/models/shared/profitandlossreport.md index 2d94a0bae..13874a060 100644 --- a/lending/docs/pkg/models/shared/profitandlossreport.md +++ b/lending/docs/pkg/models/shared/profitandlossreport.md @@ -5,14 +5,14 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `CostOfSales` | [*shared.ReportLineInput](../../../pkg/models/shared/reportlineinput.md) | :heavy_minus_sign: | N/A | | -| `Expenses` | [*shared.ReportLineInput](../../../pkg/models/shared/reportlineinput.md) | :heavy_minus_sign: | N/A | | +| `CostOfSales` | [*shared.ReportLine](../../../pkg/models/shared/reportline.md) | :heavy_minus_sign: | N/A | | +| `Expenses` | [*shared.ReportLine](../../../pkg/models/shared/reportline.md) | :heavy_minus_sign: | N/A | | | `FromDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `GrossProfit` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Gross profit of the company in the given date range. | | -| `Income` | [*shared.ReportLineInput](../../../pkg/models/shared/reportlineinput.md) | :heavy_minus_sign: | N/A | | +| `Income` | [*shared.ReportLine](../../../pkg/models/shared/reportline.md) | :heavy_minus_sign: | N/A | | | `NetOperatingProfit` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Net operating profit of the company in the given date range. | | | `NetOtherIncome` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Net other income of the company in the given date range. | | | `NetProfit` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Net profit of the company in the given date range. | | -| `OtherExpenses` | [*shared.ReportLineInput](../../../pkg/models/shared/reportlineinput.md) | :heavy_minus_sign: | N/A | | -| `OtherIncome` | [*shared.ReportLineInput](../../../pkg/models/shared/reportlineinput.md) | :heavy_minus_sign: | N/A | | +| `OtherExpenses` | [*shared.ReportLine](../../../pkg/models/shared/reportline.md) | :heavy_minus_sign: | N/A | | +| `OtherIncome` | [*shared.ReportLine](../../../pkg/models/shared/reportline.md) | :heavy_minus_sign: | N/A | | | `ToDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/propertieitemref.md b/lending/docs/pkg/models/shared/propertieitemref.md index e0b980b90..9bd0ba9ea 100644 --- a/lending/docs/pkg/models/shared/propertieitemref.md +++ b/lending/docs/pkg/models/shared/propertieitemref.md @@ -7,5 +7,5 @@ Reference to the item the line is linked to. | Field | Type | Required | Description | | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `ID` | *string* | :heavy_check_mark: | Unique identifier for the item in the accounting platform. | -| `Name` | **string* | :heavy_minus_sign: | Name of the item in the accounting platform. | \ No newline at end of file +| `ID` | *string* | :heavy_check_mark: | Unique identifier for the item in the accounting software. | +| `Name` | **string* | :heavy_minus_sign: | Name of the item in the accounting software. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/pulloperation.md b/lending/docs/pkg/models/shared/pulloperation.md index 6b0aab84f..e2cf3dce8 100644 --- a/lending/docs/pkg/models/shared/pulloperation.md +++ b/lending/docs/pkg/models/shared/pulloperation.md @@ -12,11 +12,11 @@ Information about a queued, in progress or completed pull operation. | `Completed` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `ConnectionID` | *string* | :heavy_check_mark: | Unique identifier of the connection associated to this pull operation. | 50830828-7d39-4367-b0eb-5ddb2de5faa5 | | `DataType` | *string* | :heavy_check_mark: | The data type you are requesting in a pull operation. | | -| `ErrorMessage` | **string* | :heavy_minus_sign: | A message about a transient or persistent error. | | +| `ErrorMessage` | **string* | :heavy_minus_sign: | A message about a transient or persistent error returned by Codat or the source platform. | | | `ID` | *string* | :heavy_check_mark: | Unique identifier of the pull operation. | 943accd0-4247-42d8-865b-363c8629e1da | | `IsCompleted` | *bool* | :heavy_check_mark: | `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. | | | `IsErrored` | *bool* | :heavy_check_mark: | `True` if the pull operation entered an error state. | | | `Progress` | *int64* | :heavy_check_mark: | An integer signifying the progress of the pull operation. | | | `Requested` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `Status` | [shared.PullOperationStatus](../../../pkg/models/shared/pulloperationstatus.md) | :heavy_check_mark: | The current status of the pull operation. | Complete | +| `Status` | [shared.DatasetStatus](../../../pkg/models/shared/datasetstatus.md) | :heavy_check_mark: | The current status of the dataset. | | | `StatusDescription` | **string* | :heavy_minus_sign: | Additional information about the dataset status. | Paused until 2022-10-23T00:00:00.000Z | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/pulloperations.md b/lending/docs/pkg/models/shared/pulloperations.md index aef942e81..f4e835f26 100644 --- a/lending/docs/pkg/models/shared/pulloperations.md +++ b/lending/docs/pkg/models/shared/pulloperations.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.PullOperation](../../../pkg/models/shared/pulloperation.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.PullOperation](../../../pkg/models/shared/pulloperation.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/pulloperationstatus.md b/lending/docs/pkg/models/shared/pulloperationstatus.md deleted file mode 100644 index ec9307c85..000000000 --- a/lending/docs/pkg/models/shared/pulloperationstatus.md +++ /dev/null @@ -1,32 +0,0 @@ -# PullOperationStatus - -The current status of the pull operation. - - -## Values - -| Name | Value | -| --------------------------------------- | --------------------------------------- | -| `PullOperationStatusInitial` | Initial | -| `PullOperationStatusQueued` | Queued | -| `PullOperationStatusFetching` | Fetching | -| `PullOperationStatusMapQueued` | MapQueued | -| `PullOperationStatusMapping` | Mapping | -| `PullOperationStatusComplete` | Complete | -| `PullOperationStatusFetchError` | FetchError | -| `PullOperationStatusMapError` | MapError | -| `PullOperationStatusInternalError` | InternalError | -| `PullOperationStatusProcessingQueued` | ProcessingQueued | -| `PullOperationStatusProcessing` | Processing | -| `PullOperationStatusProcessingError` | ProcessingError | -| `PullOperationStatusValidationQueued` | ValidationQueued | -| `PullOperationStatusValidating` | Validating | -| `PullOperationStatusValidationError` | ValidationError | -| `PullOperationStatusAuthError` | AuthError | -| `PullOperationStatusCancelled` | Cancelled | -| `PullOperationStatusRouting` | Routing | -| `PullOperationStatusRoutingError` | RoutingError | -| `PullOperationStatusNotSupported` | NotSupported | -| `PullOperationStatusRateLimitError` | RateLimitError | -| `PullOperationStatusPermissionsError` | PermissionsError | -| `PullOperationStatusPrerequisiteNotMet` | PrerequisiteNotMet | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/purchaseorderreference.md b/lending/docs/pkg/models/shared/purchaseorderreference.md index 486535ab6..62508f11d 100644 --- a/lending/docs/pkg/models/shared/purchaseorderreference.md +++ b/lending/docs/pkg/models/shared/purchaseorderreference.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `ID` | **string* | :heavy_minus_sign: | Identifier for the purchase order, unique for the company in the accounting platform. | -| `PurchaseOrderNumber` | **string* | :heavy_minus_sign: | Friendly reference for the purchase order, commonly generated by the accounting platform. | \ No newline at end of file +| `ID` | **string* | :heavy_minus_sign: | Identifier for the purchase order, unique for the company in the accounting software. | +| `PurchaseOrderNumber` | **string* | :heavy_minus_sign: | Friendly reference for the purchase order, commonly generated by the accounting software. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/pushoperation.md b/lending/docs/pkg/models/shared/pushoperation.md index b8c816fba..c666911a8 100644 --- a/lending/docs/pkg/models/shared/pushoperation.md +++ b/lending/docs/pkg/models/shared/pushoperation.md @@ -9,7 +9,7 @@ | `CompanyID` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `CompletedOnUtc` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `DataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `ErrorMessage` | **string* | :heavy_minus_sign: | A message about the error. | | | `PushOperationKey` | *string* | :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. | | | `RequestedOnUtc` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | diff --git a/lending/docs/pkg/models/shared/pushoperationref.md b/lending/docs/pkg/models/shared/pushoperationref.md index 12980b5fd..f7aeaed0b 100644 --- a/lending/docs/pkg/models/shared/pushoperationref.md +++ b/lending/docs/pkg/models/shared/pushoperationref.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `DataType` | [*shared.DataType](../../../pkg/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `ID` | **string* | :heavy_minus_sign: | Unique identifier for a push operation. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/pushoperations.md b/lending/docs/pkg/models/shared/pushoperations.md index fa709aebc..f036eee36 100644 --- a/lending/docs/pkg/models/shared/pushoperations.md +++ b/lending/docs/pkg/models/shared/pushoperations.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | -| `Results` | [][shared.PushOperation](../../../pkg/models/shared/pushoperation.md) | :heavy_minus_sign: | N/A | | -| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Links` | [shared.Links](../../../pkg/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `PageNumber` | *int64* | :heavy_check_mark: | Current page number. | | +| `PageSize` | *int64* | :heavy_check_mark: | Number of items to return in results array. | | +| `Results` | [][shared.PushOperation](../../../pkg/models/shared/pushoperation.md) | :heavy_minus_sign: | N/A | | +| `TotalResults` | *int64* | :heavy_check_mark: | Total number of items. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/reportitems.md b/lending/docs/pkg/models/shared/reportitems.md index 4c3468ca3..8b272b5a8 100644 --- a/lending/docs/pkg/models/shared/reportitems.md +++ b/lending/docs/pkg/models/shared/reportitems.md @@ -8,6 +8,6 @@ | `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The loan transaction amount. | | | `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `ItemRef` | [*shared.ItemRef](../../../pkg/models/shared/itemref.md) | :heavy_minus_sign: | N/A | | -| `LenderName` | **string* | :heavy_minus_sign: | The name of lender providing the loan. | | +| `Lender` | **string* | :heavy_minus_sign: | The name of lender providing the loan. | | | `LoanRef` | [*shared.LoanRef](../../../pkg/models/shared/loanref.md) | :heavy_minus_sign: | N/A | | | `LoanTransactionType` | [*shared.LoanTransactionType](../../../pkg/models/shared/loantransactiontype.md) | :heavy_minus_sign: | The type of loan transaction. | | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/reportline.md b/lending/docs/pkg/models/shared/reportline.md index cb3c35b12..9ff54d291 100644 --- a/lending/docs/pkg/models/shared/reportline.md +++ b/lending/docs/pkg/models/shared/reportline.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `AccountID` | **string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting platform. | +| `AccountID` | **string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting software. | | `Items` | [][shared.ReportLine](../../../pkg/models/shared/reportline.md) | :heavy_minus_sign: | An array of ReportLine items. | | `Name` | **string* | :heavy_minus_sign: | Name of the report line item. | | `Value` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Numerical value of the line item. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/reportlineinput.md b/lending/docs/pkg/models/shared/reportlineinput.md deleted file mode 100644 index 9bc2a02c4..000000000 --- a/lending/docs/pkg/models/shared/reportlineinput.md +++ /dev/null @@ -1,11 +0,0 @@ -# ReportLineInput - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `AccountID` | **string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting platform. | -| `Items` | [][shared.ReportLine](../../../pkg/models/shared/reportline.md) | :heavy_minus_sign: | An array of ReportLine items. | -| `Name` | **string* | :heavy_minus_sign: | Name of the report line item. | -| `Value` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Numerical value of the line item. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/schemadatatype.md b/lending/docs/pkg/models/shared/schemadatatype.md index d2910a0d3..e1d1293a4 100644 --- a/lending/docs/pkg/models/shared/schemadatatype.md +++ b/lending/docs/pkg/models/shared/schemadatatype.md @@ -1,6 +1,6 @@ # SchemaDataType -Available Data types +Available data types ## Values diff --git a/lending/docs/pkg/models/shared/source.md b/lending/docs/pkg/models/shared/source.md new file mode 100644 index 000000000..c21a58e43 --- /dev/null +++ b/lending/docs/pkg/models/shared/source.md @@ -0,0 +1,10 @@ +# Source + +The source of the banking data that determines its format + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `SourceCodat` | codat | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/startuploadsessionrequest.md b/lending/docs/pkg/models/shared/startuploadsessionrequest.md new file mode 100644 index 000000000..802371953 --- /dev/null +++ b/lending/docs/pkg/models/shared/startuploadsessionrequest.md @@ -0,0 +1,8 @@ +# StartUploadSessionRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `DataType` | [*shared.StartUploadSessionRequestDataType](../../../pkg/models/shared/startuploadsessionrequestdatatype.md) | :heavy_minus_sign: | A key for a Codat data type. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/startuploadsessionrequestdatatype.md b/lending/docs/pkg/models/shared/startuploadsessionrequestdatatype.md new file mode 100644 index 000000000..3bb0bad55 --- /dev/null +++ b/lending/docs/pkg/models/shared/startuploadsessionrequestdatatype.md @@ -0,0 +1,11 @@ +# StartUploadSessionRequestDataType + +A key for a Codat data type. + + +## Values + +| Name | Value | +| ------------------------------------------------------ | ------------------------------------------------------ | +| `StartUploadSessionRequestDataTypeBankingAccounts` | banking-accounts | +| `StartUploadSessionRequestDataTypeBankingTransactions` | banking-transactions | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/status.md b/lending/docs/pkg/models/shared/status.md index e7ce2e227..8d44ab0c2 100644 --- a/lending/docs/pkg/models/shared/status.md +++ b/lending/docs/pkg/models/shared/status.md @@ -1,13 +1,30 @@ # Status -The status of the account transaction. +The current status of the dataset. ## Values -| Name | Value | -| -------------------- | -------------------- | -| `StatusUnknown` | Unknown | -| `StatusUnreconciled` | Unreconciled | -| `StatusReconciled` | Reconciled | -| `StatusVoid` | Void | \ No newline at end of file +| Name | Value | +| -------------------------- | -------------------------- | +| `StatusInitial` | Initial | +| `StatusQueued` | Queued | +| `StatusFetching` | Fetching | +| `StatusMapQueued` | MapQueued | +| `StatusMapping` | Mapping | +| `StatusComplete` | Complete | +| `StatusFetchError` | FetchError | +| `StatusMapError` | MapError | +| `StatusInternalError` | InternalError | +| `StatusProcessingQueued` | ProcessingQueued | +| `StatusProcessing` | Processing | +| `StatusProcessingError` | ProcessingError | +| `StatusValidationQueued` | ValidationQueued | +| `StatusValidating` | Validating | +| `StatusValidationError` | ValidationError | +| `StatusAuthError` | AuthError | +| `StatusCancelled` | Cancelled | +| `StatusNotSupported` | NotSupported | +| `StatusRateLimitError` | RateLimitError | +| `StatusPermissionsError` | PermissionsError | +| `StatusPrerequisiteNotMet` | PrerequisiteNotMet | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/supplementaldata.md b/lending/docs/pkg/models/shared/supplementaldata.md index 691487372..48a2c1fe3 100644 --- a/lending/docs/pkg/models/shared/supplementaldata.md +++ b/lending/docs/pkg/models/shared/supplementaldata.md @@ -2,11 +2,11 @@ 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/supplemental-data/overview) about supplemental data. +It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. ## Fields -| Field | Type | Required | Description | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Content` | map[string]map[string]*interface{}* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `Content` | map[string]map[string]*any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/tags.md b/lending/docs/pkg/models/shared/tags.md new file mode 100644 index 000000000..6de993aa8 --- /dev/null +++ b/lending/docs/pkg/models/shared/tags.md @@ -0,0 +1,9 @@ +# Tags + +A collection of user-defined key-value pairs that store custom metadata against the company. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/taxcomponentallocation.md b/lending/docs/pkg/models/shared/taxcomponentallocation.md index 91d3b662d..093633a4e 100644 --- a/lending/docs/pkg/models/shared/taxcomponentallocation.md +++ b/lending/docs/pkg/models/shared/taxcomponentallocation.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `Rate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Tax amount on order line sale as available from source commerce platform. | -| `TaxComponentRef` | [*shared.TaxComponentRef](../../../pkg/models/shared/taxcomponentref.md) | :heavy_minus_sign: | Taxes rates reference object depending on the rates being available on source commerce package. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `Rate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Tax amount on order line sale as available from source commerce software. | +| `TaxComponentRef` | [*shared.TaxComponentRef](../../../pkg/models/shared/taxcomponentref.md) | :heavy_minus_sign: | Taxes rates reference object depending on the rates being available on source commerce software. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/taxcomponentref.md b/lending/docs/pkg/models/shared/taxcomponentref.md index c978f8404..67b95a11a 100644 --- a/lending/docs/pkg/models/shared/taxcomponentref.md +++ b/lending/docs/pkg/models/shared/taxcomponentref.md @@ -1,6 +1,6 @@ # TaxComponentRef -Taxes rates reference object depending on the rates being available on source commerce package. +Taxes rates reference object depending on the rates being available on source commerce software. ## Fields diff --git a/lending/docs/pkg/models/shared/taxrateref.md b/lending/docs/pkg/models/shared/taxrateref.md index 7503f800c..e0f38c4ba 100644 --- a/lending/docs/pkg/models/shared/taxrateref.md +++ b/lending/docs/pkg/models/shared/taxrateref.md @@ -17,5 +17,5 @@ Found on: | Field | Type | Required | Description | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | | `EffectiveTaxRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Applicable tax rate. | -| `ID` | **string* | :heavy_minus_sign: | Unique identifier for the tax rate in the accounting platform. | -| `Name` | **string* | :heavy_minus_sign: | Name of the tax rate in the accounting platform. | \ No newline at end of file +| `ID` | **string* | :heavy_minus_sign: | Unique identifier for the tax rate in the accounting software. | +| `Name` | **string* | :heavy_minus_sign: | Name of the tax rate in the accounting software. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/taxratereference.md b/lending/docs/pkg/models/shared/taxratereference.md index d884bcdef..8252fd6c4 100644 --- a/lending/docs/pkg/models/shared/taxratereference.md +++ b/lending/docs/pkg/models/shared/taxratereference.md @@ -17,5 +17,5 @@ Found on: | Field | Type | Required | Description | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | | `EffectiveTaxRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Applicable tax rate. | -| `ID` | **string* | :heavy_minus_sign: | Unique identifier for the tax rate in the accounting platform. | -| `Name` | **string* | :heavy_minus_sign: | Name of the tax rate in the accounting platform. | \ No newline at end of file +| `ID` | **string* | :heavy_minus_sign: | Unique identifier for the tax rate in the accounting software. | +| `Name` | **string* | :heavy_minus_sign: | Name of the tax rate in the accounting software. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/transactioncategory.md b/lending/docs/pkg/models/shared/transactioncategory.md index c090302d1..19d9db449 100644 --- a/lending/docs/pkg/models/shared/transactioncategory.md +++ b/lending/docs/pkg/models/shared/transactioncategory.md @@ -5,5 +5,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | -| `Confidence` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Returns the confidence of the suggested category for the transaction. The value is between 0 and 100. | +| `Confidence` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Returns the aggregate confidence of the suggested category for the transaction. The value is between 0 and 100. | +| `Confidences` | [][*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | An ordered array of category level confidences where each element is the confidence of the corresponding item in the `levels` array. | | `Levels` | []*string* | :heavy_minus_sign: | The suggested category is an ordered array of category levels where each element (or level) is a subcategory of the previous element (or level). | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/withholdingtaxitems.md b/lending/docs/pkg/models/shared/withholdingtaxitems.md deleted file mode 100644 index 5a94b718f..000000000 --- a/lending/docs/pkg/models/shared/withholdingtaxitems.md +++ /dev/null @@ -1,9 +0,0 @@ -# WithholdingTaxItems - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of tax withheld. | -| `Name` | *string* | :heavy_check_mark: | Name assigned to withheld tax. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/zero.md b/lending/docs/pkg/models/shared/zero.md new file mode 100644 index 000000000..65b84b3d0 --- /dev/null +++ b/lending/docs/pkg/models/shared/zero.md @@ -0,0 +1,14 @@ +# Zero + +Links the current record line to the underlying record line that created it. + +For example, if a bill is generated from a purchase order, this property allows you to connect the bill line item to the purchase order line item in our data model. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `DataType` | [*shared.ZeroDataType](../../../pkg/models/shared/zerodatatype.md) | :heavy_minus_sign: | Allowed name of the 'dataType'. | +| `ID` | **string* | :heavy_minus_sign: | 'id' of the underlying record. | +| `LineNumber` | **string* | :heavy_minus_sign: | Line number of the underlying record. | \ No newline at end of file diff --git a/lending/docs/pkg/models/shared/zerodatatype.md b/lending/docs/pkg/models/shared/zerodatatype.md new file mode 100644 index 000000000..846d42ea4 --- /dev/null +++ b/lending/docs/pkg/models/shared/zerodatatype.md @@ -0,0 +1,11 @@ +# ZeroDataType + +Allowed name of the 'dataType'. + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `ZeroDataTypePurchaseOrders` | purchaseOrders | +| `ZeroDataTypeBills` | bills | \ No newline at end of file diff --git a/lending/docs/pkg/models/webhooks/clientratelimitreachedresponse1.md b/lending/docs/pkg/models/webhooks/clientratelimitreachedresponse1.md new file mode 100644 index 000000000..b6367e569 --- /dev/null +++ b/lending/docs/pkg/models/webhooks/clientratelimitreachedresponse1.md @@ -0,0 +1,10 @@ +# ClientRateLimitReachedResponse1 + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/lending/docs/pkg/models/webhooks/clientratelimitresetresponse1.md b/lending/docs/pkg/models/webhooks/clientratelimitresetresponse1.md new file mode 100644 index 000000000..5590e98f1 --- /dev/null +++ b/lending/docs/pkg/models/webhooks/clientratelimitresetresponse1.md @@ -0,0 +1,10 @@ +# ClientRateLimitResetResponse1 + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/lending/docs/sdks/accountbalances/README.md b/lending/docs/sdks/accountbalances/README.md index fc58ec488..0b3194fd7 100644 --- a/lending/docs/sdks/accountbalances/README.md +++ b/lending/docs/sdks/accountbalances/README.md @@ -1,6 +1,8 @@ # AccountBalances (*Banking.AccountBalances*) +## Overview + ### Available Operations * [List](#list) - List account balances @@ -41,11 +43,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.BankingAccountBalances != nil { // handle response } @@ -60,10 +62,12 @@ func main() { | `request` | [operations.ListBankingAccountBalancesRequest](../../pkg/models/operations/listbankingaccountbalancesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListBankingAccountBalancesResponse](../../pkg/models/operations/listbankingaccountbalancesresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/accounts/README.md b/lending/docs/sdks/accounts/README.md index 6f8ef79d5..be0b8aa80 100644 --- a/lending/docs/sdks/accounts/README.md +++ b/lending/docs/sdks/accounts/README.md @@ -1,6 +1,8 @@ # Accounts (*AccountingBankData.Accounts*) +## Overview + ### Available Operations * [Get](#get) - Get bank account @@ -39,14 +41,13 @@ func main() { ctx := context.Background() res, err := s.AccountingBankData.Accounts.Get(ctx, operations.GetAccountingBankAccountRequest{ - AccountID: "string", + AccountID: "", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) if err != nil { log.Fatal(err) } - if res.AccountingBankAccount != nil { // handle response } @@ -61,15 +62,18 @@ func main() { | `request` | [operations.GetAccountingBankAccountRequest](../../pkg/models/operations/getaccountingbankaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingBankAccountResponse](../../pkg/models/operations/getaccountingbankaccountresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List bank accounts* endpoint returns a list of [bank accounts](https://docs.codat.io/lending-api#/schemas/BankAccount) for a given company's connection. @@ -106,11 +110,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingBankAccounts != nil { // handle response } @@ -125,10 +129,12 @@ func main() { | `request` | [operations.ListAccountingBankAccountsRequest](../../pkg/models/operations/listaccountingbankaccountsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingBankAccountsResponse](../../pkg/models/operations/listaccountingbankaccountsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/accountspayable/README.md b/lending/docs/sdks/accountspayable/README.md index cf6a42b2e..096bb128c 100644 --- a/lending/docs/sdks/accountspayable/README.md +++ b/lending/docs/sdks/accountspayable/README.md @@ -1,5 +1,2 @@ # AccountsPayable -(*AccountsPayable*) - -### Available Operations - +(*AccountsPayable*) \ No newline at end of file diff --git a/lending/docs/sdks/accountsreceivable/README.md b/lending/docs/sdks/accountsreceivable/README.md index 0dbd381b9..cd9f36e5c 100644 --- a/lending/docs/sdks/accountsreceivable/README.md +++ b/lending/docs/sdks/accountsreceivable/README.md @@ -1,5 +1,2 @@ # AccountsReceivable -(*AccountsReceivable*) - -### Available Operations - +(*AccountsReceivable*) \ No newline at end of file diff --git a/lending/docs/sdks/accounttransactions/README.md b/lending/docs/sdks/accounttransactions/README.md index d3d7ff8b1..71610119f 100644 --- a/lending/docs/sdks/accounttransactions/README.md +++ b/lending/docs/sdks/accounttransactions/README.md @@ -1,6 +1,8 @@ # AccountTransactions (*Transactions.AccountTransactions*) +## Overview + ### Available Operations * [Get](#get) - Get account transaction @@ -10,7 +12,7 @@ The *Get account transaction* endpoint returns a single account transaction for a given accountTransactionId. -[Account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction) represent bank activity within an accounting platform. All transactions that go through a bank account are recorded as account transactions. +[Account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction) represent bank activity within an accounting software. All transactions that go through a bank account are recorded as account transactions. Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=accountTransactions) for integrations that support getting a specific account transaction. @@ -39,14 +41,13 @@ func main() { ctx := context.Background() res, err := s.Transactions.AccountTransactions.Get(ctx, operations.GetAccountingAccountTransactionRequest{ - AccountTransactionID: "string", + AccountTransactionID: "", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) if err != nil { log.Fatal(err) } - if res.AccountingAccountTransaction != nil { // handle response } @@ -61,20 +62,23 @@ func main() { | `request` | [operations.GetAccountingAccountTransactionRequest](../../pkg/models/operations/getaccountingaccounttransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingAccountTransactionResponse](../../pkg/models/operations/getaccountingaccounttransactionresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List account transactions* endpoint returns a list of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction) for a given company's connection. -[Account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction) represent bank activity within an accounting platform. All transactions that go through a bank account are recorded as account transactions. +[Account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction) represent bank activity within an accounting software. All transactions that go through a bank account are recorded as account transactions. Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). @@ -106,11 +110,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingAccountTransactions != nil { // handle response } @@ -125,10 +129,12 @@ func main() { | `request` | [operations.ListAccountingAccountTransactionsRequest](../../pkg/models/operations/listaccountingaccounttransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingAccountTransactionsResponse](../../pkg/models/operations/listaccountingaccounttransactionsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/balancesheet/README.md b/lending/docs/sdks/balancesheet/README.md index 9aa57fd3c..60e385af8 100644 --- a/lending/docs/sdks/balancesheet/README.md +++ b/lending/docs/sdks/balancesheet/README.md @@ -1,6 +1,8 @@ # BalanceSheet (*FinancialStatements.BalanceSheet*) +## Overview + ### Available Operations * [Get](#get) - Get balance sheet @@ -40,7 +42,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.AccountingBalanceSheet != nil { // handle response } @@ -55,15 +56,18 @@ func main() { | `request` | [operations.GetAccountingBalanceSheetRequest](../../pkg/models/operations/getaccountingbalancesheetrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingBalanceSheetResponse](../../pkg/models/operations/getaccountingbalancesheetresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetCategorizedAccounts The *Get categorized balance sheet statement* endpoint returns a list of categorized accounts that appear on a company’s Balance Sheet along with a balance per financial statement date. @@ -98,7 +102,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.EnhancedFinancialReport != nil { // handle response } @@ -113,10 +116,12 @@ func main() { | `request` | [operations.GetCategorizedBalanceSheetStatementRequest](../../pkg/models/operations/getcategorizedbalancesheetstatementrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCategorizedBalanceSheetStatementResponse](../../pkg/models/operations/getcategorizedbalancesheetstatementresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/bankaccounts/README.md b/lending/docs/sdks/bankaccounts/README.md index 53102679b..a75102fdc 100644 --- a/lending/docs/sdks/bankaccounts/README.md +++ b/lending/docs/sdks/bankaccounts/README.md @@ -1,6 +1,8 @@ # BankAccounts (*LoanWriteback.BankAccounts*) +## Overview + ### Available Operations * [Create](#create) - Create bank account @@ -40,13 +42,18 @@ func main() { ctx := context.Background() res, err := s.LoanWriteback.BankAccounts.Create(ctx, operations.CreateBankAccountRequest{ + AccountingBankAccount: &shared.AccountingBankAccount{ + Currency: lending.String("USD"), + ModifiedDate: lending.String("2022-10-23T00:00:00Z"), + SourceModifiedDate: lending.String("2022-10-23T00:00:00Z"), + Status: shared.BankAccountStatusActive.ToPointer(), + }, CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) if err != nil { log.Fatal(err) } - if res.AccountingCreateBankAccountResponse != nil { // handle response } @@ -61,15 +68,18 @@ func main() { | `request` | [operations.CreateBankAccountRequest](../../pkg/models/operations/createbankaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.CreateBankAccountResponse](../../pkg/models/operations/createbankaccountresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetCreateUpdateModel The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/lending-api#/schemas/BankAccount) for a given company and integration. @@ -111,7 +121,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.PushOption != nil { // handle response } @@ -126,10 +135,12 @@ func main() { | `request` | [operations.GetCreateUpdateBankAccountsModelRequest](../../pkg/models/operations/getcreateupdatebankaccountsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCreateUpdateBankAccountsModelResponse](../../pkg/models/operations/getcreateupdatebankaccountsmodelresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/banking/README.md b/lending/docs/sdks/banking/README.md index ed7f374e8..43cea1635 100644 --- a/lending/docs/sdks/banking/README.md +++ b/lending/docs/sdks/banking/README.md @@ -1,5 +1,2 @@ # Banking -(*Banking*) - -### Available Operations - +(*Banking*) \ No newline at end of file diff --git a/lending/docs/sdks/bankstatements/README.md b/lending/docs/sdks/bankstatements/README.md new file mode 100644 index 000000000..f2fdf8b81 --- /dev/null +++ b/lending/docs/sdks/bankstatements/README.md @@ -0,0 +1,338 @@ +# BankStatements +(*BankStatements*) + +## Overview + +Retrieve banking data from linked bank accounts. + +### Available Operations + +* [EndUploadSession](#enduploadsession) - End upload session +* [GetUploadConfiguration](#getuploadconfiguration) - Get upload configuration +* [SetUploadConfiguration](#setuploadconfiguration) - Set upload configuration +* [StartUploadSession](#startuploadsession) - Start upload session +* [UploadBankStatementData](#uploadbankstatementdata) - Upload data + +## EndUploadSession + +Use the *End upload session* endpoint to finalize a bank statement upload session. Include a `status` in the request body to indicate if you want to cancel the processing of the dataset or trigger the ingestion and enrichment of the data. + +A session is a one-time process that enables you to upload bank statements to Codat. It will time out after 90 minutes if no data is uploaded. + +### Example Usage + +```go +package main + +import( + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + lending "github.com/codatio/client-sdk-go/lending/v5" + "context" + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" + "log" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.BankStatements.EndUploadSession(ctx, operations.EndBankStatementUploadSessionRequest{ + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + DatasetID: "d58db2ab-edef-4881-8b6b-a7e79d33244c", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.EndBankStatementUploadSessionRequest](../../pkg/models/operations/endbankstatementuploadsessionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.EndBankStatementUploadSessionResponse](../../pkg/models/operations/endbankstatementuploadsessionresponse.md), error** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + + +## GetUploadConfiguration + +Use the *Get upload configuration* endpoint to view the existing bank statement upload configuration for the specified data connection. + +With this configuration, you set the source of the data you plan to upload, the ID of the account in third-party banking platform, and a provider ID, if required. This lets us determine the expected format of the data and any source-specific requirements. + +When you use the [*Upload data*](https://docs.codat.io/lending-api#/operations/upload-bank-statement-data) endpoint next, you must upload the data for the account you configured. + +### Example Usage + +```go +package main + +import( + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + lending "github.com/codatio/client-sdk-go/lending/v5" + "context" + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" + "log" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.BankStatements.GetUploadConfiguration(ctx, operations.GetBankStatementUploadConfigurationRequest{ + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) + if err != nil { + log.Fatal(err) + } + if res.BankStatementUploadConfiguration != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetBankStatementUploadConfigurationRequest](../../pkg/models/operations/getbankstatementuploadconfigurationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetBankStatementUploadConfigurationResponse](../../pkg/models/operations/getbankstatementuploadconfigurationresponse.md), error** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + + +## SetUploadConfiguration + +Use the *Set upload configuration* endpoint to create bank statement upload configuration for the specified data connection. + +With this configuration, you set the source of the data you plan to upload, the ID of the account in third-party banking platform, and a provider ID, if required. This lets us determine the expected format of the data and any source-specific requirements. + +Each data connection can only have one configuration for each company and external account ID combination. You will receive a Bad Request response if you try to set it again. + +### Example Usage + +```go +package main + +import( + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + lending "github.com/codatio/client-sdk-go/lending/v5" + "context" + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" + "log" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.BankStatements.SetUploadConfiguration(ctx, operations.SetBankStatementUploadConfigurationRequest{ + BankStatementUploadConfiguration: &shared.BankStatementUploadConfiguration{ + AccountID: lending.String("abc123-ABC"), + Source: shared.SourceCodat.ToPointer(), + }, + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) + if err != nil { + log.Fatal(err) + } + if res.BankStatementUploadConfiguration != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.SetBankStatementUploadConfigurationRequest](../../pkg/models/operations/setbankstatementuploadconfigurationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.SetBankStatementUploadConfigurationResponse](../../pkg/models/operations/setbankstatementuploadconfigurationresponse.md), error** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + + +## StartUploadSession + +Use the *Start upload session* endpoint to initiate a bank statement upload session for a given company. + +A session is a one-time process that enables you to upload bank statements to Codat. It will time out after 90 minutes if no data is uploaded. + +You can only have one active session per data type at a time. You can complete or cancel a session using the [*End upload session*](https://docs.codat.io/lending-api#/operations/end-bank-statement-upload-session) endpoint. + +### Example Usage + +```go +package main + +import( + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + lending "github.com/codatio/client-sdk-go/lending/v5" + "context" + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" + "log" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.BankStatements.StartUploadSession(ctx, operations.StartBankStatementUploadSessionRequest{ + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) + if err != nil { + log.Fatal(err) + } + if res.PullOperation != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.StartBankStatementUploadSessionRequest](../../pkg/models/operations/startbankstatementuploadsessionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.StartBankStatementUploadSessionResponse](../../pkg/models/operations/startbankstatementuploadsessionresponse.md), error** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + + +## UploadBankStatementData + +During an active session, use the **Upload data* endpoint to uploads a page of bank accounts or bank transactions data to the session. + +Make sure you created configuration for the account using the [*Set upload configuration*](https://docs.codat.io/lending-api#/operations/set-bank-statement-upload-configuration) endpoint before attempting an upload. + +### Example Usage + +```go +package main + +import( + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + lending "github.com/codatio/client-sdk-go/lending/v5" + "context" + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" + "log" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.BankStatements.UploadBankStatementData(ctx, operations.UploadBankStatementDataRequest{ + RequestBody: operations.CreateUploadBankStatementDataRequestBodyAny( + map[string]any{ + "currency": "Lek", + "id": "", + "identifiers": map[string]any{ + "type": "Investment", + }, + "modifiedDate": "2022-10-23T00:00:00Z", + "name": "", + "sourceModifiedDate": "2022-10-23T00:00:00Z", + "type": "Credit", + }, + ), + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + DatasetID: "15fc5ae4-359b-4dee-ba7c-3a22596ededc", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.UploadBankStatementDataRequest](../../pkg/models/operations/uploadbankstatementdatarequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.UploadBankStatementDataResponse](../../pkg/models/operations/uploadbankstatementdataresponse.md), error** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/banktransactions/README.md b/lending/docs/sdks/banktransactions/README.md index 72ad4a1da..730ce0786 100644 --- a/lending/docs/sdks/banktransactions/README.md +++ b/lending/docs/sdks/banktransactions/README.md @@ -1,6 +1,8 @@ # BankTransactions (*LoanWriteback.BankTransactions*) +## Overview + ### Available Operations * [Create](#create) - Create bank account transactions @@ -41,14 +43,21 @@ func main() { ctx := context.Background() res, err := s.LoanWriteback.BankTransactions.Create(ctx, operations.CreateBankTransactionsRequest{ - AccountID: "string", + AccountingCreateBankTransactions: &shared.AccountingCreateBankTransactions{ + AccountID: lending.String("7110701885"), + Transactions: []shared.CreateBankAccountTransaction{ + shared.CreateBankAccountTransaction{ + Date: lending.String("2022-10-23T00:00:00Z"), + }, + }, + }, + AccountID: "", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) if err != nil { log.Fatal(err) } - if res.AccountingCreateBankTransactionsResponse != nil { // handle response } @@ -63,15 +72,18 @@ func main() { | `request` | [operations.CreateBankTransactionsRequest](../../pkg/models/operations/createbanktransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.CreateBankTransactionsResponse](../../pkg/models/operations/createbanktransactionsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetCreateModel The *Get create bank account transactions model* endpoint returns the expected data for the request payload when creating [bank account transactions](https://docs.codat.io/lending-api#/schemas/BankTransactions) for a given company and integration. @@ -107,14 +119,13 @@ func main() { ctx := context.Background() res, err := s.LoanWriteback.BankTransactions.GetCreateModel(ctx, operations.GetCreateBankTransactionsModelRequest{ - AccountID: "string", + AccountID: "", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) if err != nil { log.Fatal(err) } - if res.PushOption != nil { // handle response } @@ -129,10 +140,12 @@ func main() { | `request` | [operations.GetCreateBankTransactionsModelRequest](../../pkg/models/operations/getcreatebanktransactionsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCreateBankTransactionsModelResponse](../../pkg/models/operations/getcreatebanktransactionsmodelresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/billcreditnotes/README.md b/lending/docs/sdks/billcreditnotes/README.md index 15b841ab0..3bfd5c461 100644 --- a/lending/docs/sdks/billcreditnotes/README.md +++ b/lending/docs/sdks/billcreditnotes/README.md @@ -1,6 +1,8 @@ # BillCreditNotes (*AccountsPayable.BillCreditNotes*) +## Overview + ### Available Operations * [Get](#get) - Get bill credit note @@ -39,13 +41,12 @@ func main() { ctx := context.Background() res, err := s.AccountsPayable.BillCreditNotes.Get(ctx, operations.GetAccountingBillCreditNoteRequest{ - BillCreditNoteID: "string", + BillCreditNoteID: "", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", }) if err != nil { log.Fatal(err) } - if res.AccountingBillCreditNote != nil { // handle response } @@ -60,15 +61,18 @@ func main() { | `request` | [operations.GetAccountingBillCreditNoteRequest](../../pkg/models/operations/getaccountingbillcreditnoterequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingBillCreditNoteResponse](../../pkg/models/operations/getaccountingbillcreditnoteresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List bill credit notes* endpoint returns a list of [bill credit notes](https://docs.codat.io/lending-api#/schemas/BillCreditNote) for a given company's connection. @@ -104,11 +108,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingBillCreditNotes != nil { // handle response } @@ -123,10 +127,12 @@ func main() { | `request` | [operations.ListAccountingBillCreditNotesRequest](../../pkg/models/operations/listaccountingbillcreditnotesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingBillCreditNotesResponse](../../pkg/models/operations/listaccountingbillcreditnotesresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/billpayments/README.md b/lending/docs/sdks/billpayments/README.md index d55919156..e0b8bcd90 100644 --- a/lending/docs/sdks/billpayments/README.md +++ b/lending/docs/sdks/billpayments/README.md @@ -1,6 +1,8 @@ # BillPayments (*AccountsPayable.BillPayments*) +## Overview + ### Available Operations * [Get](#get) - Get bill payment @@ -39,13 +41,12 @@ func main() { ctx := context.Background() res, err := s.AccountsPayable.BillPayments.Get(ctx, operations.GetAccountingBillPaymentRequest{ - BillPaymentID: "string", + BillPaymentID: "", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", }) if err != nil { log.Fatal(err) } - if res.AccountingBillPayment != nil { // handle response } @@ -60,15 +61,18 @@ func main() { | `request` | [operations.GetAccountingBillPaymentRequest](../../pkg/models/operations/getaccountingbillpaymentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingBillPaymentResponse](../../pkg/models/operations/getaccountingbillpaymentresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List bill payments* endpoint returns a list of [bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment) for a given company's connection. @@ -104,11 +108,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingBillPayments != nil { // handle response } @@ -123,10 +127,12 @@ func main() { | `request` | [operations.ListAccountingBillPaymentsRequest](../../pkg/models/operations/listaccountingbillpaymentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingBillPaymentsResponse](../../pkg/models/operations/listaccountingbillpaymentsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/bills/README.md b/lending/docs/sdks/bills/README.md index afb7fb091..288d6d37d 100644 --- a/lending/docs/sdks/bills/README.md +++ b/lending/docs/sdks/bills/README.md @@ -1,6 +1,8 @@ # Bills (*AccountsPayable.Bills*) +## Overview + ### Available Operations * [DownloadAttachment](#downloadattachment) - Download bill attachment @@ -41,14 +43,13 @@ func main() { ctx := context.Background() res, err := s.AccountsPayable.Bills.DownloadAttachment(ctx, operations.DownloadAccountingBillAttachmentRequest{ AttachmentID: "8a210b68-6988-11ed-a1eb-0242ac120002", - BillID: "string", + BillID: "", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) if err != nil { log.Fatal(err) } - if res.Data != nil { // handle response } @@ -63,15 +64,18 @@ func main() { | `request` | [operations.DownloadAccountingBillAttachmentRequest](../../pkg/models/operations/downloadaccountingbillattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DownloadAccountingBillAttachmentResponse](../../pkg/models/operations/downloadaccountingbillattachmentresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Get The *Get bill* endpoint returns a single bill for a given billId. @@ -83,6 +87,11 @@ Check out our [coverage explorer](https://knowledge.codat.io/supported-features/ Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). +### Tips and traps + +To access the `paymentAllocations` property, ensure that the `billPayments` data type is queued and cached in Codat before retrieving `bills` from Codat's cache. + + ### Example Usage ```go @@ -105,13 +114,12 @@ func main() { ctx := context.Background() res, err := s.AccountsPayable.Bills.Get(ctx, operations.GetAccountingBillRequest{ - BillID: "string", + BillID: "", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", }) if err != nil { log.Fatal(err) } - if res.AccountingBill != nil { // handle response } @@ -126,15 +134,18 @@ func main() { | `request` | [operations.GetAccountingBillRequest](../../pkg/models/operations/getaccountingbillrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingBillResponse](../../pkg/models/operations/getaccountingbillresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetAttachment The *Get bill attachment* endpoint returns a specific attachment for a given `billId` and `attachmentId`. @@ -167,14 +178,13 @@ func main() { ctx := context.Background() res, err := s.AccountsPayable.Bills.GetAttachment(ctx, operations.GetAccountingBillAttachmentRequest{ AttachmentID: "8a210b68-6988-11ed-a1eb-0242ac120002", - BillID: "string", + BillID: "", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) if err != nil { log.Fatal(err) } - if res.AccountingAttachment != nil { // handle response } @@ -189,15 +199,18 @@ func main() { | `request` | [operations.GetAccountingBillAttachmentRequest](../../pkg/models/operations/getaccountingbillattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingBillAttachmentResponse](../../pkg/models/operations/getaccountingbillattachmentresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List bills* endpoint returns a list of [bills](https://docs.codat.io/lending-api#/schemas/Bill) for a given company's connection. @@ -205,7 +218,11 @@ The *List bills* endpoint returns a list of [bills](https://docs.codat.io/lendin [Bills](https://docs.codat.io/lending-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/lending-api#/operations/refresh-company-data). - + +### Tips and traps + +To access the `paymentAllocations` property, ensure that the `billPayments` data type is queued and cached in Codat before retrieving `bills` from Codat's cache. + ### Example Usage @@ -233,11 +250,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingBills != nil { // handle response } @@ -252,15 +269,18 @@ func main() { | `request` | [operations.ListAccountingBillsRequest](../../pkg/models/operations/listaccountingbillsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingBillsResponse](../../pkg/models/operations/listaccountingbillsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ListAttachments The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. @@ -292,14 +312,13 @@ func main() { ctx := context.Background() res, err := s.AccountsPayable.Bills.ListAttachments(ctx, operations.ListAccountingBillAttachmentsRequest{ - BillID: "string", + BillID: "", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) if err != nil { log.Fatal(err) } - if res.Attachments != nil { // handle response } @@ -314,10 +333,12 @@ func main() { | `request` | [operations.ListAccountingBillAttachmentsRequest](../../pkg/models/operations/listaccountingbillattachmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingBillAttachmentsResponse](../../pkg/models/operations/listaccountingbillattachmentsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/cashflow/README.md b/lending/docs/sdks/cashflow/README.md index 6ec79b93a..b6079287e 100644 --- a/lending/docs/sdks/cashflow/README.md +++ b/lending/docs/sdks/cashflow/README.md @@ -1,6 +1,8 @@ # CashFlow (*FinancialStatements.CashFlow*) +## Overview + ### Available Operations * [Get](#get) - Get cash flow statement @@ -39,7 +41,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.AccountingCashFlowStatement != nil { // handle response } @@ -54,10 +55,12 @@ func main() { | `request` | [operations.GetAccountingCashFlowStatementRequest](../../pkg/models/operations/getaccountingcashflowstatementrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingCashFlowStatementResponse](../../pkg/models/operations/getaccountingcashflowstatementresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/categorizedstatement/README.md b/lending/docs/sdks/categorizedstatement/README.md index c116b981b..a4d3aa406 100644 --- a/lending/docs/sdks/categorizedstatement/README.md +++ b/lending/docs/sdks/categorizedstatement/README.md @@ -1,6 +1,8 @@ # CategorizedStatement (*Banking.CategorizedStatement*) +## Overview + ### Available Operations * [Get](#get) - Get categorized bank statement @@ -38,11 +40,11 @@ func main() { CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.EnhancedCashFlowTransactions != nil { // handle response } @@ -57,10 +59,12 @@ func main() { | `request` | [operations.GetCategorizedBankStatementRequest](../../pkg/models/operations/getcategorizedbankstatementrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCategorizedBankStatementResponse](../../pkg/models/operations/getcategorizedbankstatementresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/codatlending/README.md b/lending/docs/sdks/codatlending/README.md index e3012d974..211cf594a 100644 --- a/lending/docs/sdks/codatlending/README.md +++ b/lending/docs/sdks/codatlending/README.md @@ -1,35 +1,31 @@ # CodatLending SDK - ## Overview -Lending API: Our Lending API helps you make smarter credit decisions on small businesses by enabling you to pull your customers' latest data from accounting, banking, and commerce platforms they are already using. It also includes features to help providers verify the accuracy of data and process it more efficiently. +Lending API: Our Lending API helps you make smarter credit decisions on small businesses by enabling you to pull your customers' latest data from accounting, banking, and commerce software they are already using. It also includes features to help providers verify the accuracy of data and process it more efficiently. The Lending API is built on top of the latest accounting, commerce, and banking data, providing you with the most important data points you need to get a full picture of SMB creditworthiness and make a comprehensive assessment of your customers. [Explore product](https://docs.codat.io/lending/overview) | [See OpenAPI spec](https://github.com/codatio/oas) ---- - + ## Endpoints -| Endpoints | Description | -|:---------------------|:-----------------------------------------------------------------------------------------------------------| -| Companies | Create and manage your SMB users' companies. | -| Connections | Create new and manage existing data connections for a company. | -| Bank statements | Retrieve banking data from linked bank accounts. | -| Sales | Retrieve standardized sales data from a linked commerce platform. | -| Financial statements | Financial data and reports from a linked accounting platform. | -| Liabilities | Debt and other liabilities. | -| Accounts payable | Data from a linked accounting platform representing money the business owes money to its suppliers. | -| Accounts receivable | Data from a linked accounting platform representing money owed to the business for sold goods or services. | -| Transactions | Data from a linked accounting platform representing transactions. | -| Data integrity | Match mutable accounting data with immutable banking data to increase confidence in financial data. | -| Company info | View company profile from the source platform. | -| Excel reports | Download reports in Excel format. | -| Categories | Manage Codat's automatic account categorization functionality. | -| Manage data | Control how data is retrieved from an integration. | -| File upload | Endpoints to manage uploaded files. | - -### Available Operations - +| Endpoints | Description | +| :- |:- | +| Companies | Create and manage your SMB users' companies. | +| Connections | Create new and manage existing data connections for a company. | +| Bank statements | Retrieve banking data from linked bank accounts. | +| Sales | Retrieve standardized sales data from a linked commerce software. | +| Financial statements | Financial data and reports from a linked accounting software. | +| Liabilities | Debt and other liabilities. | +| Accounts payable | Data from a linked accounting software representing money the business owes money to its suppliers. | +| Accounts receivable | Data from a linked accounting software representing money owed to the business for sold goods or services. | +| Transactions | Data from a linked accounting software representing transactions. | +| Company info | View company information fetched from the source platform. | +| Data integrity | Match mutable accounting data with immutable banking data to increase confidence in financial data. | +| Excel reports | Download reports in Excel format. | +| Manage data | Control how data is retrieved from an integration. | +| File upload | Endpoints to manage uploaded files. | +| Loan writeback | Implement the [loan writeback](https://docs.codat.io/lending/guides/loan-writeback/introduction) procedure in your lending process to maintain an accurate position of a loan during the entire lending cycle. | + \ No newline at end of file diff --git a/lending/docs/sdks/codatlendingaccountingbankdata/README.md b/lending/docs/sdks/codatlendingaccountingbankdata/README.md index 2419f0368..eadadf2a9 100644 --- a/lending/docs/sdks/codatlendingaccountingbankdata/README.md +++ b/lending/docs/sdks/codatlendingaccountingbankdata/README.md @@ -3,7 +3,7 @@ ## Overview -Access bank transactions from an accounting platform. +Access bank transactions from an accounting software. ### Available Operations @@ -42,17 +42,17 @@ func main() { ctx := context.Background() res, err := s.AccountingBankData.ListTransactions(ctx, operations.ListAccountingBankAccountTransactionsRequest{ - AccountID: "string", + AccountID: "", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingBankTransactions != nil { // handle response } @@ -67,10 +67,12 @@ func main() { | `request` | [operations.ListAccountingBankAccountTransactionsRequest](../../pkg/models/operations/listaccountingbankaccounttransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingBankAccountTransactionsResponse](../../pkg/models/operations/listaccountingbankaccounttransactionsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/codatlendingaccounts/README.md b/lending/docs/sdks/codatlendingaccounts/README.md index fa0e43b63..713289297 100644 --- a/lending/docs/sdks/codatlendingaccounts/README.md +++ b/lending/docs/sdks/codatlendingaccounts/README.md @@ -1,6 +1,8 @@ # CodatLendingAccounts (*Banking.Accounts*) +## Overview + ### Available Operations * [Get](#get) - Get account @@ -39,14 +41,13 @@ func main() { ctx := context.Background() res, err := s.Banking.Accounts.Get(ctx, operations.GetBankingAccountRequest{ - AccountID: "string", + AccountID: "", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) if err != nil { log.Fatal(err) } - if res.BankingAccount != nil { // handle response } @@ -61,15 +62,18 @@ func main() { | `request` | [operations.GetBankingAccountRequest](../../pkg/models/operations/getbankingaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetBankingAccountResponse](../../pkg/models/operations/getbankingaccountresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List accounts* endpoint returns a list of [accounts](https://docs.codat.io/lending-api#/schemas/Account) for a given company's connection. @@ -106,11 +110,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.BankingAccounts != nil { // handle response } @@ -125,10 +129,12 @@ func main() { | `request` | [operations.ListBankingAccountsRequest](../../pkg/models/operations/listbankingaccountsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListBankingAccountsResponse](../../pkg/models/operations/listbankingaccountsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/codatlendingbankingtransactions/README.md b/lending/docs/sdks/codatlendingbankingtransactions/README.md index 8a7af3bfa..9f401f7a1 100644 --- a/lending/docs/sdks/codatlendingbankingtransactions/README.md +++ b/lending/docs/sdks/codatlendingbankingtransactions/README.md @@ -1,6 +1,8 @@ # CodatLendingBankingTransactions (*Banking.Transactions*) +## Overview + ### Available Operations * [Get](#get) - Get bank transaction @@ -41,12 +43,11 @@ func main() { res, err := s.Banking.Transactions.Get(ctx, operations.GetBankingTransactionRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - TransactionID: "string", + TransactionID: "", }) if err != nil { log.Fatal(err) } - if res.BankingTransaction != nil { // handle response } @@ -61,15 +62,18 @@ func main() { | `request` | [operations.GetBankingTransactionRequest](../../pkg/models/operations/getbankingtransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetBankingTransactionResponse](../../pkg/models/operations/getbankingtransactionresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List transactions* endpoint returns a list of [transactions](https://docs.codat.io/lending-api#/schemas/Transaction) for a given company's connection. @@ -106,11 +110,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.BankingTransactions != nil { // handle response } @@ -125,10 +129,12 @@ func main() { | `request` | [operations.ListBankingTransactionsRequest](../../pkg/models/operations/listbankingtransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListBankingTransactionsResponse](../../pkg/models/operations/listbankingtransactionsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/codatlendingcustomers/README.md b/lending/docs/sdks/codatlendingcustomers/README.md index 4efe16b31..2f06bddb4 100644 --- a/lending/docs/sdks/codatlendingcustomers/README.md +++ b/lending/docs/sdks/codatlendingcustomers/README.md @@ -1,6 +1,8 @@ # CodatLendingCustomers (*Sales.Customers*) +## Overview + ### Available Operations * [Get](#get) - Get customer @@ -41,12 +43,11 @@ func main() { res, err := s.Sales.Customers.Get(ctx, operations.GetCommerceCustomerRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - CustomerID: "string", + CustomerID: "", }) if err != nil { log.Fatal(err) } - if res.CommerceCustomer != nil { // handle response } @@ -61,15 +62,18 @@ func main() { | `request` | [operations.GetCommerceCustomerRequest](../../pkg/models/operations/getcommercecustomerrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCommerceCustomerResponse](../../pkg/models/operations/getcommercecustomerresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List customers* endpoint returns a list of [customers](https://docs.codat.io/lending-api#/schemas/Customer) for a given company's connection. @@ -106,11 +110,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.CommerceCustomers != nil { // handle response } @@ -125,10 +129,12 @@ func main() { | `request` | [operations.ListCommerceCustomersRequest](../../pkg/models/operations/listcommercecustomersrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListCommerceCustomersResponse](../../pkg/models/operations/listcommercecustomersresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/codatlendingdirectcosts/README.md b/lending/docs/sdks/codatlendingdirectcosts/README.md index ee766f196..9cb4b87cf 100644 --- a/lending/docs/sdks/codatlendingdirectcosts/README.md +++ b/lending/docs/sdks/codatlendingdirectcosts/README.md @@ -1,6 +1,8 @@ # CodatLendingDirectCosts (*Transactions.DirectCosts*) +## Overview + ### Available Operations * [DownloadAttachment](#downloadattachment) - Download direct cost attachment @@ -43,12 +45,11 @@ func main() { AttachmentID: "8a210b68-6988-11ed-a1eb-0242ac120002", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - DirectCostID: "string", + DirectCostID: "", }) if err != nil { log.Fatal(err) } - if res.Data != nil { // handle response } @@ -63,15 +64,18 @@ func main() { | `request` | [operations.DownloadAccountingDirectCostAttachmentRequest](../../pkg/models/operations/downloadaccountingdirectcostattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DownloadAccountingDirectCostAttachmentResponse](../../pkg/models/operations/downloadaccountingdirectcostattachmentresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Get The *Get direct cost* endpoint returns a single direct cost for a given directCostId. @@ -107,12 +111,11 @@ func main() { res, err := s.Transactions.DirectCosts.Get(ctx, operations.GetAccountingDirectCostRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - DirectCostID: "string", + DirectCostID: "", }) if err != nil { log.Fatal(err) } - if res.AccountingDirectCost != nil { // handle response } @@ -127,15 +130,18 @@ func main() { | `request` | [operations.GetAccountingDirectCostRequest](../../pkg/models/operations/getaccountingdirectcostrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingDirectCostResponse](../../pkg/models/operations/getaccountingdirectcostresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetAttachment The *Get direct cost attachment* endpoint returns a specific attachment for a given `directCostId` and `attachmentId`. @@ -170,12 +176,11 @@ func main() { AttachmentID: "8a210b68-6988-11ed-a1eb-0242ac120002", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - DirectCostID: "string", + DirectCostID: "", }) if err != nil { log.Fatal(err) } - if res.AccountingAttachment != nil { // handle response } @@ -190,15 +195,18 @@ func main() { | `request` | [operations.GetAccountingDirectCostAttachmentRequest](../../pkg/models/operations/getaccountingdirectcostattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingDirectCostAttachmentResponse](../../pkg/models/operations/getaccountingdirectcostattachmentresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List direct costs* endpoint returns a list of [direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) for a given company's connection. @@ -235,11 +243,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingDirectCosts != nil { // handle response } @@ -254,15 +262,18 @@ func main() { | `request` | [operations.ListAccountingDirectCostsRequest](../../pkg/models/operations/listaccountingdirectcostsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingDirectCostsResponse](../../pkg/models/operations/listaccountingdirectcostsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ListAttachments The *List direct cost attachments* endpoint returns a list of attachments available to download for given `directCostId`. @@ -296,12 +307,11 @@ func main() { res, err := s.Transactions.DirectCosts.ListAttachments(ctx, operations.ListAccountingDirectCostAttachmentsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - DirectCostID: "string", + DirectCostID: "", }) if err != nil { log.Fatal(err) } - if res.Attachments != nil { // handle response } @@ -316,10 +326,12 @@ func main() { | `request` | [operations.ListAccountingDirectCostAttachmentsRequest](../../pkg/models/operations/listaccountingdirectcostattachmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingDirectCostAttachmentsResponse](../../pkg/models/operations/listaccountingdirectcostattachmentsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/codatlendingfinancialstatementsaccounts/README.md b/lending/docs/sdks/codatlendingfinancialstatementsaccounts/README.md index d0082c183..ef11b4a0e 100644 --- a/lending/docs/sdks/codatlendingfinancialstatementsaccounts/README.md +++ b/lending/docs/sdks/codatlendingfinancialstatementsaccounts/README.md @@ -1,6 +1,8 @@ # CodatLendingFinancialStatementsAccounts (*FinancialStatements.Accounts*) +## Overview + ### Available Operations * [Get](#get) - Get account @@ -39,13 +41,12 @@ func main() { ctx := context.Background() res, err := s.FinancialStatements.Accounts.Get(ctx, operations.GetAccountingAccountRequest{ - AccountID: "string", + AccountID: "", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", }) if err != nil { log.Fatal(err) } - if res.AccountingAccount != nil { // handle response } @@ -60,15 +61,18 @@ func main() { | `request` | [operations.GetAccountingAccountRequest](../../pkg/models/operations/getaccountingaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingAccountResponse](../../pkg/models/operations/getaccountingaccountresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List accounts* endpoint returns a list of [accounts](https://docs.codat.io/lending-api#/schemas/Account) for a given company's connection. @@ -103,11 +107,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingAccounts != nil { // handle response } @@ -122,10 +126,12 @@ func main() { | `request` | [operations.ListAccountingAccountsRequest](../../pkg/models/operations/listaccountingaccountsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingAccountsResponse](../../pkg/models/operations/listaccountingaccountsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/codatlendingloanwritebackaccounts/README.md b/lending/docs/sdks/codatlendingloanwritebackaccounts/README.md index b5c038350..71eb86c35 100644 --- a/lending/docs/sdks/codatlendingloanwritebackaccounts/README.md +++ b/lending/docs/sdks/codatlendingloanwritebackaccounts/README.md @@ -1,6 +1,8 @@ # CodatLendingLoanWritebackAccounts (*LoanWriteback.Accounts*) +## Overview + ### Available Operations * [Create](#create) - Create account @@ -28,6 +30,7 @@ import( "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" lending "github.com/codatio/client-sdk-go/lending/v5" "context" + "github.com/codatio/client-sdk-go/lending/v5/pkg/types" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "log" ) @@ -41,13 +44,23 @@ func main() { ctx := context.Background() res, err := s.LoanWriteback.Accounts.Create(ctx, operations.CreateAccountRequest{ + AccountPrototype: &shared.AccountPrototype{ + Currency: lending.String("USD"), + CurrentBalance: types.MustNewDecimalFromString("0"), + Description: lending.String("Invoices the business has issued but has not yet collected payment on."), + FullyQualifiedCategory: lending.String("Asset.Current"), + FullyQualifiedName: lending.String("Cash On Hand"), + Name: lending.String("Accounts Receivable"), + NominalCode: lending.String("610"), + Status: shared.AccountStatusActive.ToPointer(), + Type: shared.AccountTypeAsset.ToPointer(), + }, CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) if err != nil { log.Fatal(err) } - if res.AccountingCreateAccountResponse != nil { // handle response } @@ -62,15 +75,18 @@ func main() { | `request` | [operations.CreateAccountRequest](../../pkg/models/operations/createaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.CreateAccountResponse](../../pkg/models/operations/createaccountresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetCreateModel The *Get create account model* endpoint returns the expected data for the request payload when creating an [account](https://docs.codat.io/lending-api#/schemas/Account) for a given company and integration. @@ -112,7 +128,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.PushOption != nil { // handle response } @@ -127,10 +142,12 @@ func main() { | `request` | [operations.GetCreateChartOfAccountsModelRequest](../../pkg/models/operations/getcreatechartofaccountsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCreateChartOfAccountsModelResponse](../../pkg/models/operations/getcreatechartofaccountsmodelresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/codatlendingpayments/README.md b/lending/docs/sdks/codatlendingpayments/README.md index 4a638f2de..328cfd702 100644 --- a/lending/docs/sdks/codatlendingpayments/README.md +++ b/lending/docs/sdks/codatlendingpayments/README.md @@ -1,6 +1,8 @@ # CodatLendingPayments (*LoanWriteback.Payments*) +## Overview + ### Available Operations * [Create](#create) - Create payment @@ -28,6 +30,7 @@ import( "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" lending "github.com/codatio/client-sdk-go/lending/v5" "context" + "github.com/codatio/client-sdk-go/lending/v5/pkg/types" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "log" ) @@ -41,13 +44,48 @@ func main() { ctx := context.Background() res, err := s.LoanWriteback.Payments.Create(ctx, operations.CreatePaymentRequest{ + AccountingPayment: &shared.AccountingPayment{ + AccountRef: &shared.AccountRef{ + ID: lending.String("8000002E-1675267199"), + Name: lending.String("Undeposited Funds"), + }, + Currency: lending.String("USD"), + CurrencyRate: types.MustNewDecimalFromString("1"), + CustomerRef: &shared.AccountingCustomerRef{ + CompanyName: lending.String("string"), + ID: "80000002-1674552702", + }, + Date: "2023-02-10T11:47:04.792Z", + Lines: []shared.PaymentLine{ + shared.PaymentLine{ + AllocatedOnDate: lending.String("2023-02-11T11:47:04.792Z"), + Amount: types.MustNewDecimalFromString("28"), + Links: []shared.PaymentLineLink{ + shared.PaymentLineLink{ + Amount: types.MustNewDecimalFromString("-28"), + CurrencyRate: types.MustNewDecimalFromString("1"), + ID: lending.String("181-1676374586"), + Type: shared.PaymentLinkTypeInvoice, + }, + }, + }, + }, + ModifiedDate: lending.String("2022-10-23T00:00:00Z"), + Note: lending.String("note 14/02 1147"), + PaymentMethodRef: &shared.PaymentMethodRef{ + ID: "string", + Name: lending.String("string"), + }, + Reference: lending.String("ref 14/02 1147"), + SourceModifiedDate: lending.String("2022-10-23T00:00:00Z"), + TotalAmount: types.MustNewDecimalFromString("28"), + }, CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) if err != nil { log.Fatal(err) } - if res.AccountingCreatePaymentResponse != nil { // handle response } @@ -62,15 +100,18 @@ func main() { | `request` | [operations.CreatePaymentRequest](../../pkg/models/operations/createpaymentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.CreatePaymentResponse](../../pkg/models/operations/createpaymentresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetCreateModel The *Get create payment model* endpoint returns the expected data for the request payload when creating a [payment](https://docs.codat.io/lending-api#/schemas/Payment) for a given company and integration. @@ -112,7 +153,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.PushOption != nil { // handle response } @@ -127,10 +167,12 @@ func main() { | `request` | [operations.GetCreatePaymentModelRequest](../../pkg/models/operations/getcreatepaymentmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCreatePaymentModelResponse](../../pkg/models/operations/getcreatepaymentmodelresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/codatlendingreports/README.md b/lending/docs/sdks/codatlendingreports/README.md index 65f18ba3e..e8a2ca046 100644 --- a/lending/docs/sdks/codatlendingreports/README.md +++ b/lending/docs/sdks/codatlendingreports/README.md @@ -1,6 +1,8 @@ # CodatLendingReports (*Sales.Reports*) +## Overview + ### Available Operations * [GetOrders](#getorders) - Get orders report @@ -57,15 +59,14 @@ func main() { res, err := s.Sales.Reports.GetOrders(ctx, operations.GetCommerceOrdersReportRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - NumberOfPeriods: 491586, - PeriodLength: 776309, - PeriodUnit: shared.PeriodUnitWeek, + NumberOfPeriods: 393849, + PeriodLength: 491586, + PeriodUnit: shared.PeriodUnitYear, ReportDate: "29-09-2020", }) if err != nil { log.Fatal(err) } - if res.CommerceReport != nil { // handle response } @@ -80,15 +81,18 @@ func main() { | `request` | [operations.GetCommerceOrdersReportRequest](../../pkg/models/operations/getcommerceordersreportrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCommerceOrdersReportResponse](../../pkg/models/operations/getcommerceordersreportresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetRefunds The *Get refunds report* endpoint returns the number and total value of refunds and the refund rate for a specific company's commerce connection over one or more periods of time. @@ -141,15 +145,14 @@ func main() { res, err := s.Sales.Reports.GetRefunds(ctx, operations.GetCommerceRefundsReportRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - NumberOfPeriods: 277786, - PeriodLength: 876670, - PeriodUnit: shared.PeriodUnitYear, + NumberOfPeriods: 810912, + PeriodLength: 277786, + PeriodUnit: shared.PeriodUnitMonth, ReportDate: "29-09-2020", }) if err != nil { log.Fatal(err) } - if res.CommerceReport != nil { // handle response } @@ -164,10 +167,12 @@ func main() { | `request` | [operations.GetCommerceRefundsReportRequest](../../pkg/models/operations/getcommercerefundsreportrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCommerceRefundsReportResponse](../../pkg/models/operations/getcommercerefundsreportresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/codatlendingsalespayments/README.md b/lending/docs/sdks/codatlendingsalespayments/README.md index b9de19b35..ef91ec688 100644 --- a/lending/docs/sdks/codatlendingsalespayments/README.md +++ b/lending/docs/sdks/codatlendingsalespayments/README.md @@ -1,6 +1,8 @@ # CodatLendingSalesPayments (*Sales.Payments*) +## Overview + ### Available Operations * [Get](#get) - Get payment @@ -41,12 +43,11 @@ func main() { res, err := s.Sales.Payments.Get(ctx, operations.GetCommercePaymentRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - PaymentID: "string", + PaymentID: "", }) if err != nil { log.Fatal(err) } - if res.CommercePayment != nil { // handle response } @@ -61,15 +62,18 @@ func main() { | `request` | [operations.GetCommercePaymentRequest](../../pkg/models/operations/getcommercepaymentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCommercePaymentResponse](../../pkg/models/operations/getcommercepaymentresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List payments* endpoint returns a list of [payments](https://docs.codat.io/lending-api#/schemas/Payment) for a given company's connection. @@ -106,11 +110,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.CommercePayments != nil { // handle response } @@ -125,10 +129,12 @@ func main() { | `request` | [operations.ListCommercePaymentsRequest](../../pkg/models/operations/listcommercepaymentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListCommercePaymentsResponse](../../pkg/models/operations/listcommercepaymentsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/codatlendingsuppliers/README.md b/lending/docs/sdks/codatlendingsuppliers/README.md index 2bc4491a1..b7218c6f7 100644 --- a/lending/docs/sdks/codatlendingsuppliers/README.md +++ b/lending/docs/sdks/codatlendingsuppliers/README.md @@ -1,6 +1,8 @@ # CodatLendingSuppliers (*LoanWriteback.Suppliers*) +## Overview + ### Available Operations * [Create](#create) - Create supplier @@ -42,42 +44,13 @@ func main() { ctx := context.Background() res, err := s.LoanWriteback.Suppliers.Create(ctx, operations.CreateSupplierRequest{ AccountingSupplier: &shared.AccountingSupplier{ - Addresses: []shared.AccountingAddress{ - shared.AccountingAddress{ - City: lending.String("Bakersfield"), - Country: lending.String("USA"), - Line1: lending.String("Unit 51"), - Line2: lending.String("Bakersfield Industrial Estate"), - Region: lending.String("California"), - Type: shared.AccountingAddressTypeBilling, - }, - }, - ContactName: lending.String("Kelly's Industrial Supplies"), - DefaultCurrency: lending.String("string"), - EmailAddress: lending.String("sales@kellysupplies.com"), - ID: lending.String("C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F"), - Metadata: &shared.Metadata{ - IsDeleted: lending.Bool(true), - }, + ContactName: lending.String("Joe Bloggs"), + ID: lending.String("73593"), ModifiedDate: lending.String("2022-10-23T00:00:00Z"), - Phone: lending.String("07999 999999"), - RegistrationNumber: lending.String("string"), + Phone: lending.String("(877) 492-8687"), SourceModifiedDate: lending.String("2022-10-23T00:00:00Z"), - Status: shared.SupplierStatusUnknown, - SupplementalData: &shared.SupplementalData{ - Content: map[string]map[string]interface{}{ - "property1": map[string]interface{}{ - "property1": nil, - "property2": nil, - }, - "property2": map[string]interface{}{ - "property1": nil, - "property2": nil, - }, - }, - }, - SupplierName: lending.String("Kelly's Industrial Supplies"), - TaxNumber: lending.String("string"), + Status: shared.SupplierStatusActive, + SupplierName: lending.String("test 20230420 1004"), }, CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", @@ -85,7 +58,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.AccountingCreateSupplierResponse != nil { // handle response } @@ -100,15 +72,18 @@ func main() { | `request` | [operations.CreateSupplierRequest](../../pkg/models/operations/createsupplierrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.CreateSupplierResponse](../../pkg/models/operations/createsupplierresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetCreateUpdateModel 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/lending-api#/schemas/Supplier) for a given company and integration. @@ -150,7 +125,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.PushOption != nil { // handle response } @@ -165,10 +139,12 @@ func main() { | `request` | [operations.GetCreateUpdateSuppliersModelRequest](../../pkg/models/operations/getcreateupdatesuppliersmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCreateUpdateSuppliersModelResponse](../../pkg/models/operations/getcreateupdatesuppliersmodelresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/codatlendingtransactions/README.md b/lending/docs/sdks/codatlendingtransactions/README.md index 5821b5b3e..3784faa4b 100644 --- a/lending/docs/sdks/codatlendingtransactions/README.md +++ b/lending/docs/sdks/codatlendingtransactions/README.md @@ -1,6 +1,8 @@ # CodatLendingTransactions (*Sales.Transactions*) +## Overview + ### Available Operations * [Get](#get) - Get transaction @@ -41,12 +43,11 @@ func main() { res, err := s.Sales.Transactions.Get(ctx, operations.GetCommerceTransactionRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - TransactionID: "string", + TransactionID: "", }) if err != nil { log.Fatal(err) } - if res.CommerceTransaction != nil { // handle response } @@ -61,15 +62,18 @@ func main() { | `request` | [operations.GetCommerceTransactionRequest](../../pkg/models/operations/getcommercetransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCommerceTransactionResponse](../../pkg/models/operations/getcommercetransactionresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List transactions* endpoint returns a list of [transactions](https://docs.codat.io/lending-api#/schemas/Transaction) for a given company's connection. @@ -106,11 +110,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.CommerceTransactions != nil { // handle response } @@ -125,10 +129,12 @@ func main() { | `request` | [operations.ListCommerceTransactionsRequest](../../pkg/models/operations/listcommercetransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListCommerceTransactionsResponse](../../pkg/models/operations/listcommercetransactionsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/codatlendingtransfers/README.md b/lending/docs/sdks/codatlendingtransfers/README.md index fa5832c61..d5a42bccb 100644 --- a/lending/docs/sdks/codatlendingtransfers/README.md +++ b/lending/docs/sdks/codatlendingtransfers/README.md @@ -1,6 +1,8 @@ # CodatLendingTransfers (*Transactions.Transfers*) +## Overview + ### Available Operations * [Get](#get) - Get transfer @@ -41,12 +43,11 @@ func main() { res, err := s.Transactions.Transfers.Get(ctx, operations.GetAccountingTransferRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - TransferID: "string", + TransferID: "", }) if err != nil { log.Fatal(err) } - if res.AccountingTransfer != nil { // handle response } @@ -61,15 +62,18 @@ func main() { | `request` | [operations.GetAccountingTransferRequest](../../pkg/models/operations/getaccountingtransferrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingTransferResponse](../../pkg/models/operations/getaccountingtransferresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List transfers* endpoint returns a list of [transfers](https://docs.codat.io/lending-api#/schemas/Transfer) for a given company's connection. @@ -106,11 +110,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingTransfers != nil { // handle response } @@ -125,10 +129,12 @@ func main() { | `request` | [operations.ListAccountingTransfersRequest](../../pkg/models/operations/listaccountingtransfersrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingTransfersResponse](../../pkg/models/operations/listaccountingtransfersresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/companies/README.md b/lending/docs/sdks/companies/README.md index 92b6d090d..173fe571c 100644 --- a/lending/docs/sdks/companies/README.md +++ b/lending/docs/sdks/companies/README.md @@ -3,7 +3,7 @@ ## Overview -Create and manage your Codat companies. +Create and manage your SMB users' companies. ### Available Operations @@ -44,12 +44,16 @@ func main() { ctx := context.Background() res, err := s.Companies.Create(ctx, &shared.CompanyRequestBody{ Description: lending.String("Requested early access to the new financing scheme."), - Name: "Bank of Dave", + Groups: []shared.GroupReference{ + shared.GroupReference{ + ID: lending.String("60d2fa12-8a04-11ee-b9d1-0242ac120002"), + }, + }, + Name: "Technicalium", }) if err != nil { log.Fatal(err) } - if res.Company != nil { // handle response } @@ -64,15 +68,18 @@ func main() { | `request` | [shared.CompanyRequestBody](../../pkg/models/shared/companyrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.CreateCompanyResponse](../../pkg/models/operations/createcompanyresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Delete The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/lending-api#/schemas/Company), its [connections](https://docs.codat.io/lending-api#/schemas/Connection) and any cached data. This operation is irreversible. @@ -92,7 +99,6 @@ import( "context" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "log" - "net/http" ) func main() { @@ -109,8 +115,7 @@ func main() { if err != nil { log.Fatal(err) } - - if res.StatusCode == http.StatusOK { + if res != nil { // handle response } } @@ -124,15 +129,18 @@ func main() { | `request` | [operations.DeleteCompanyRequest](../../pkg/models/operations/deletecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DeleteCompanyResponse](../../pkg/models/operations/deletecompanyresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Get The *Get company* endpoint returns a single company for a given `companyId`. @@ -168,7 +176,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.Company != nil { // handle response } @@ -183,15 +190,18 @@ func main() { | `request` | [operations.GetCompanyRequest](../../pkg/models/operations/getcompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCompanyResponse](../../pkg/models/operations/getcompanyresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List companies* endpoint returns a list of [companies] associated to your instances. @@ -224,11 +234,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.Companies != nil { // handle response } @@ -243,15 +253,18 @@ func main() { | `request` | [operations.ListCompaniesRequest](../../pkg/models/operations/listcompaniesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListCompaniesResponse](../../pkg/models/operations/listcompaniesresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Update Use the *Update company* endpoint to update both the name and description of the company. @@ -282,12 +295,20 @@ func main() { ctx := context.Background() res, err := s.Companies.Update(ctx, operations.UpdateCompanyRequest{ + CompanyRequestBody: &shared.CompanyRequestBody{ + Description: lending.String("Requested early access to the new financing scheme."), + Groups: []shared.GroupReference{ + shared.GroupReference{ + ID: lending.String("60d2fa12-8a04-11ee-b9d1-0242ac120002"), + }, + }, + Name: "New Name", + }, CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", }) if err != nil { log.Fatal(err) } - if res.Company != nil { // handle response } @@ -302,10 +323,12 @@ func main() { | `request` | [operations.UpdateCompanyRequest](../../pkg/models/operations/updatecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.UpdateCompanyResponse](../../pkg/models/operations/updatecompanyresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/companyinfo/README.md b/lending/docs/sdks/companyinfo/README.md index 6f86c0e21..cb46514cc 100644 --- a/lending/docs/sdks/companyinfo/README.md +++ b/lending/docs/sdks/companyinfo/README.md @@ -41,7 +41,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.AccountingCompanyInfo != nil { // handle response } @@ -56,15 +55,18 @@ func main() { | `request` | [operations.GetAccountingProfileRequest](../../pkg/models/operations/getaccountingprofilerequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingProfileResponse](../../pkg/models/operations/getaccountingprofileresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetCommerceProfile Retrieve information about the company, as seen in the commerce @@ -101,7 +103,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.CommerceCompanyInfo != nil { // handle response } @@ -116,10 +117,12 @@ func main() { | `request` | [operations.GetCommerceProfileRequest](../../pkg/models/operations/getcommerceprofilerequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCommerceProfileResponse](../../pkg/models/operations/getcommerceprofileresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/connections/README.md b/lending/docs/sdks/connections/README.md index 5a22cb8d2..6a3a1c22c 100644 --- a/lending/docs/sdks/connections/README.md +++ b/lending/docs/sdks/connections/README.md @@ -3,7 +3,7 @@ ## Overview -Manage your companies' data connections. +Create new and manage existing data connections for a company. ### Available Operations @@ -41,12 +41,14 @@ func main() { ctx := context.Background() res, err := s.Connections.Create(ctx, operations.CreateConnectionRequest{ + RequestBody: &operations.CreateConnectionRequestBody{ + PlatformKey: lending.String("gbol"), + }, CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", }) if err != nil { log.Fatal(err) } - if res.Connection != nil { // handle response } @@ -61,15 +63,18 @@ func main() { | `request` | [operations.CreateConnectionRequest](../../pkg/models/operations/createconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.CreateConnectionResponse](../../pkg/models/operations/createconnectionresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Delete Revoke and remove a connection from a company. @@ -86,7 +91,6 @@ import( "context" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "log" - "net/http" ) func main() { @@ -104,8 +108,7 @@ func main() { if err != nil { log.Fatal(err) } - - if res.StatusCode == http.StatusOK { + if res != nil { // handle response } } @@ -119,15 +122,18 @@ func main() { | `request` | [operations.DeleteConnectionRequest](../../pkg/models/operations/deleteconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DeleteConnectionResponse](../../pkg/models/operations/deleteconnectionresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## 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. @@ -160,7 +166,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.Connection != nil { // handle response } @@ -175,15 +180,18 @@ func main() { | `request` | [operations.GetConnectionRequest](../../pkg/models/operations/getconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetConnectionResponse](../../pkg/models/operations/getconnectionresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List List the connections for a company. @@ -214,11 +222,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.Connections != nil { // handle response } @@ -233,15 +241,18 @@ func main() { | `request` | [operations.ListConnectionsRequest](../../pkg/models/operations/listconnectionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListConnectionsResponse](../../pkg/models/operations/listconnectionsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## 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. @@ -268,13 +279,15 @@ func main() { ctx := context.Background() res, err := s.Connections.Unlink(ctx, operations.UnlinkConnectionRequest{ + RequestBody: &operations.UnlinkConnectionUpdateConnection{ + Status: shared.DataConnectionStatusUnlinked.ToPointer(), + }, CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) if err != nil { log.Fatal(err) } - if res.Connection != nil { // handle response } @@ -289,10 +302,12 @@ func main() { | `request` | [operations.UnlinkConnectionRequest](../../pkg/models/operations/unlinkconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.UnlinkConnectionResponse](../../pkg/models/operations/unlinkconnectionresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/createoperations/README.md b/lending/docs/sdks/createoperations/README.md index 0dc76739e..897fb5e53 100644 --- a/lending/docs/sdks/createoperations/README.md +++ b/lending/docs/sdks/createoperations/README.md @@ -1,6 +1,8 @@ # CreateOperations (*LoanWriteback.CreateOperations*) +## Overview + ### Available Operations * [Get](#get) - Get create operation @@ -38,7 +40,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.PushOperation != nil { // handle response } @@ -53,15 +54,18 @@ func main() { | `request` | [operations.GetCreateOperationRequest](../../pkg/models/operations/getcreateoperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCreateOperationResponse](../../pkg/models/operations/getcreateoperationresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List List create operations. @@ -92,11 +96,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.PushOperations != nil { // handle response } @@ -111,10 +115,12 @@ func main() { | `request` | [operations.ListCreateOperationsRequest](../../pkg/models/operations/listcreateoperationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListCreateOperationsResponse](../../pkg/models/operations/listcreateoperationsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/creditnotes/README.md b/lending/docs/sdks/creditnotes/README.md index 12cc9bc65..36c685f42 100644 --- a/lending/docs/sdks/creditnotes/README.md +++ b/lending/docs/sdks/creditnotes/README.md @@ -1,6 +1,8 @@ # CreditNotes (*AccountsReceivable.CreditNotes*) +## Overview + ### Available Operations * [Get](#get) - Get credit note @@ -40,12 +42,11 @@ func main() { ctx := context.Background() res, err := s.AccountsReceivable.CreditNotes.Get(ctx, operations.GetAccountingCreditNoteRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - CreditNoteID: "string", + CreditNoteID: "", }) if err != nil { log.Fatal(err) } - if res.AccountingCreditNote != nil { // handle response } @@ -60,15 +61,18 @@ func main() { | `request` | [operations.GetAccountingCreditNoteRequest](../../pkg/models/operations/getaccountingcreditnoterequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingCreditNoteResponse](../../pkg/models/operations/getaccountingcreditnoteresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List credit notes* endpoint returns a list of [credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote) for a given company's connection. @@ -104,11 +108,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingCreditNotes != nil { // handle response } @@ -123,10 +127,12 @@ func main() { | `request` | [operations.ListAccountingCreditNotesRequest](../../pkg/models/operations/listaccountingcreditnotesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingCreditNotesResponse](../../pkg/models/operations/listaccountingcreditnotesresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/customers/README.md b/lending/docs/sdks/customers/README.md index 307ad7737..82bca18c2 100644 --- a/lending/docs/sdks/customers/README.md +++ b/lending/docs/sdks/customers/README.md @@ -1,6 +1,8 @@ # Customers (*AccountsReceivable.Customers*) +## Overview + ### Available Operations * [DownloadAttachment](#downloadattachment) - Download customer attachment @@ -43,12 +45,11 @@ func main() { AttachmentID: "8a210b68-6988-11ed-a1eb-0242ac120002", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - CustomerID: "string", + CustomerID: "", }) if err != nil { log.Fatal(err) } - if res.Data != nil { // handle response } @@ -63,15 +64,18 @@ func main() { | `request` | [operations.DownloadAccountingCustomerAttachmentRequest](../../pkg/models/operations/downloadaccountingcustomerattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DownloadAccountingCustomerAttachmentResponse](../../pkg/models/operations/downloadaccountingcustomerattachmentresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Get The *Get customer* endpoint returns a single customer for a given customerId. @@ -106,12 +110,11 @@ func main() { ctx := context.Background() res, err := s.AccountsReceivable.Customers.Get(ctx, operations.GetAccountingCustomerRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - CustomerID: "string", + CustomerID: "", }) if err != nil { log.Fatal(err) } - if res.AccountingCustomer != nil { // handle response } @@ -126,15 +129,18 @@ func main() { | `request` | [operations.GetAccountingCustomerRequest](../../pkg/models/operations/getaccountingcustomerrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingCustomerResponse](../../pkg/models/operations/getaccountingcustomerresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetAttachment The *Get customer attachment* endpoint returns a specific attachment for a given `customerId` and `attachmentId`. @@ -169,12 +175,11 @@ func main() { AttachmentID: "8a210b68-6988-11ed-a1eb-0242ac120002", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - CustomerID: "string", + CustomerID: "", }) if err != nil { log.Fatal(err) } - if res.AccountingAttachment != nil { // handle response } @@ -189,15 +194,18 @@ func main() { | `request` | [operations.GetAccountingCustomerAttachmentRequest](../../pkg/models/operations/getaccountingcustomerattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingCustomerAttachmentResponse](../../pkg/models/operations/getaccountingcustomerattachmentresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List customers* endpoint returns a list of [customers](https://docs.codat.io/lending-api#/schemas/Customer) for a given company's connection. @@ -233,11 +241,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingCustomers != nil { // handle response } @@ -252,15 +260,18 @@ func main() { | `request` | [operations.ListAccountingCustomersRequest](../../pkg/models/operations/listaccountingcustomersrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingCustomersResponse](../../pkg/models/operations/listaccountingcustomersresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ListAttachments The *List customer attachments* endpoint returns a list of attachments avialable to download for given `customerId`. @@ -294,12 +305,11 @@ func main() { res, err := s.AccountsReceivable.Customers.ListAttachments(ctx, operations.ListAccountingCustomerAttachmentsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - CustomerID: "string", + CustomerID: "", }) if err != nil { log.Fatal(err) } - if res.Attachments != nil { // handle response } @@ -314,10 +324,12 @@ func main() { | `request` | [operations.ListAccountingCustomerAttachmentsRequest](../../pkg/models/operations/listaccountingcustomerattachmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingCustomerAttachmentsResponse](../../pkg/models/operations/listaccountingcustomerattachmentsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/dataintegrity/README.md b/lending/docs/sdks/dataintegrity/README.md index fb7e98e47..9711f9238 100644 --- a/lending/docs/sdks/dataintegrity/README.md +++ b/lending/docs/sdks/dataintegrity/README.md @@ -44,11 +44,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.DataIntegrityDetails != nil { // handle response } @@ -63,15 +63,18 @@ func main() { | `request` | [operations.ListDataIntegrityDetailsRequest](../../pkg/models/operations/listdataintegritydetailsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListDataIntegrityDetailsResponse](../../pkg/models/operations/listdataintegritydetailsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Status The *Get data integrity status* endpoint returns the [status](https://docs.codat.io/lending-api#/schemas/DataIntegrityStatus) for the company’s match results between the data type provided in the URL and other data types that Data Integrity uses to support matching. @@ -111,7 +114,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.DataIntegrityStatuses != nil { // handle response } @@ -126,15 +128,18 @@ func main() { | `request` | [operations.GetDataIntegrityStatusRequest](../../pkg/models/operations/getdataintegritystatusrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetDataIntegrityStatusResponse](../../pkg/models/operations/getdataintegritystatusresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Summaries The *Get data integrity summary* endpoint returns a [summary](https://docs.codat.io/lending-api#/schemas/DataIntegritySummary) of match results for a given data type filtered by a query string in the [Codat query language](https://docs.codat.io/using-the-api/querying). @@ -167,11 +172,11 @@ func main() { res, err := s.DataIntegrity.Summaries(ctx, operations.GetDataIntegritySummariesRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", DataType: shared.DataIntegrityDataTypeBankingAccounts, + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.DataIntegritySummaries != nil { // handle response } @@ -186,10 +191,12 @@ func main() { | `request` | [operations.GetDataIntegritySummariesRequest](../../pkg/models/operations/getdataintegritysummariesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetDataIntegritySummariesResponse](../../pkg/models/operations/getdataintegritysummariesresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/directcosts/README.md b/lending/docs/sdks/directcosts/README.md index 19b829187..d8c533b06 100644 --- a/lending/docs/sdks/directcosts/README.md +++ b/lending/docs/sdks/directcosts/README.md @@ -1,6 +1,8 @@ # DirectCosts (*LoanWriteback.DirectCosts*) +## Overview + ### Available Operations * [Create](#create) - Create direct cost @@ -28,6 +30,7 @@ import( "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" lending "github.com/codatio/client-sdk-go/lending/v5" "context" + "github.com/codatio/client-sdk-go/lending/v5/pkg/types" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "log" ) @@ -43,11 +46,80 @@ func main() { res, err := s.LoanWriteback.DirectCosts.Create(ctx, operations.CreateDirectCostRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + DirectCostPrototype: &shared.DirectCostPrototype{ + ContactRef: &shared.ContactRef{ + DataType: shared.ContactRefDataTypeSuppliers.ToPointer(), + ID: "80000001-1671793885", + }, + Currency: "USD", + IssueDate: "2023-03-21T10:19:52.223Z", + LineItems: []shared.DirectCostLineItem{ + shared.DirectCostLineItem{ + AccountRef: &shared.AccountRef{ + ID: lending.String("8000000D-1671793811"), + Name: lending.String("Purchases - Hardware for Resale"), + }, + Description: lending.String("test description line 1"), + DiscountAmount: types.MustNewDecimalFromString("0"), + DiscountPercentage: types.MustNewDecimalFromString("0"), + ItemRef: &shared.PropertieItemRef{ + ID: "80000001-1674566705", + Name: lending.String("item test"), + }, + Quantity: types.MustNewDecimalFromString("1"), + SubTotal: types.MustNewDecimalFromString("99"), + TaxAmount: types.MustNewDecimalFromString("360"), + TotalAmount: types.MustNewDecimalFromString("70"), + Tracking: &shared.Tracking{ + InvoiceTo: &shared.RecordRef{ + DataType: lending.String("invoice"), + }, + RecordRefs: []shared.TrackingRecordRef{ + shared.TrackingRecordRef{ + DataType: shared.TrackingRecordRefDataTypeTrackingCategories.ToPointer(), + }, + }, + }, + TrackingCategoryRefs: []shared.TrackingCategoryRef{ + shared.TrackingCategoryRef{ + ID: "80000001-1674553252", + Name: lending.String("Class 1"), + }, + }, + UnitAmount: types.MustNewDecimalFromString("7"), + }, + }, + Note: lending.String("directCost 21/03 09.20"), + PaymentAllocations: []shared.AccountingPaymentAllocation{ + shared.AccountingPaymentAllocation{ + Allocation: shared.Allocation{ + AllocatedOnDate: lending.String("2023-01-29T10:19:52.223Z"), + Currency: lending.String("USD"), + CurrencyRate: types.MustNewDecimalFromString("0"), + TotalAmount: types.MustNewDecimalFromString("88"), + }, + Payment: shared.PaymentAllocationPayment{ + AccountRef: &shared.AccountRef{ + ID: lending.String("80000028-1671794219"), + Name: lending.String("Bank Account 1"), + }, + Currency: lending.String("USD"), + Note: lending.String("payment allocations note"), + PaidOnDate: lending.String("2023-01-28T10:19:52.223Z"), + Reference: lending.String("payment allocations reference"), + TotalAmount: types.MustNewDecimalFromString("54"), + }, + }, + }, + Reference: lending.String("test ref"), + SubTotal: types.MustNewDecimalFromString("362"), + TaxAmount: types.MustNewDecimalFromString("4"), + TotalAmount: types.MustNewDecimalFromString("366"), + }, }) if err != nil { log.Fatal(err) } - if res.AccountingCreateDirectCostResponse != nil { // handle response } @@ -62,15 +134,18 @@ func main() { | `request` | [operations.CreateDirectCostRequest](../../pkg/models/operations/createdirectcostrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.CreateDirectCostResponse](../../pkg/models/operations/createdirectcostresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetCreateModel The *Get create direct cost model* endpoint returns the expected data for the request payload when creating a [direct cost](https://docs.codat.io/lending-api#/schemas/DirectCost) for a given company and integration. @@ -112,7 +187,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.PushOption != nil { // handle response } @@ -127,10 +201,12 @@ func main() { | `request` | [operations.GetCreateDirectCostsModelRequest](../../pkg/models/operations/getcreatedirectcostsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCreateDirectCostsModelResponse](../../pkg/models/operations/getcreatedirectcostsmodelresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/directincomes/README.md b/lending/docs/sdks/directincomes/README.md index ba780b50e..46113c483 100644 --- a/lending/docs/sdks/directincomes/README.md +++ b/lending/docs/sdks/directincomes/README.md @@ -1,6 +1,8 @@ # DirectIncomes (*AccountsReceivable.DirectIncomes*) +## Overview + ### Available Operations * [DownloadAttachment](#downloadattachment) - Download direct income attachment @@ -43,12 +45,11 @@ func main() { AttachmentID: "8a210b68-6988-11ed-a1eb-0242ac120002", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - DirectIncomeID: "string", + DirectIncomeID: "", }) if err != nil { log.Fatal(err) } - if res.Data != nil { // handle response } @@ -63,15 +64,18 @@ func main() { | `request` | [operations.DownloadAccountingDirectIncomeAttachmentRequest](../../pkg/models/operations/downloadaccountingdirectincomeattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DownloadAccountingDirectIncomeAttachmentResponse](../../pkg/models/operations/downloadaccountingdirectincomeattachmentresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Get The *Get direct income* endpoint returns a single direct income for a given directIncomeId. @@ -107,12 +111,11 @@ func main() { res, err := s.AccountsReceivable.DirectIncomes.Get(ctx, operations.GetAccountingDirectIncomeRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - DirectIncomeID: "string", + DirectIncomeID: "", }) if err != nil { log.Fatal(err) } - if res.AccountingDirectIncome != nil { // handle response } @@ -127,15 +130,18 @@ func main() { | `request` | [operations.GetAccountingDirectIncomeRequest](../../pkg/models/operations/getaccountingdirectincomerequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingDirectIncomeResponse](../../pkg/models/operations/getaccountingdirectincomeresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetAttachment The *Get direct income attachment* endpoint returns a specific attachment for a given `directIncomeId` and `attachmentId`. @@ -170,12 +176,11 @@ func main() { AttachmentID: "8a210b68-6988-11ed-a1eb-0242ac120002", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - DirectIncomeID: "string", + DirectIncomeID: "", }) if err != nil { log.Fatal(err) } - if res.AccountingAttachment != nil { // handle response } @@ -190,15 +195,18 @@ func main() { | `request` | [operations.GetAccountingDirectIncomeAttachmentRequest](../../pkg/models/operations/getaccountingdirectincomeattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingDirectIncomeAttachmentResponse](../../pkg/models/operations/getaccountingdirectincomeattachmentresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List direct incomes* endpoint returns a list of [direct incomes](https://docs.codat.io/lending-api#/schemas/DirectIncome) for a given company's connection. @@ -235,11 +243,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingDirectIncomes != nil { // handle response } @@ -254,15 +262,18 @@ func main() { | `request` | [operations.ListAccountingDirectIncomesRequest](../../pkg/models/operations/listaccountingdirectincomesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingDirectIncomesResponse](../../pkg/models/operations/listaccountingdirectincomesresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ListAttachments The *List direct income attachments* endpoint returns a list of attachments available to download for given `directIncomeId`. @@ -296,12 +307,11 @@ func main() { res, err := s.AccountsReceivable.DirectIncomes.ListAttachments(ctx, operations.ListAccountingDirectIncomeAttachmentsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - DirectIncomeID: "string", + DirectIncomeID: "", }) if err != nil { log.Fatal(err) } - if res.Attachments != nil { // handle response } @@ -316,10 +326,12 @@ func main() { | `request` | [operations.ListAccountingDirectIncomeAttachmentsRequest](../../pkg/models/operations/listaccountingdirectincomeattachmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingDirectIncomeAttachmentsResponse](../../pkg/models/operations/listaccountingdirectincomeattachmentsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/disputes/README.md b/lending/docs/sdks/disputes/README.md index 5295ecd3f..ce4d86b89 100644 --- a/lending/docs/sdks/disputes/README.md +++ b/lending/docs/sdks/disputes/README.md @@ -1,6 +1,8 @@ # Disputes (*Sales.Disputes*) +## Overview + ### Available Operations * [Get](#get) - Get dispute @@ -41,12 +43,11 @@ func main() { res, err := s.Sales.Disputes.Get(ctx, operations.GetCommerceDisputeRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - DisputeID: "string", + DisputeID: "", }) if err != nil { log.Fatal(err) } - if res.CommerceDispute != nil { // handle response } @@ -61,15 +62,18 @@ func main() { | `request` | [operations.GetCommerceDisputeRequest](../../pkg/models/operations/getcommercedisputerequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCommerceDisputeResponse](../../pkg/models/operations/getcommercedisputeresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List disputes* endpoint returns a list of [disputes](https://docs.codat.io/lending-api#/schemas/Dispute) for a given company's connection. @@ -106,11 +110,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.CommerceDisputes != nil { // handle response } @@ -125,10 +129,12 @@ func main() { | `request` | [operations.ListCommerceDisputesRequest](../../pkg/models/operations/listcommercedisputesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListCommerceDisputesResponse](../../pkg/models/operations/listcommercedisputesresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/excelreports/README.md b/lending/docs/sdks/excelreports/README.md index 26c2a14b0..07e859627 100644 --- a/lending/docs/sdks/excelreports/README.md +++ b/lending/docs/sdks/excelreports/README.md @@ -47,7 +47,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.Body != nil { // handle response } @@ -62,15 +61,18 @@ func main() { | `request` | [operations.DownloadExcelReportRequest](../../pkg/models/operations/downloadexcelreportrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DownloadExcelReportResponse](../../pkg/models/operations/downloadexcelreportresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Generate The *Generate Excel report* endpoint requests the production of a downloadable Excel file for a report type specified in the `reportType` query parameter. @@ -119,7 +121,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.ExcelStatus != nil { // handle response } @@ -134,15 +135,18 @@ func main() { | `request` | [operations.GenerateExcelReportRequest](../../pkg/models/operations/generateexcelreportrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GenerateExcelReportResponse](../../pkg/models/operations/generateexcelreportresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetStatus The *Get Excel report status* returns the status of the report mostly recently requested for Excel generation. It does not return the status of any historical report requests. @@ -179,7 +183,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.ExcelStatus != nil { // handle response } @@ -194,10 +197,12 @@ func main() { | `request` | [operations.GetExcelReportGenerationStatusRequest](../../pkg/models/operations/getexcelreportgenerationstatusrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetExcelReportGenerationStatusResponse](../../pkg/models/operations/getexcelreportgenerationstatusresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/fileupload/README.md b/lending/docs/sdks/fileupload/README.md index f73cfb209..d7cf222c9 100644 --- a/lending/docs/sdks/fileupload/README.md +++ b/lending/docs/sdks/fileupload/README.md @@ -43,7 +43,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.Data != nil { // handle response } @@ -58,15 +57,18 @@ func main() { | `request` | [operations.DownloadFilesRequest](../../pkg/models/operations/downloadfilesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DownloadFilesResponse](../../pkg/models/operations/downloadfilesresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ListUploaded The *List files* endpoint returns a list of all files uploaded to Codat by the SMB. @@ -98,7 +100,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.Files != nil { // handle response } @@ -113,15 +114,18 @@ func main() { | `request` | [operations.ListFilesRequest](../../pkg/models/operations/listfilesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListFilesResponse](../../pkg/models/operations/listfilesresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Upload The *Upload files* endpoint uploads multiple files provided by the SMB to Codat. This may include personal identity documents, pitch decks, contracts, or files with accounting and banking data. @@ -140,10 +144,10 @@ package main import( "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" lending "github.com/codatio/client-sdk-go/lending/v5" + "os" "context" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "log" - "net/http" ) func main() { @@ -153,6 +157,11 @@ func main() { }), ) + content, fileErr := os.Open("example.file") + if fileErr != nil { + panic(fileErr) + } + ctx := context.Background() res, err := s.FileUpload.Upload(ctx, operations.UploadFilesRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", @@ -161,8 +170,7 @@ func main() { if err != nil { log.Fatal(err) } - - if res.StatusCode == http.StatusOK { + if res != nil { // handle response } } @@ -176,10 +184,12 @@ func main() { | `request` | [operations.UploadFilesRequest](../../pkg/models/operations/uploadfilesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.UploadFilesResponse](../../pkg/models/operations/uploadfilesresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/financialstatements/README.md b/lending/docs/sdks/financialstatements/README.md index 951ab4cf5..1bd114a18 100644 --- a/lending/docs/sdks/financialstatements/README.md +++ b/lending/docs/sdks/financialstatements/README.md @@ -1,5 +1,2 @@ # FinancialStatements -(*FinancialStatements*) - -### Available Operations - +(*FinancialStatements*) \ No newline at end of file diff --git a/lending/docs/sdks/invoices/README.md b/lending/docs/sdks/invoices/README.md index f73361030..0bf049d78 100644 --- a/lending/docs/sdks/invoices/README.md +++ b/lending/docs/sdks/invoices/README.md @@ -1,6 +1,8 @@ # Invoices (*AccountsReceivable.Invoices*) +## Overview + ### Available Operations * [DownloadAttachment](#downloadattachment) - Download invoice attachment @@ -45,12 +47,11 @@ func main() { AttachmentID: "8a210b68-6988-11ed-a1eb-0242ac120002", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - InvoiceID: "string", + InvoiceID: "", }) if err != nil { log.Fatal(err) } - if res.Data != nil { // handle response } @@ -65,15 +66,18 @@ func main() { | `request` | [operations.DownloadAccountingInvoiceAttachmentRequest](../../pkg/models/operations/downloadaccountinginvoiceattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DownloadAccountingInvoiceAttachmentResponse](../../pkg/models/operations/downloadaccountinginvoiceattachmentresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## DownloadPdf Download invoice as a pdf. @@ -101,12 +105,11 @@ func main() { ctx := context.Background() res, err := s.AccountsReceivable.Invoices.DownloadPdf(ctx, operations.DownloadAccountingInvoicePdfRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - InvoiceID: "string", + InvoiceID: "", }) if err != nil { log.Fatal(err) } - if res.Data != nil { // handle response } @@ -121,15 +124,18 @@ func main() { | `request` | [operations.DownloadAccountingInvoicePdfRequest](../../pkg/models/operations/downloadaccountinginvoicepdfrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DownloadAccountingInvoicePdfResponse](../../pkg/models/operations/downloadaccountinginvoicepdfresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Get The *Get invoice* endpoint returns a single invoice for a given invoiceId. @@ -140,6 +146,11 @@ Check out our [coverage explorer](https://knowledge.codat.io/supported-features/ Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). +### Tips and traps + +To access the `paymentAllocations` property, ensure that the `payments` data type is queued and cached in Codat before retrieving `invoices` from Codat's cache. + + ### Example Usage ```go @@ -163,12 +174,11 @@ func main() { ctx := context.Background() res, err := s.AccountsReceivable.Invoices.Get(ctx, operations.GetAccountingInvoiceRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - InvoiceID: "string", + InvoiceID: "", }) if err != nil { log.Fatal(err) } - if res.AccountingInvoice != nil { // handle response } @@ -183,15 +193,18 @@ func main() { | `request` | [operations.GetAccountingInvoiceRequest](../../pkg/models/operations/getaccountinginvoicerequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingInvoiceResponse](../../pkg/models/operations/getaccountinginvoiceresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetAttachment The *Get invoice attachment* endpoint returns a specific attachment for a given `invoiceId` and `attachmentId`. @@ -226,12 +239,11 @@ func main() { AttachmentID: "8a210b68-6988-11ed-a1eb-0242ac120002", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - InvoiceID: "string", + InvoiceID: "", }) if err != nil { log.Fatal(err) } - if res.AccountingAttachment != nil { // handle response } @@ -246,15 +258,18 @@ func main() { | `request` | [operations.GetAccountingInvoiceAttachmentRequest](../../pkg/models/operations/getaccountinginvoiceattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingInvoiceAttachmentResponse](../../pkg/models/operations/getaccountinginvoiceattachmentresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List invoices* endpoint returns a list of [invoices](https://docs.codat.io/lending-api#/schemas/Invoice) for a given company's connection. @@ -270,6 +285,11 @@ Before using this endpoint, you must have [retrieved data for the company](https [Read more about querying](https://docs.codat.io/using-the-api/querying). +### Tips and traps + +To access the `paymentAllocations` property, ensure that the `payments` data type is queued and cached in Codat before retrieving `invoices` from Codat's cache. + + ### Example Usage ```go @@ -296,11 +316,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingInvoices != nil { // handle response } @@ -315,15 +335,18 @@ func main() { | `request` | [operations.ListAccountingInvoicesRequest](../../pkg/models/operations/listaccountinginvoicesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingInvoicesResponse](../../pkg/models/operations/listaccountinginvoicesresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ListAttachments The *List invoice attachments* endpoint returns a list of attachments available to download for given `invoiceId`. @@ -357,12 +380,11 @@ func main() { res, err := s.AccountsReceivable.Invoices.ListAttachments(ctx, operations.ListAccountingInvoiceAttachmentsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - InvoiceID: "string", + InvoiceID: "", }) if err != nil { log.Fatal(err) } - if res.Attachments != nil { // handle response } @@ -377,15 +399,18 @@ func main() { | `request` | [operations.ListAccountingInvoiceAttachmentsRequest](../../pkg/models/operations/listaccountinginvoiceattachmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingInvoiceAttachmentsResponse](../../pkg/models/operations/listaccountinginvoiceattachmentsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ListReconciled Gets a list of invoices linked to the corresponding banking transaction @@ -415,11 +440,11 @@ func main() { CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.EnhancedInvoicesReport != nil { // handle response } @@ -434,10 +459,12 @@ func main() { | `request` | [operations.ListReconciledInvoicesRequest](../../pkg/models/operations/listreconciledinvoicesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListReconciledInvoicesResponse](../../pkg/models/operations/listreconciledinvoicesresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/journalentries/README.md b/lending/docs/sdks/journalentries/README.md index eee976e26..1adafcb87 100644 --- a/lending/docs/sdks/journalentries/README.md +++ b/lending/docs/sdks/journalentries/README.md @@ -1,6 +1,8 @@ # JournalEntries (*Transactions.JournalEntries*) +## Overview + ### Available Operations * [Get](#get) - Get journal entry @@ -40,12 +42,11 @@ func main() { ctx := context.Background() res, err := s.Transactions.JournalEntries.Get(ctx, operations.GetAccountingJournalEntryRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - JournalEntryID: "string", + JournalEntryID: "", }) if err != nil { log.Fatal(err) } - if res.AccountingJournalEntry != nil { // handle response } @@ -60,15 +61,18 @@ func main() { | `request` | [operations.GetAccountingJournalEntryRequest](../../pkg/models/operations/getaccountingjournalentryrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingJournalEntryResponse](../../pkg/models/operations/getaccountingjournalentryresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List journal entries* endpoint returns a list of [journal entries](https://docs.codat.io/lending-api#/schemas/JournalEntry) for a given company's connection. @@ -104,11 +108,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingJournalEntries != nil { // handle response } @@ -123,10 +127,12 @@ func main() { | `request` | [operations.ListAccountingJournalEntriesRequest](../../pkg/models/operations/listaccountingjournalentriesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingJournalEntriesResponse](../../pkg/models/operations/listaccountingjournalentriesresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/journals/README.md b/lending/docs/sdks/journals/README.md index d27aabb38..948e4d1a7 100644 --- a/lending/docs/sdks/journals/README.md +++ b/lending/docs/sdks/journals/README.md @@ -1,6 +1,8 @@ # Journals (*Transactions.Journals*) +## Overview + ### Available Operations * [Get](#get) - Get journal @@ -40,12 +42,11 @@ func main() { ctx := context.Background() res, err := s.Transactions.Journals.Get(ctx, operations.GetAccountingJournalRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - JournalID: "string", + JournalID: "", }) if err != nil { log.Fatal(err) } - if res.AccountingJournal != nil { // handle response } @@ -60,15 +61,18 @@ func main() { | `request` | [operations.GetAccountingJournalRequest](../../pkg/models/operations/getaccountingjournalrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingJournalResponse](../../pkg/models/operations/getaccountingjournalresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List journals* endpoint returns a list of [journals](https://docs.codat.io/lending-api#/schemas/Journal) for a given company's connection. @@ -104,11 +108,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingJournals != nil { // handle response } @@ -123,10 +127,12 @@ func main() { | `request` | [operations.ListAccountingJournalsRequest](../../pkg/models/operations/listaccountingjournalsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingJournalsResponse](../../pkg/models/operations/listaccountingjournalsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/liabilities/README.md b/lending/docs/sdks/liabilities/README.md index fb47d741a..74ae0ba51 100644 --- a/lending/docs/sdks/liabilities/README.md +++ b/lending/docs/sdks/liabilities/README.md @@ -32,7 +32,6 @@ import( "context" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "log" - "net/http" ) func main() { @@ -50,8 +49,7 @@ func main() { if err != nil { log.Fatal(err) } - - if res.StatusCode == http.StatusOK { + if res != nil { // handle response } } @@ -65,15 +63,18 @@ func main() { | `request` | [operations.GenerateLoanSummaryRequest](../../pkg/models/operations/generateloansummaryrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GenerateLoanSummaryResponse](../../pkg/models/operations/generateloansummaryresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GenerateLoanTransactions The _Generate loan transactions_ endpoint requests the generation of the Loan Transactions report. @@ -94,7 +95,6 @@ import( "context" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "log" - "net/http" ) func main() { @@ -112,8 +112,7 @@ func main() { if err != nil { log.Fatal(err) } - - if res.StatusCode == http.StatusOK { + if res != nil { // handle response } } @@ -127,15 +126,18 @@ func main() { | `request` | [operations.GenerateLoanTransactionsRequest](../../pkg/models/operations/generateloantransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GenerateLoanTransactionsResponse](../../pkg/models/operations/generateloantransactionsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetLoanSummary The *Get loan summaries* endpoint returns a summary by integration type of all loans identified from a company's accounting, banking, and commerce integrations. @@ -173,7 +175,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.LoanSummary != nil { // handle response } @@ -188,15 +189,18 @@ func main() { | `request` | [operations.GetLoanSummaryRequest](../../pkg/models/operations/getloansummaryrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetLoanSummaryResponse](../../pkg/models/operations/getloansummaryresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ListLoanTransactions The *List loan transactions* endpoint returns all [loan transactions](https://docs.codat.io/lending-api#/schemas/LoanTransactions) identified from a company's accounting, banking, and commerce integrations. @@ -234,7 +238,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.LoanTransactions != nil { // handle response } @@ -249,10 +252,12 @@ func main() { | `request` | [operations.ListLoanTransactionsRequest](../../pkg/models/operations/listloantransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListLoanTransactionsResponse](../../pkg/models/operations/listloantransactionsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/loanwriteback/README.md b/lending/docs/sdks/loanwriteback/README.md index 0d316f482..b916c4848 100644 --- a/lending/docs/sdks/loanwriteback/README.md +++ b/lending/docs/sdks/loanwriteback/README.md @@ -1,5 +1,2 @@ # LoanWriteback -(*LoanWriteback*) - -### Available Operations - +(*LoanWriteback*) \ No newline at end of file diff --git a/lending/docs/sdks/locations/README.md b/lending/docs/sdks/locations/README.md index 692e61bf1..981272c54 100644 --- a/lending/docs/sdks/locations/README.md +++ b/lending/docs/sdks/locations/README.md @@ -1,6 +1,8 @@ # Locations (*Sales.Locations*) +## Overview + ### Available Operations * [Get](#get) - Get location @@ -41,12 +43,11 @@ func main() { res, err := s.Sales.Locations.Get(ctx, operations.GetCommerceLocationRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - LocationID: "string", + LocationID: "", }) if err != nil { log.Fatal(err) } - if res.CommerceLocation != nil { // handle response } @@ -61,15 +62,18 @@ func main() { | `request` | [operations.GetCommerceLocationRequest](../../pkg/models/operations/getcommercelocationrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCommerceLocationResponse](../../pkg/models/operations/getcommercelocationresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List locations* endpoint returns a list of [locations](https://docs.codat.io/lending-api#/schemas/Location) for a given company's connection. @@ -107,7 +111,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.CommerceLocations != nil { // handle response } @@ -122,10 +125,12 @@ func main() { | `request` | [operations.ListCommerceLocationsRequest](../../pkg/models/operations/listcommercelocationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListCommerceLocationsResponse](../../pkg/models/operations/listcommercelocationsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/managedata/README.md b/lending/docs/sdks/managedata/README.md index 5afec18eb..2634cc6a7 100644 --- a/lending/docs/sdks/managedata/README.md +++ b/lending/docs/sdks/managedata/README.md @@ -1,6 +1,8 @@ # ManageData (*ManageData*) +## Overview + ### Available Operations * [GetStatus](#getstatus) - Get data status @@ -36,7 +38,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.DataStatuses != nil { // handle response } @@ -51,10 +52,12 @@ func main() { | `request` | [operations.GetDataStatusRequest](../../pkg/models/operations/getdatastatusrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetDataStatusResponse](../../pkg/models/operations/getdatastatusresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/metrics/README.md b/lending/docs/sdks/metrics/README.md index 62c5b61e8..dabd79e35 100644 --- a/lending/docs/sdks/metrics/README.md +++ b/lending/docs/sdks/metrics/README.md @@ -1,6 +1,8 @@ # Metrics (*Sales.Metrics*) +## Overview + ### Available Operations * [GetCustomerRetention](#getcustomerretention) - Get customer retention metrics @@ -63,15 +65,14 @@ func main() { res, err := s.Sales.Metrics.GetCustomerRetention(ctx, operations.GetCommerceCustomerRetentionMetricsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - NumberOfPeriods: 497588, - PeriodLength: 613110, - PeriodUnit: shared.PeriodUnitWeek, + NumberOfPeriods: 431272, + PeriodLength: 497588, + PeriodUnit: shared.PeriodUnitDay, ReportDate: "29-09-2020", }) if err != nil { log.Fatal(err) } - if res.CommerceReport != nil { // handle response } @@ -86,15 +87,18 @@ func main() { | `request` | [operations.GetCommerceCustomerRetentionMetricsRequest](../../pkg/models/operations/getcommercecustomerretentionmetricsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCommerceCustomerRetentionMetricsResponse](../../pkg/models/operations/getcommercecustomerretentionmetricsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetLifetimeValue The *Get lifetime value metrics* endpoint returns the average revenue that a specific company will generate throughout its lifespan over one or more periods of time. @@ -145,15 +149,14 @@ func main() { res, err := s.Sales.Metrics.GetLifetimeValue(ctx, operations.GetCommerceLifetimeValueMetricsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - NumberOfPeriods: 900865, - PeriodLength: 614777, - PeriodUnit: shared.PeriodUnitMonth, + NumberOfPeriods: 500610, + PeriodLength: 900865, + PeriodUnit: shared.PeriodUnitYear, ReportDate: "29-09-2020", }) if err != nil { log.Fatal(err) } - if res.CommerceReport != nil { // handle response } @@ -168,15 +171,18 @@ func main() { | `request` | [operations.GetCommerceLifetimeValueMetricsRequest](../../pkg/models/operations/getcommercelifetimevaluemetricsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCommerceLifetimeValueMetricsResponse](../../pkg/models/operations/getcommercelifetimevaluemetricsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetRevenue The *Get revenue report* endpoint returns the revenue and revenue growth for a specific company connection over one or more periods of time. @@ -228,15 +234,14 @@ func main() { res, err := s.Sales.Metrics.GetRevenue(ctx, operations.GetCommerceRevenueMetricsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - NumberOfPeriods: 307462, - PeriodLength: 944219, - PeriodUnit: shared.PeriodUnitDay, + NumberOfPeriods: 120092, + PeriodLength: 307462, + PeriodUnit: shared.PeriodUnitYear, ReportDate: "29-09-2020", }) if err != nil { log.Fatal(err) } - if res.CommerceReport != nil { // handle response } @@ -251,10 +256,12 @@ func main() { | `request` | [operations.GetCommerceRevenueMetricsRequest](../../pkg/models/operations/getcommercerevenuemetricsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCommerceRevenueMetricsResponse](../../pkg/models/operations/getcommercerevenuemetricsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/orders/README.md b/lending/docs/sdks/orders/README.md index cda434f2c..7102e1de6 100644 --- a/lending/docs/sdks/orders/README.md +++ b/lending/docs/sdks/orders/README.md @@ -1,6 +1,8 @@ # Orders (*Sales.Orders*) +## Overview + ### Available Operations * [Get](#get) - Get order @@ -41,12 +43,11 @@ func main() { res, err := s.Sales.Orders.Get(ctx, operations.GetCommerceOrderRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderID: "string", + OrderID: "", }) if err != nil { log.Fatal(err) } - if res.CommerceOrder != nil { // handle response } @@ -61,15 +62,18 @@ func main() { | `request` | [operations.GetCommerceOrderRequest](../../pkg/models/operations/getcommerceorderrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCommerceOrderResponse](../../pkg/models/operations/getcommerceorderresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List orders* endpoint returns a list of [orders](https://docs.codat.io/lending-api#/schemas/Order) for a given company's connection. @@ -106,11 +110,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.CommerceOrders != nil { // handle response } @@ -125,10 +129,12 @@ func main() { | `request` | [operations.ListCommerceOrdersRequest](../../pkg/models/operations/listcommerceordersrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListCommerceOrdersResponse](../../pkg/models/operations/listcommerceordersresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/paymentmethods/README.md b/lending/docs/sdks/paymentmethods/README.md index e4f6b2e92..391914d18 100644 --- a/lending/docs/sdks/paymentmethods/README.md +++ b/lending/docs/sdks/paymentmethods/README.md @@ -1,6 +1,8 @@ # PaymentMethods (*Sales.PaymentMethods*) +## Overview + ### Available Operations * [Get](#get) - Get payment method @@ -41,12 +43,11 @@ func main() { res, err := s.Sales.PaymentMethods.Get(ctx, operations.GetCommercePaymentMethodRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - PaymentMethodID: "string", + PaymentMethodID: "", }) if err != nil { log.Fatal(err) } - if res.CommercePaymentMethod != nil { // handle response } @@ -61,15 +62,18 @@ func main() { | `request` | [operations.GetCommercePaymentMethodRequest](../../pkg/models/operations/getcommercepaymentmethodrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCommercePaymentMethodResponse](../../pkg/models/operations/getcommercepaymentmethodresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List payment methods* endpoint returns a list of [payment methods](https://docs.codat.io/lending-api#/schemas/PaymentMethod) for a given company's connection. @@ -106,11 +110,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.CommercePaymentMethods != nil { // handle response } @@ -125,10 +129,12 @@ func main() { | `request` | [operations.ListCommercePaymentMethodsRequest](../../pkg/models/operations/listcommercepaymentmethodsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListCommercePaymentMethodsResponse](../../pkg/models/operations/listcommercepaymentmethodsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/payments/README.md b/lending/docs/sdks/payments/README.md index 53d6a60fc..d4cdca1a0 100644 --- a/lending/docs/sdks/payments/README.md +++ b/lending/docs/sdks/payments/README.md @@ -1,6 +1,8 @@ # Payments (*AccountsReceivable.Payments*) +## Overview + ### Available Operations * [Get](#get) - Get payment @@ -40,12 +42,11 @@ func main() { ctx := context.Background() res, err := s.AccountsReceivable.Payments.Get(ctx, operations.GetAccountingPaymentRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - PaymentID: "string", + PaymentID: "", }) if err != nil { log.Fatal(err) } - if res.AccountingPayment != nil { // handle response } @@ -60,15 +61,18 @@ func main() { | `request` | [operations.GetAccountingPaymentRequest](../../pkg/models/operations/getaccountingpaymentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingPaymentResponse](../../pkg/models/operations/getaccountingpaymentresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List payments* endpoint returns a list of [payments](https://docs.codat.io/lending-api#/schemas/Payment) for a given company's connection. @@ -104,11 +108,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingPayments != nil { // handle response } @@ -123,10 +127,12 @@ func main() { | `request` | [operations.ListAccountingPaymentsRequest](../../pkg/models/operations/listaccountingpaymentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingPaymentsResponse](../../pkg/models/operations/listaccountingpaymentsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/productcategories/README.md b/lending/docs/sdks/productcategories/README.md index 8f73063e0..6e43931f7 100644 --- a/lending/docs/sdks/productcategories/README.md +++ b/lending/docs/sdks/productcategories/README.md @@ -1,6 +1,8 @@ # ProductCategories (*Sales.ProductCategories*) +## Overview + ### Available Operations * [Get](#get) - Get product category @@ -41,12 +43,11 @@ func main() { res, err := s.Sales.ProductCategories.Get(ctx, operations.GetCommerceProductCategoryRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - ProductID: "string", + ProductID: "", }) if err != nil { log.Fatal(err) } - if res.CommerceProductCategory != nil { // handle response } @@ -61,15 +62,18 @@ func main() { | `request` | [operations.GetCommerceProductCategoryRequest](../../pkg/models/operations/getcommerceproductcategoryrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCommerceProductCategoryResponse](../../pkg/models/operations/getcommerceproductcategoryresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List product categories* endpoint returns a list of [product categories](https://docs.codat.io/lending-api#/schemas/ProductCategory) for a given company's connection. @@ -106,11 +110,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.CommerceProductCategories != nil { // handle response } @@ -125,10 +129,12 @@ func main() { | `request` | [operations.ListCommerceProductCategoriesRequest](../../pkg/models/operations/listcommerceproductcategoriesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListCommerceProductCategoriesResponse](../../pkg/models/operations/listcommerceproductcategoriesresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/products/README.md b/lending/docs/sdks/products/README.md index 2d5634f91..c9f259e53 100644 --- a/lending/docs/sdks/products/README.md +++ b/lending/docs/sdks/products/README.md @@ -1,6 +1,8 @@ # Products (*Sales.Products*) +## Overview + ### Available Operations * [Get](#get) - Get product @@ -41,12 +43,11 @@ func main() { res, err := s.Sales.Products.Get(ctx, operations.GetCommerceProductRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - ProductID: "string", + ProductID: "", }) if err != nil { log.Fatal(err) } - if res.CommerceProduct != nil { // handle response } @@ -61,15 +62,18 @@ func main() { | `request` | [operations.GetCommerceProductRequest](../../pkg/models/operations/getcommerceproductrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCommerceProductResponse](../../pkg/models/operations/getcommerceproductresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List products* endpoint returns a list of [products](https://docs.codat.io/lending-api#/schemas/Product) for a given company's connection. @@ -106,11 +110,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.CommerceProducts != nil { // handle response } @@ -125,10 +129,12 @@ func main() { | `request` | [operations.ListCommerceProductsRequest](../../pkg/models/operations/listcommerceproductsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListCommerceProductsResponse](../../pkg/models/operations/listcommerceproductsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/profitandloss/README.md b/lending/docs/sdks/profitandloss/README.md index f6fe02cdd..fdbc894cc 100644 --- a/lending/docs/sdks/profitandloss/README.md +++ b/lending/docs/sdks/profitandloss/README.md @@ -1,6 +1,8 @@ # ProfitAndLoss (*FinancialStatements.ProfitAndLoss*) +## Overview + ### Available Operations * [Get](#get) - Get profit and loss @@ -40,7 +42,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.AccountingProfitAndLossReport != nil { // handle response } @@ -55,15 +56,18 @@ func main() { | `request` | [operations.GetAccountingProfitAndLossRequest](../../pkg/models/operations/getaccountingprofitandlossrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingProfitAndLossResponse](../../pkg/models/operations/getaccountingprofitandlossresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetCategorizedAccounts The *Get categorized profit and loss statement* endpoint returns a list of categorized accounts that appear on a company’s Profit and Loss statement. It also includes a balance as of the financial statement date. @@ -98,7 +102,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.EnhancedFinancialReport != nil { // handle response } @@ -113,10 +116,12 @@ func main() { | `request` | [operations.GetCategorizedProfitAndLossStatementRequest](../../pkg/models/operations/getcategorizedprofitandlossstatementrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCategorizedProfitAndLossStatementResponse](../../pkg/models/operations/getcategorizedprofitandlossstatementresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/pulloperations/README.md b/lending/docs/sdks/pulloperations/README.md index 28d49f242..aa0a74549 100644 --- a/lending/docs/sdks/pulloperations/README.md +++ b/lending/docs/sdks/pulloperations/README.md @@ -1,6 +1,8 @@ # PullOperations (*ManageData.PullOperations*) +## Overview + ### Available Operations * [Get](#get) - Get pull operation @@ -38,7 +40,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.PullOperation != nil { // handle response } @@ -53,15 +54,18 @@ func main() { | `request` | [operations.GetPullOperationRequest](../../pkg/models/operations/getpulloperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetPullOperationResponse](../../pkg/models/operations/getpulloperationresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List Gets the pull operation history (datasets) for a given company. @@ -92,11 +96,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.PullOperations != nil { // handle response } @@ -111,10 +115,12 @@ func main() { | `request` | [operations.ListPullOperationsRequest](../../pkg/models/operations/listpulloperationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListPullOperationsResponse](../../pkg/models/operations/listpulloperationsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/refresh/README.md b/lending/docs/sdks/refresh/README.md index efd8016bf..3f03607eb 100644 --- a/lending/docs/sdks/refresh/README.md +++ b/lending/docs/sdks/refresh/README.md @@ -1,6 +1,8 @@ # Refresh (*ManageData.Refresh*) +## Overview + ### Available Operations * [AllDataTypes](#alldatatypes) - Refresh all data @@ -25,7 +27,6 @@ import( "context" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "log" - "net/http" ) func main() { @@ -42,8 +43,7 @@ func main() { if err != nil { log.Fatal(err) } - - if res.StatusCode == http.StatusOK { + if res != nil { // handle response } } @@ -57,15 +57,18 @@ func main() { | `request` | [operations.RefreshAllDataTypesRequest](../../pkg/models/operations/refreshalldatatypesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.RefreshAllDataTypesResponse](../../pkg/models/operations/refreshalldatatypesresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## DataType Refreshes a given data type for a given company. @@ -100,7 +103,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.PullOperation != nil { // handle response } @@ -115,10 +117,12 @@ func main() { | `request` | [operations.RefreshDataTypeRequest](../../pkg/models/operations/refreshdatatyperequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.RefreshDataTypeResponse](../../pkg/models/operations/refreshdatatyperesponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/reports/README.md b/lending/docs/sdks/reports/README.md index b97f9fb9f..9c02d04cc 100644 --- a/lending/docs/sdks/reports/README.md +++ b/lending/docs/sdks/reports/README.md @@ -1,6 +1,8 @@ # Reports (*AccountsReceivable.Reports*) +## Overview + ### Available Operations * [GetAgedCreditors](#getagedcreditors) - Aged creditors report @@ -43,7 +45,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.AccountingAgedCreditorReport != nil { // handle response } @@ -58,15 +59,18 @@ func main() { | `request` | [operations.GetAccountingAgedCreditorsReportRequest](../../pkg/models/operations/getaccountingagedcreditorsreportrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingAgedCreditorsReportResponse](../../pkg/models/operations/getaccountingagedcreditorsreportresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetAgedDebtors Returns aged debtors report for company that shows the total outstanding balance due from customers to the business over time. @@ -102,7 +106,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.AccountingAgedDebtorReport != nil { // handle response } @@ -117,15 +120,18 @@ func main() { | `request` | [operations.GetAccountingAgedDebtorsReportRequest](../../pkg/models/operations/getaccountingageddebtorsreportrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingAgedDebtorsReportResponse](../../pkg/models/operations/getaccountingageddebtorsreportresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## IsAgedCreditorsAvailable Indicates whether the aged creditor report is available for the company. @@ -157,7 +163,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.Boolean != nil { // handle response } @@ -172,15 +177,18 @@ func main() { | `request` | [operations.IsAgedCreditorsReportAvailableRequest](../../pkg/models/operations/isagedcreditorsreportavailablerequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.IsAgedCreditorsReportAvailableResponse](../../pkg/models/operations/isagedcreditorsreportavailableresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## IsAgedDebtorsAvailable Indicates whether the aged debtors report is available for the company. @@ -212,7 +220,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.Boolean != nil { // handle response } @@ -227,10 +234,12 @@ func main() { | `request` | [operations.IsAgedDebtorsReportAvailableRequest](../../pkg/models/operations/isageddebtorsreportavailablerequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.IsAgedDebtorsReportAvailableResponse](../../pkg/models/operations/isageddebtorsreportavailableresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | diff --git a/lending/docs/sdks/sales/README.md b/lending/docs/sdks/sales/README.md index f8c539544..27a0b6634 100644 --- a/lending/docs/sdks/sales/README.md +++ b/lending/docs/sdks/sales/README.md @@ -1,5 +1,2 @@ # Sales -(*Sales*) - -### Available Operations - +(*Sales*) \ No newline at end of file diff --git a/lending/docs/sdks/suppliers/README.md b/lending/docs/sdks/suppliers/README.md index c05e35c3c..9a29bceef 100644 --- a/lending/docs/sdks/suppliers/README.md +++ b/lending/docs/sdks/suppliers/README.md @@ -1,6 +1,8 @@ # Suppliers (*AccountsPayable.Suppliers*) +## Overview + ### Available Operations * [DownloadAttachment](#downloadattachment) - Download supplier attachment @@ -43,12 +45,11 @@ func main() { AttachmentID: "8a210b68-6988-11ed-a1eb-0242ac120002", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - SupplierID: "string", + SupplierID: "", }) if err != nil { log.Fatal(err) } - if res.Data != nil { // handle response } @@ -63,15 +64,18 @@ func main() { | `request` | [operations.DownloadAccountingSupplierAttachmentRequest](../../pkg/models/operations/downloadaccountingsupplierattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DownloadAccountingSupplierAttachmentResponse](../../pkg/models/operations/downloadaccountingsupplierattachmentresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Get The *Get supplier* endpoint returns a single supplier for a given supplierId. @@ -106,12 +110,11 @@ func main() { ctx := context.Background() res, err := s.AccountsPayable.Suppliers.Get(ctx, operations.GetAccountingSupplierRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - SupplierID: "string", + SupplierID: "", }) if err != nil { log.Fatal(err) } - if res.AccountingSupplier != nil { // handle response } @@ -126,15 +129,18 @@ func main() { | `request` | [operations.GetAccountingSupplierRequest](../../pkg/models/operations/getaccountingsupplierrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingSupplierResponse](../../pkg/models/operations/getaccountingsupplierresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetAttachment The *Get supplier attachment* endpoint returns a specific attachment for a given `supplierId` and `attachmentId`. @@ -169,12 +175,11 @@ func main() { AttachmentID: "8a210b68-6988-11ed-a1eb-0242ac120002", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - SupplierID: "string", + SupplierID: "", }) if err != nil { log.Fatal(err) } - if res.AccountingAttachment != nil { // handle response } @@ -189,15 +194,18 @@ func main() { | `request` | [operations.GetAccountingSupplierAttachmentRequest](../../pkg/models/operations/getaccountingsupplierattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAccountingSupplierAttachmentResponse](../../pkg/models/operations/getaccountingsupplierattachmentresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) for a given company's connection. @@ -233,11 +241,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.AccountingSuppliers != nil { // handle response } @@ -252,15 +260,18 @@ func main() { | `request` | [operations.ListAccountingSuppliersRequest](../../pkg/models/operations/listaccountingsuppliersrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingSuppliersResponse](../../pkg/models/operations/listaccountingsuppliersresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ListAttachments The *List supplier attachments* endpoint returns a list of attachments available to download for given `supplierId`. @@ -294,12 +305,11 @@ func main() { res, err := s.AccountsPayable.Suppliers.ListAttachments(ctx, operations.ListAccountingSupplierAttachmentsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - SupplierID: "string", + SupplierID: "", }) if err != nil { log.Fatal(err) } - if res.Attachments != nil { // handle response } @@ -314,10 +324,12 @@ func main() { | `request` | [operations.ListAccountingSupplierAttachmentsRequest](../../pkg/models/operations/listaccountingsupplierattachmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListAccountingSupplierAttachmentsResponse](../../pkg/models/operations/listaccountingsupplierattachmentsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/transactioncategories/README.md b/lending/docs/sdks/transactioncategories/README.md index d8c76b320..b1e77410a 100644 --- a/lending/docs/sdks/transactioncategories/README.md +++ b/lending/docs/sdks/transactioncategories/README.md @@ -1,6 +1,8 @@ # TransactionCategories (*Banking.TransactionCategories*) +## Overview + ### Available Operations * [Get](#get) - Get transaction category @@ -41,12 +43,11 @@ func main() { res, err := s.Banking.TransactionCategories.Get(ctx, operations.GetBankingTransactionCategoryRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - TransactionCategoryID: "string", + TransactionCategoryID: "", }) if err != nil { log.Fatal(err) } - if res.BankingTransactionCategory != nil { // handle response } @@ -61,15 +62,18 @@ func main() { | `request` | [operations.GetBankingTransactionCategoryRequest](../../pkg/models/operations/getbankingtransactioncategoryrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetBankingTransactionCategoryResponse](../../pkg/models/operations/getbankingtransactioncategoryresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## List The *List transaction categories* endpoint returns a list of [transaction categories](https://docs.codat.io/lending-api#/schemas/TransactionCategory) for a given company's connection. @@ -106,11 +110,11 @@ func main() { OrderBy: lending.String("-modifiedDate"), Page: lending.Int(1), PageSize: lending.Int(100), + Query: lending.String("id=e3334455-1aed-4e71-ab43-6bccf12092ee"), }) if err != nil { log.Fatal(err) } - if res.BankingTransactionCategories != nil { // handle response } @@ -125,10 +129,12 @@ func main() { | `request` | [operations.ListBankingTransactionCategoriesRequest](../../pkg/models/operations/listbankingtransactioncategoriesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ListBankingTransactionCategoriesResponse](../../pkg/models/operations/listbankingtransactioncategoriesresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | diff --git a/lending/docs/sdks/transactions/README.md b/lending/docs/sdks/transactions/README.md index 0d7b13a30..73d66dd0c 100644 --- a/lending/docs/sdks/transactions/README.md +++ b/lending/docs/sdks/transactions/README.md @@ -1,5 +1,2 @@ # Transactions -(*Transactions*) - -### Available Operations - +(*Transactions*) \ No newline at end of file diff --git a/lending/docs/sdks/transfers/README.md b/lending/docs/sdks/transfers/README.md index 0f6b7e8d7..b51af0117 100644 --- a/lending/docs/sdks/transfers/README.md +++ b/lending/docs/sdks/transfers/README.md @@ -1,6 +1,8 @@ # Transfers (*LoanWriteback.Transfers*) +## Overview + ### Available Operations * [Create](#create) - Create transfer @@ -28,6 +30,7 @@ import( "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" lending "github.com/codatio/client-sdk-go/lending/v5" "context" + "github.com/codatio/client-sdk-go/lending/v5/pkg/types" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "log" ) @@ -41,13 +44,50 @@ func main() { ctx := context.Background() res, err := s.LoanWriteback.Transfers.Create(ctx, operations.CreateTransferRequest{ + AccountingTransfer: &shared.AccountingTransfer{ + ContactRef: &shared.ContactRef{ + DataType: shared.ContactRefDataTypeCustomers.ToPointer(), + ID: "80000028-167239230944", + }, + Date: lending.String("2023-01-26T11:51:18.104Z"), + DepositedRecordRefs: []shared.RecordRef{ + shared.RecordRef{ + DataType: lending.String("invoice"), + }, + }, + Description: lending.String("test transfers push 20230126 12.08"), + From: &shared.TransferAccount{ + AccountRef: &shared.AccountRef{ + ID: lending.String("80000028-1671794219"), + }, + Amount: types.MustNewDecimalFromString("12"), + Currency: lending.String("USD"), + }, + Metadata: &shared.Metadata{ + IsDeleted: lending.Bool(true), + }, + ModifiedDate: lending.String("2022-10-23T00:00:00Z"), + SourceModifiedDate: lending.String("2022-10-23T00:00:00Z"), + To: &shared.TransferAccount{ + AccountRef: &shared.AccountRef{ + ID: lending.String("80000004-1671793811"), + }, + Amount: types.MustNewDecimalFromString("12"), + Currency: lending.String("EUR"), + }, + TrackingCategoryRefs: []shared.TrackingCategoryRef{ + shared.TrackingCategoryRef{ + ID: "80000001-1674553252", + Name: lending.String("Class 1"), + }, + }, + }, CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) if err != nil { log.Fatal(err) } - if res.AccountingCreateTransferResponse != nil { // handle response } @@ -62,15 +102,18 @@ func main() { | `request` | [operations.CreateTransferRequest](../../pkg/models/operations/createtransferrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.CreateTransferResponse](../../pkg/models/operations/createtransferresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | sdkerrors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetCreateModel The *Get create transfer model* endpoint returns the expected data for the request payload when creating a [transfer](https://docs.codat.io/lending-api#/schemas/Transfer) for a given company and integration. @@ -112,7 +155,6 @@ func main() { if err != nil { log.Fatal(err) } - if res.PushOption != nil { // handle response } @@ -127,10 +169,12 @@ func main() { | `request` | [operations.GetCreateTransfersModelRequest](../../pkg/models/operations/getcreatetransfersmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../pkg/models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCreateTransfersModelResponse](../../pkg/models/operations/getcreatetransfersmodelresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | sdkerrors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | diff --git a/lending/excelreports.go b/lending/excelreports.go index a6951cee9..b0163fbf8 100644 --- a/lending/excelreports.go +++ b/lending/excelreports.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -32,10 +35,17 @@ func newExcelReports(sdkConfig sdkConfiguration) *ExcelReports { // // You can [learn more](https://docs.codat.io/lending/excel/overview) about valid Excel report types. func (s *ExcelReports) Download(ctx context.Context, request operations.DownloadExcelReportRequest, opts ...operations.Option) (*operations.DownloadExcelReportResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "download-excel-report", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, - operations.SupportedOptionAcceptHeaderOverride, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,37 +53,47 @@ func (s *ExcelReports) Download(ctx context.Context, request operations.Download return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/assess/excel/download", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/assess/excel/download", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout } - if o.AcceptHeaderOverride != nil { - req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) - } else { - req.Header.Set("Accept", "application/json;q=1, application/octet-stream;q=0") + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/octet-stream") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -81,56 +101,117 @@ func (s *ExcelReports) Download(ctx context.Context, request operations.Download }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - - contentType := httpRes.Header.Get("Content-Type") res := &operations.DownloadExcelReportResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/octet-stream`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/octet-stream`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + res.Body = rawBody default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -148,22 +229,46 @@ func (s *ExcelReports) Download(ctx context.Context, request operations.Download fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // Generate Excel report @@ -182,9 +287,17 @@ func (s *ExcelReports) Download(ctx context.Context, request operations.Download // // [Learn more](https://docs.codat.io/lending/excel/overview) about valid Excel report types. func (s *ExcelReports) Generate(ctx context.Context, request operations.GenerateExcelReportRequest, opts ...operations.Option) (*operations.GenerateExcelReportResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "generate-excel-report", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -192,32 +305,47 @@ func (s *ExcelReports) Generate(ctx context.Context, request operations.Generate return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/assess/excel", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/assess/excel", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -225,53 +353,109 @@ func (s *ExcelReports) Generate(ctx context.Context, request operations.Generate }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GenerateExcelReportResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.ExcelStatus if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -279,7 +463,12 @@ func (s *ExcelReports) Generate(ctx context.Context, request operations.Generate res.ExcelStatus = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -297,22 +486,46 @@ func (s *ExcelReports) Generate(ctx context.Context, request operations.Generate fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetStatus - Get Excel report status @@ -322,9 +535,17 @@ func (s *ExcelReports) Generate(ctx context.Context, request operations.Generate // // When the report generation completes successfully, the `inProgress` property will be marked as `false` and the `success` field will be marked as `true`. func (s *ExcelReports) GetStatus(ctx context.Context, request operations.GetExcelReportGenerationStatusRequest, opts ...operations.Option) (*operations.GetExcelReportGenerationStatusResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-excel-report-generation-status", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -332,32 +553,47 @@ func (s *ExcelReports) GetStatus(ctx context.Context, request operations.GetExce return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/assess/excel", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/assess/excel", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -365,53 +601,109 @@ func (s *ExcelReports) GetStatus(ctx context.Context, request operations.GetExce }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetExcelReportGenerationStatusResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.ExcelStatus if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -419,7 +711,12 @@ func (s *ExcelReports) GetStatus(ctx context.Context, request operations.GetExce res.ExcelStatus = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -437,20 +734,44 @@ func (s *ExcelReports) GetStatus(ctx context.Context, request operations.GetExce fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/fileupload.go b/lending/fileupload.go index 939d4063e..e1d30387d 100644 --- a/lending/fileupload.go +++ b/lending/fileupload.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -28,10 +31,17 @@ func newFileUpload(sdkConfig sdkConfiguration) *FileUpload { // Download all files for a company // The *Download files* endpoint downloads all files that have been uploaded by to SMB to Codat. A `date` may be specified to download any files uploaded on the date provided. func (s *FileUpload) Download(ctx context.Context, request operations.DownloadFilesRequest, opts ...operations.Option) (*operations.DownloadFilesResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "download-files", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, - operations.SupportedOptionAcceptHeaderOverride, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -39,37 +49,47 @@ func (s *FileUpload) Download(ctx context.Context, request operations.DownloadFi return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/files/download", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/files/download", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout } - if o.AcceptHeaderOverride != nil { - req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) - } else { - req.Header.Set("Accept", "application/json;q=1, application/octet-stream;q=0") + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/octet-stream") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -77,60 +97,114 @@ func (s *FileUpload) Download(ctx context.Context, request operations.DownloadFi }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.DownloadFilesResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - if (httpRes.StatusCode == 200) && utils.MatchContentType(contentType, `application/octet-stream`) { - res.Data = httpRes.Body - - return res, nil + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/octet-stream`): + res.Data = httpRes.Body + + return res, nil default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -148,30 +222,62 @@ func (s *FileUpload) Download(ctx context.Context, request operations.DownloadFi fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // ListUploaded - List all files uploaded by a company // The *List files* endpoint returns a list of all files uploaded to Codat by the SMB. func (s *FileUpload) ListUploaded(ctx context.Context, request operations.ListFilesRequest, opts ...operations.Option) (*operations.ListFilesResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-files", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,28 +285,43 @@ func (s *FileUpload) ListUploaded(ctx context.Context, request operations.ListFi return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/files", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/files", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -208,53 +329,109 @@ func (s *FileUpload) ListUploaded(ctx context.Context, request operations.ListFi }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListFilesResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out []shared.File if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -262,7 +439,12 @@ func (s *FileUpload) ListUploaded(ctx context.Context, request operations.ListFi res.Files = out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -278,22 +460,46 @@ func (s *FileUpload) ListUploaded(ctx context.Context, request operations.ListFi fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // Upload files for a company @@ -305,9 +511,17 @@ func (s *FileUpload) ListUploaded(ctx context.Context, request operations.ListFi // - PDF, XLS, XLSX, XLSB, CSV, DOC, DOCX, PPT, PPTX, JPEG, JPG, and PNG files can be uploaded. // - Each file can be up to 10MB in size. func (s *FileUpload) Upload(ctx context.Context, request operations.UploadFilesRequest, opts ...operations.Option) (*operations.UploadFilesResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "upload-files", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -315,35 +529,49 @@ func (s *FileUpload) Upload(ctx context.Context, request operations.UploadFilesR return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/files", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/files", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "FileUpload", "multipart", `request:"mediaType=multipart/form-data"`) if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) + return nil, err } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -351,49 +579,100 @@ func (s *FileUpload) Upload(ctx context.Context, request operations.UploadFilesR }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.UploadFilesResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: case httpRes.StatusCode == 400: @@ -412,20 +691,44 @@ func (s *FileUpload) Upload(ctx context.Context, request operations.UploadFilesR fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/financialstatements.go b/lending/financialstatements.go index bfd97174e..feff9ec64 100644 --- a/lending/financialstatements.go +++ b/lending/financialstatements.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending diff --git a/lending/go.mod b/lending/go.mod index c371e50e4..c84adc468 100644 --- a/lending/go.mod +++ b/lending/go.mod @@ -5,6 +5,4 @@ go 1.20 require ( github.com/cenkalti/backoff/v4 v4.2.0 github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 - github.com/mitchellh/mapstructure v1.5.0 - github.com/spyzhov/ajson v0.8.0 ) diff --git a/lending/go.sum b/lending/go.sum index ae03a472a..f95577939 100644 --- a/lending/go.sum +++ b/lending/go.sum @@ -2,7 +2,3 @@ github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+M github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 h1:S92OBrGuLLZsyM5ybUzgc/mPjIYk2AZqufieooe98uw= github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05/go.mod h1:M9R1FoZ3y//hwwnJtO51ypFGwm8ZfpxPT/ZLtO1mcgQ= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/spyzhov/ajson v0.8.0 h1:sFXyMbi4Y/BKjrsfkUZHSjA2JM1184enheSjjoT/zCc= -github.com/spyzhov/ajson v0.8.0/go.mod h1:63V+CGM6f1Bu/p4nLIN8885ojBdt88TbLoSFzyqMuVA= diff --git a/lending/internal/hooks/hooks.go b/lending/internal/hooks/hooks.go new file mode 100644 index 000000000..8ea491aeb --- /dev/null +++ b/lending/internal/hooks/hooks.go @@ -0,0 +1,144 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package hooks + +import ( + "context" + "errors" + "net/http" +) + +type FailEarly struct { + Cause error +} + +var _ error = (*FailEarly)(nil) + +func (f *FailEarly) Error() string { + return f.Cause.Error() +} + +// HTTPClient provides an interface for supplying the SDK with a custom HTTP client +type HTTPClient interface { + Do(req *http.Request) (*http.Response, error) +} + +type HookContext struct { + Context context.Context + OperationID string + OAuth2Scopes []string + SecuritySource func(context.Context) (interface{}, error) +} + +type BeforeRequestContext struct { + HookContext +} + +type AfterSuccessContext struct { + HookContext +} + +type AfterErrorContext struct { + HookContext +} + +// sdkInitHook is called when the SDK is initializing. The hook can modify and return a new baseURL and HTTP client to be used by the SDK. +type sdkInitHook interface { + SDKInit(baseURL string, client HTTPClient) (string, HTTPClient) +} + +// beforeRequestHook is called before the SDK sends a request. The hook can modify the request before it is sent or return an error to stop the request from being sent. +type beforeRequestHook interface { + BeforeRequest(hookCtx BeforeRequestContext, req *http.Request) (*http.Request, error) +} + +// afterSuccessHook is called after the SDK receives a response. The hook can modify the response before it is handled or return an error to stop the response from being handled. +type afterSuccessHook interface { + AfterSuccess(hookCtx AfterSuccessContext, res *http.Response) (*http.Response, error) +} + +// afterErrorHook is called after the SDK encounters an error, or a non-successful response. The hook can modify the response if available otherwise modify the error. +// All afterErrorHook hooks are called and returning an error won't stop the other hooks from being called. But if you want to stop the other hooks from being called, you can return a FailEarly error wrapping your error. +type afterErrorHook interface { + AfterError(hookCtx AfterErrorContext, res *http.Response, err error) (*http.Response, error) +} + +type Hooks struct { + sdkInitHooks []sdkInitHook + beforeRequestHook []beforeRequestHook + afterSuccessHook []afterSuccessHook + afterErrorHook []afterErrorHook +} + +func New() *Hooks { + h := &Hooks{ + sdkInitHooks: []sdkInitHook{}, + beforeRequestHook: []beforeRequestHook{}, + afterSuccessHook: []afterSuccessHook{}, + afterErrorHook: []afterErrorHook{}, + } + + initHooks(h) + + return h +} + +// registerSDKInitHook registers a hook to be used by the SDK for the initialization event. +func (h *Hooks) registerSDKInitHook(hook sdkInitHook) { + h.sdkInitHooks = append(h.sdkInitHooks, hook) +} + +// registerBeforeRequestHook registers a hook to be used by the SDK for the before request event. +func (h *Hooks) registerBeforeRequestHook(hook beforeRequestHook) { + h.beforeRequestHook = append(h.beforeRequestHook, hook) +} + +// registerAfterSuccessHook registers a hook to be used by the SDK for the after success event. +func (h *Hooks) registerAfterSuccessHook(hook afterSuccessHook) { + h.afterSuccessHook = append(h.afterSuccessHook, hook) +} + +// registerAfterErrorHook registers a hook to be used by the SDK for the after error event. +func (h *Hooks) registerAfterErrorHook(hook afterErrorHook) { + h.afterErrorHook = append(h.afterErrorHook, hook) +} + +func (h *Hooks) SDKInit(baseURL string, client HTTPClient) (string, HTTPClient) { + for _, hook := range h.sdkInitHooks { + baseURL, client = hook.SDKInit(baseURL, client) + } + return baseURL, client +} + +func (h *Hooks) BeforeRequest(hookCtx BeforeRequestContext, req *http.Request) (*http.Request, error) { + for _, hook := range h.beforeRequestHook { + var err error + req, err = hook.BeforeRequest(hookCtx, req) + if err != nil { + return req, err + } + } + return req, nil +} + +func (h *Hooks) AfterSuccess(hookCtx AfterSuccessContext, res *http.Response) (*http.Response, error) { + for _, hook := range h.afterSuccessHook { + var err error + res, err = hook.AfterSuccess(hookCtx, res) + if err != nil { + return res, err + } + } + return res, nil +} + +func (h *Hooks) AfterError(hookCtx AfterErrorContext, res *http.Response, err error) (*http.Response, error) { + for _, hook := range h.afterErrorHook { + res, err = hook.AfterError(hookCtx, res, err) + var fe *FailEarly + if errors.As(err, &fe) { + return nil, fe.Cause + } + } + return res, err +} diff --git a/lending/internal/hooks/registration.go b/lending/internal/hooks/registration.go new file mode 100644 index 000000000..fa131be81 --- /dev/null +++ b/lending/internal/hooks/registration.go @@ -0,0 +1,18 @@ +package hooks + +/* + * This file is only ever generated once on the first generation and then is free to be modified. + * Any hooks you wish to add should be registered in the initHooks function. Feel free to define + * your hooks in this file or in separate files in the hooks package. + * + * Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance. + */ + +func initHooks(h *Hooks) { + // exampleHook := &ExampleHook{} + + // h.registerSDKInitHook(exampleHook) + // h.registerBeforeRequestHook(exampleHook) + // h.registerAfterErrorHook(exampleHook) + // h.registerAfterSuccessHook(exampleHook) +} diff --git a/lending/invoices.go b/lending/invoices.go index d000f9777..bfdaf8fe3 100644 --- a/lending/invoices.go +++ b/lending/invoices.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -31,10 +34,17 @@ func newInvoices(sdkConfig sdkConfiguration) *Invoices { // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support downloading an invoice attachment. func (s *Invoices) DownloadAttachment(ctx context.Context, request operations.DownloadAccountingInvoiceAttachmentRequest, opts ...operations.Option) (*operations.DownloadAccountingInvoiceAttachmentResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "download-accounting-invoice-attachment", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, - operations.SupportedOptionAcceptHeaderOverride, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -42,33 +52,43 @@ func (s *Invoices) DownloadAttachment(ctx context.Context, request operations.Do return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/invoices/{invoiceId}/attachments/{attachmentId}/download", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/invoices/{invoiceId}/attachments/{attachmentId}/download", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout } - if o.AcceptHeaderOverride != nil { - req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) - } else { - req.Header.Set("Accept", "application/json;q=1, application/octet-stream;q=0") + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/octet-stream") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -76,60 +96,114 @@ func (s *Invoices) DownloadAttachment(ctx context.Context, request operations.Do }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.DownloadAccountingInvoiceAttachmentResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - if (httpRes.StatusCode == 200) && utils.MatchContentType(contentType, `application/octet-stream`) { - res.Data = httpRes.Body - - return res, nil + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/octet-stream`): + res.Data = httpRes.Body + + return res, nil default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -145,31 +219,62 @@ func (s *Invoices) DownloadAttachment(ctx context.Context, request operations.Do fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // DownloadPdf - Get invoice as PDF // Download invoice as a pdf. func (s *Invoices) DownloadPdf(ctx context.Context, request operations.DownloadAccountingInvoicePdfRequest, opts ...operations.Option) (*operations.DownloadAccountingInvoicePdfResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "download-accounting-invoice-pdf", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, - operations.SupportedOptionAcceptHeaderOverride, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -177,33 +282,43 @@ func (s *Invoices) DownloadPdf(ctx context.Context, request operations.DownloadA return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/invoices/{invoiceId}/pdf", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/invoices/{invoiceId}/pdf", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout } - if o.AcceptHeaderOverride != nil { - req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) - } else { - req.Header.Set("Accept", "application/json;q=1, application/pdf;q=0") + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/pdf") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -211,60 +326,114 @@ func (s *Invoices) DownloadPdf(ctx context.Context, request operations.DownloadA }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.DownloadAccountingInvoicePdfResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - if (httpRes.StatusCode == 200) && utils.MatchContentType(contentType, `application/pdf`) { - res.Data = httpRes.Body - - return res, nil + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/pdf`): + res.Data = httpRes.Body + + return res, nil default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -282,22 +451,46 @@ func (s *Invoices) DownloadPdf(ctx context.Context, request operations.DownloadA fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // Get invoice @@ -308,10 +501,22 @@ func (s *Invoices) DownloadPdf(ctx context.Context, request operations.DownloadA // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support getting a specific invoice. // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). +// +// ### Tips and traps +// +// To access the `paymentAllocations` property, ensure that the `payments` data type is queued and cached in Codat before retrieving `invoices` from Codat's cache. func (s *Invoices) Get(ctx context.Context, request operations.GetAccountingInvoiceRequest, opts ...operations.Option) (*operations.GetAccountingInvoiceResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-invoice", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -319,28 +524,43 @@ func (s *Invoices) Get(ctx context.Context, request operations.GetAccountingInvo return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/invoices/{invoiceId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/invoices/{invoiceId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -348,53 +568,109 @@ func (s *Invoices) Get(ctx context.Context, request operations.GetAccountingInvo }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingInvoiceResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingInvoice if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -402,7 +678,12 @@ func (s *Invoices) Get(ctx context.Context, request operations.GetAccountingInvo res.AccountingInvoice = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -420,22 +701,46 @@ func (s *Invoices) Get(ctx context.Context, request operations.GetAccountingInvo fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetAttachment - Get invoice attachment @@ -445,9 +750,17 @@ func (s *Invoices) Get(ctx context.Context, request operations.GetAccountingInvo // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support getting an invoice attachment. func (s *Invoices) GetAttachment(ctx context.Context, request operations.GetAccountingInvoiceAttachmentRequest, opts ...operations.Option) (*operations.GetAccountingInvoiceAttachmentResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-invoice-attachment", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -455,28 +768,43 @@ func (s *Invoices) GetAttachment(ctx context.Context, request operations.GetAcco return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/invoices/{invoiceId}/attachments/{attachmentId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/invoices/{invoiceId}/attachments/{attachmentId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -484,53 +812,109 @@ func (s *Invoices) GetAttachment(ctx context.Context, request operations.GetAcco }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingInvoiceAttachmentResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingAttachment if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -538,7 +922,12 @@ func (s *Invoices) GetAttachment(ctx context.Context, request operations.GetAcco res.AccountingAttachment = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -554,22 +943,46 @@ func (s *Invoices) GetAttachment(ctx context.Context, request operations.GetAcco fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List invoices @@ -585,10 +998,22 @@ func (s *Invoices) GetAttachment(ctx context.Context, request operations.GetAcco // - Invoices due after a certain date: `query = dueDate > 2021-01-28` // // [Read more about querying](https://docs.codat.io/using-the-api/querying). +// +// ### Tips and traps +// +// To access the `paymentAllocations` property, ensure that the `payments` data type is queued and cached in Codat before retrieving `invoices` from Codat's cache. func (s *Invoices) List(ctx context.Context, request operations.ListAccountingInvoicesRequest, opts ...operations.Option) (*operations.ListAccountingInvoicesResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-invoices", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -596,32 +1021,47 @@ func (s *Invoices) List(ctx context.Context, request operations.ListAccountingIn return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/invoices", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/invoices", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -629,53 +1069,109 @@ func (s *Invoices) List(ctx context.Context, request operations.ListAccountingIn }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingInvoicesResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingInvoices if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -683,7 +1179,12 @@ func (s *Invoices) List(ctx context.Context, request operations.ListAccountingIn res.AccountingInvoices = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -703,22 +1204,46 @@ func (s *Invoices) List(ctx context.Context, request operations.ListAccountingIn fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // ListAttachments - List invoice attachments @@ -728,9 +1253,17 @@ func (s *Invoices) List(ctx context.Context, request operations.ListAccountingIn // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support listing invoice attachments. func (s *Invoices) ListAttachments(ctx context.Context, request operations.ListAccountingInvoiceAttachmentsRequest, opts ...operations.Option) (*operations.ListAccountingInvoiceAttachmentsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-invoice-attachments", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -738,28 +1271,43 @@ func (s *Invoices) ListAttachments(ctx context.Context, request operations.ListA return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/invoices/{invoiceId}/attachments", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/invoices/{invoiceId}/attachments", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -767,53 +1315,109 @@ func (s *Invoices) ListAttachments(ctx context.Context, request operations.ListA }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingInvoiceAttachmentsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.Attachments if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -821,7 +1425,12 @@ func (s *Invoices) ListAttachments(ctx context.Context, request operations.ListA res.Attachments = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -839,30 +1448,62 @@ func (s *Invoices) ListAttachments(ctx context.Context, request operations.ListA fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // ListReconciled - List reconciled invoices // Gets a list of invoices linked to the corresponding banking transaction func (s *Invoices) ListReconciled(ctx context.Context, request operations.ListReconciledInvoicesRequest, opts ...operations.Option) (*operations.ListReconciledInvoicesResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-reconciled-invoices", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -870,32 +1511,47 @@ func (s *Invoices) ListReconciled(ctx context.Context, request operations.ListRe return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/enhancedInvoices", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/enhancedInvoices", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -903,53 +1559,109 @@ func (s *Invoices) ListReconciled(ctx context.Context, request operations.ListRe }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListReconciledInvoicesResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.EnhancedInvoicesReport if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -957,7 +1669,12 @@ func (s *Invoices) ListReconciled(ctx context.Context, request operations.ListRe res.EnhancedInvoicesReport = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -975,20 +1692,44 @@ func (s *Invoices) ListReconciled(ctx context.Context, request operations.ListRe fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/journalentries.go b/lending/journalentries.go index d20061513..2ff809bbe 100644 --- a/lending/journalentries.go +++ b/lending/journalentries.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newJournalEntries(sdkConfig sdkConfiguration) *JournalEntries { // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *JournalEntries) Get(ctx context.Context, request operations.GetAccountingJournalEntryRequest, opts ...operations.Option) (*operations.GetAccountingJournalEntryResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-journal-entry", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *JournalEntries) Get(ctx context.Context, request operations.GetAccounti return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/journalEntries/{journalEntryId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/journalEntries/{journalEntryId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *JournalEntries) Get(ctx context.Context, request operations.GetAccounti }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingJournalEntryResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingJournalEntry if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *JournalEntries) Get(ctx context.Context, request operations.GetAccounti res.AccountingJournalEntry = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *JournalEntries) Get(ctx context.Context, request operations.GetAccounti fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List journal entries @@ -169,9 +280,17 @@ func (s *JournalEntries) Get(ctx context.Context, request operations.GetAccounti // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *JournalEntries) List(ctx context.Context, request operations.ListAccountingJournalEntriesRequest, opts ...operations.Option) (*operations.ListAccountingJournalEntriesResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-journal-entries", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *JournalEntries) List(ctx context.Context, request operations.ListAccoun return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/journalEntries", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/journalEntries", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *JournalEntries) List(ctx context.Context, request operations.ListAccoun }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingJournalEntriesResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingJournalEntries if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *JournalEntries) List(ctx context.Context, request operations.ListAccoun res.AccountingJournalEntries = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *JournalEntries) List(ctx context.Context, request operations.ListAccoun fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/journals.go b/lending/journals.go index 29deb7b1d..4b8f84ac6 100644 --- a/lending/journals.go +++ b/lending/journals.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newJournals(sdkConfig sdkConfiguration) *Journals { // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Journals) Get(ctx context.Context, request operations.GetAccountingJournalRequest, opts ...operations.Option) (*operations.GetAccountingJournalResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-journal", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *Journals) Get(ctx context.Context, request operations.GetAccountingJour return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/journals/{journalId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/journals/{journalId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *Journals) Get(ctx context.Context, request operations.GetAccountingJour }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingJournalResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingJournal if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *Journals) Get(ctx context.Context, request operations.GetAccountingJour res.AccountingJournal = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *Journals) Get(ctx context.Context, request operations.GetAccountingJour fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List journals @@ -169,9 +280,17 @@ func (s *Journals) Get(ctx context.Context, request operations.GetAccountingJour // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Journals) List(ctx context.Context, request operations.ListAccountingJournalsRequest, opts ...operations.Option) (*operations.ListAccountingJournalsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-journals", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *Journals) List(ctx context.Context, request operations.ListAccountingJo return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/journals", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/journals", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *Journals) List(ctx context.Context, request operations.ListAccountingJo }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingJournalsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingJournals if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *Journals) List(ctx context.Context, request operations.ListAccountingJo res.AccountingJournals = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *Journals) List(ctx context.Context, request operations.ListAccountingJo fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/liabilities.go b/lending/liabilities.go index abf84ba51..33d9220c5 100644 --- a/lending/liabilities.go +++ b/lending/liabilities.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -32,9 +35,17 @@ func newLiabilities(sdkConfig sdkConfiguration) *Liabilities { // // Make sure you have [synced a company](https://docs.codat.io/lending-api#/operations/refresh-company-data) recently before calling the endpoint. func (s *Liabilities) GenerateLoanSummary(ctx context.Context, request operations.GenerateLoanSummaryRequest, opts ...operations.Option) (*operations.GenerateLoanSummaryResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "generate-loan-summary", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -42,32 +53,47 @@ func (s *Liabilities) GenerateLoanSummary(ctx context.Context, request operation return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/liabilities/loans", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/liabilities/loans", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -75,49 +101,100 @@ func (s *Liabilities) GenerateLoanSummary(ctx context.Context, request operation }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GenerateLoanSummaryResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 202: case httpRes.StatusCode == 401: @@ -134,22 +211,46 @@ func (s *Liabilities) GenerateLoanSummary(ctx context.Context, request operation fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GenerateLoanTransactions - Generate loan transactions report @@ -159,9 +260,17 @@ func (s *Liabilities) GenerateLoanSummary(ctx context.Context, request operation // // Make sure you have [synced a company](https://docs.codat.io/lending-api#/operations/refresh-company-data) recently before calling the endpoint. func (s *Liabilities) GenerateLoanTransactions(ctx context.Context, request operations.GenerateLoanTransactionsRequest, opts ...operations.Option) (*operations.GenerateLoanTransactionsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "generate-loan-transactions", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -169,32 +278,47 @@ func (s *Liabilities) GenerateLoanTransactions(ctx context.Context, request oper return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/liabilities/loans/transactions", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/liabilities/loans/transactions", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -202,49 +326,100 @@ func (s *Liabilities) GenerateLoanTransactions(ctx context.Context, request oper }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GenerateLoanTransactionsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 202: case httpRes.StatusCode == 400: @@ -263,22 +438,46 @@ func (s *Liabilities) GenerateLoanTransactions(ctx context.Context, request oper fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetLoanSummary - Get loan summaries @@ -288,9 +487,17 @@ func (s *Liabilities) GenerateLoanTransactions(ctx context.Context, request oper // // Make sure you have [synced a company](https://docs.codat.io/lending-api#/operations/refresh-company-data) recently before calling the endpoint. func (s *Liabilities) GetLoanSummary(ctx context.Context, request operations.GetLoanSummaryRequest, opts ...operations.Option) (*operations.GetLoanSummaryResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-loan-summary", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -298,32 +505,47 @@ func (s *Liabilities) GetLoanSummary(ctx context.Context, request operations.Get return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/liabilities/loans", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/liabilities/loans", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -331,53 +553,109 @@ func (s *Liabilities) GetLoanSummary(ctx context.Context, request operations.Get }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetLoanSummaryResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.LoanSummary if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -385,7 +663,12 @@ func (s *Liabilities) GetLoanSummary(ctx context.Context, request operations.Get res.LoanSummary = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -401,22 +684,46 @@ func (s *Liabilities) GetLoanSummary(ctx context.Context, request operations.Get fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // ListLoanTransactions - List loan transactions @@ -426,9 +733,17 @@ func (s *Liabilities) GetLoanSummary(ctx context.Context, request operations.Get // // Make sure you have [synced a company](https://docs.codat.io/lending-api#/operations/refresh-company-data) recently before calling the endpoint. func (s *Liabilities) ListLoanTransactions(ctx context.Context, request operations.ListLoanTransactionsRequest, opts ...operations.Option) (*operations.ListLoanTransactionsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-loan-transactions", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -436,32 +751,47 @@ func (s *Liabilities) ListLoanTransactions(ctx context.Context, request operatio return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/liabilities/loans/transactions", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/liabilities/loans/transactions", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -469,53 +799,109 @@ func (s *Liabilities) ListLoanTransactions(ctx context.Context, request operatio }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListLoanTransactionsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.LoanTransactions if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -523,7 +909,12 @@ func (s *Liabilities) ListLoanTransactions(ctx context.Context, request operatio res.LoanTransactions = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -541,20 +932,44 @@ func (s *Liabilities) ListLoanTransactions(ctx context.Context, request operatio fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/loanwriteback.go b/lending/loanwriteback.go index 9f0399981..7d5712e69 100644 --- a/lending/loanwriteback.go +++ b/lending/loanwriteback.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending diff --git a/lending/locations.go b/lending/locations.go index d44935f63..7d1112553 100644 --- a/lending/locations.go +++ b/lending/locations.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newLocations(sdkConfig sdkConfiguration) *Locations { // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Locations) Get(ctx context.Context, request operations.GetCommerceLocationRequest, opts ...operations.Option) (*operations.GetCommerceLocationResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-commerce-location", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *Locations) Get(ctx context.Context, request operations.GetCommerceLocat return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-locations/{locationId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-locations/{locationId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *Locations) Get(ctx context.Context, request operations.GetCommerceLocat }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCommerceLocationResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceLocation if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *Locations) Get(ctx context.Context, request operations.GetCommerceLocat res.CommerceLocation = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *Locations) Get(ctx context.Context, request operations.GetCommerceLocat fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List locations @@ -169,9 +280,17 @@ func (s *Locations) Get(ctx context.Context, request operations.GetCommerceLocat // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Locations) List(ctx context.Context, request operations.ListCommerceLocationsRequest, opts ...operations.Option) (*operations.ListCommerceLocationsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-commerce-locations", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,28 +298,43 @@ func (s *Locations) List(ctx context.Context, request operations.ListCommerceLoc return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-locations", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-locations", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -208,53 +342,109 @@ func (s *Locations) List(ctx context.Context, request operations.ListCommerceLoc }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListCommerceLocationsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceLocations if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -262,7 +452,12 @@ func (s *Locations) List(ctx context.Context, request operations.ListCommerceLoc res.CommerceLocations = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -280,20 +475,44 @@ func (s *Locations) List(ctx context.Context, request operations.ListCommerceLoc fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/managedata.go b/lending/managedata.go index 0f38c162c..161287db1 100644 --- a/lending/managedata.go +++ b/lending/managedata.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,11 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" - "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -32,9 +34,17 @@ func newManageData(sdkConfig sdkConfiguration) *ManageData { // GetStatus - Get data status // Get the state of each data type for a company func (s *ManageData) GetStatus(ctx context.Context, request operations.GetDataStatusRequest, opts ...operations.Option) (*operations.GetDataStatusResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-data-status", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -42,28 +52,43 @@ func (s *ManageData) GetStatus(ctx context.Context, request operations.GetDataSt return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/dataStatus", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/dataStatus", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -71,61 +96,122 @@ func (s *ManageData) GetStatus(ctx context.Context, request operations.GetDataSt }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetDataStatusResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): - var out map[string]shared.DataStatus + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + var out operations.GetDataStatusDataStatuses if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.DataStatuses = out + res.DataStatuses = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -141,20 +227,44 @@ func (s *ManageData) GetStatus(ctx context.Context, request operations.GetDataSt fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/metrics.go b/lending/metrics.go index 6204dc689..0199d4073 100644 --- a/lending/metrics.go +++ b/lending/metrics.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -55,9 +58,17 @@ func newMetrics(sdkConfig sdkConfiguration) *Metrics { // // The report data then combines multiple reporting dimensions and measures and outputs the value of each combination. func (s *Metrics) GetCustomerRetention(ctx context.Context, request operations.GetCommerceCustomerRetentionMetricsRequest, opts ...operations.Option) (*operations.GetCommerceCustomerRetentionMetricsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-commerce-customer-retention-metrics", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -65,32 +76,47 @@ func (s *Metrics) GetCustomerRetention(ctx context.Context, request operations.G return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/connections/{connectionId}/assess/commerceMetrics/customerRetention", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/connections/{connectionId}/assess/commerceMetrics/customerRetention", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -98,53 +124,109 @@ func (s *Metrics) GetCustomerRetention(ctx context.Context, request operations.G }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCommerceCustomerRetentionMetricsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceReport if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -152,7 +234,12 @@ func (s *Metrics) GetCustomerRetention(ctx context.Context, request operations.G res.CommerceReport = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -170,22 +257,46 @@ func (s *Metrics) GetCustomerRetention(ctx context.Context, request operations.G fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetLifetimeValue - Get lifetime value metrics @@ -212,9 +323,17 @@ func (s *Metrics) GetCustomerRetention(ctx context.Context, request operations.G // // The report data then combines multiple reporting dimensions and measures and outputs the value of each combination. func (s *Metrics) GetLifetimeValue(ctx context.Context, request operations.GetCommerceLifetimeValueMetricsRequest, opts ...operations.Option) (*operations.GetCommerceLifetimeValueMetricsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-commerce-lifetime-value-metrics", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -222,32 +341,47 @@ func (s *Metrics) GetLifetimeValue(ctx context.Context, request operations.GetCo return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/connections/{connectionId}/assess/commerceMetrics/lifetimeValue", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/connections/{connectionId}/assess/commerceMetrics/lifetimeValue", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -255,53 +389,109 @@ func (s *Metrics) GetLifetimeValue(ctx context.Context, request operations.GetCo }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCommerceLifetimeValueMetricsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceReport if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -309,7 +499,12 @@ func (s *Metrics) GetLifetimeValue(ctx context.Context, request operations.GetCo res.CommerceReport = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -327,22 +522,46 @@ func (s *Metrics) GetLifetimeValue(ctx context.Context, request operations.GetCo fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetRevenue - Get commerce revenue metrics @@ -370,9 +589,17 @@ func (s *Metrics) GetLifetimeValue(ctx context.Context, request operations.GetCo // // The report data then combines multiple reporting dimensions and measures and outputs the value of each combination. func (s *Metrics) GetRevenue(ctx context.Context, request operations.GetCommerceRevenueMetricsRequest, opts ...operations.Option) (*operations.GetCommerceRevenueMetricsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-commerce-revenue-metrics", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -380,32 +607,47 @@ func (s *Metrics) GetRevenue(ctx context.Context, request operations.GetCommerce return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/connections/{connectionId}/assess/commerceMetrics/revenue", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/data/companies/{companyId}/connections/{connectionId}/assess/commerceMetrics/revenue", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -413,53 +655,109 @@ func (s *Metrics) GetRevenue(ctx context.Context, request operations.GetCommerce }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCommerceRevenueMetricsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceReport if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -467,7 +765,12 @@ func (s *Metrics) GetRevenue(ctx context.Context, request operations.GetCommerce res.CommerceReport = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -485,20 +788,44 @@ func (s *Metrics) GetRevenue(ctx context.Context, request operations.GetCommerce fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/orders.go b/lending/orders.go index e8e6daf4c..795788da1 100644 --- a/lending/orders.go +++ b/lending/orders.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newOrders(sdkConfig sdkConfiguration) *Orders { // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Orders) Get(ctx context.Context, request operations.GetCommerceOrderRequest, opts ...operations.Option) (*operations.GetCommerceOrderResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-commerce-order", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *Orders) Get(ctx context.Context, request operations.GetCommerceOrderReq return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-orders/{orderId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-orders/{orderId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *Orders) Get(ctx context.Context, request operations.GetCommerceOrderReq }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCommerceOrderResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceOrder if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *Orders) Get(ctx context.Context, request operations.GetCommerceOrderReq res.CommerceOrder = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *Orders) Get(ctx context.Context, request operations.GetCommerceOrderReq fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List orders @@ -169,9 +280,17 @@ func (s *Orders) Get(ctx context.Context, request operations.GetCommerceOrderReq // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Orders) List(ctx context.Context, request operations.ListCommerceOrdersRequest, opts ...operations.Option) (*operations.ListCommerceOrdersResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-commerce-orders", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *Orders) List(ctx context.Context, request operations.ListCommerceOrders return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-orders", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-orders", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *Orders) List(ctx context.Context, request operations.ListCommerceOrders }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListCommerceOrdersResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceOrders if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *Orders) List(ctx context.Context, request operations.ListCommerceOrders res.CommerceOrders = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *Orders) List(ctx context.Context, request operations.ListCommerceOrders fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/paymentmethods.go b/lending/paymentmethods.go index d3ac0c778..9d1187ad4 100644 --- a/lending/paymentmethods.go +++ b/lending/paymentmethods.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newPaymentMethods(sdkConfig sdkConfiguration) *PaymentMethods { // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *PaymentMethods) Get(ctx context.Context, request operations.GetCommercePaymentMethodRequest, opts ...operations.Option) (*operations.GetCommercePaymentMethodResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-commerce-payment-method", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *PaymentMethods) Get(ctx context.Context, request operations.GetCommerce return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-paymentMethods/{paymentMethodId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-paymentMethods/{paymentMethodId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *PaymentMethods) Get(ctx context.Context, request operations.GetCommerce }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCommercePaymentMethodResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommercePaymentMethod if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *PaymentMethods) Get(ctx context.Context, request operations.GetCommerce res.CommercePaymentMethod = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *PaymentMethods) Get(ctx context.Context, request operations.GetCommerce fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List payment methods @@ -169,9 +280,17 @@ func (s *PaymentMethods) Get(ctx context.Context, request operations.GetCommerce // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *PaymentMethods) List(ctx context.Context, request operations.ListCommercePaymentMethodsRequest, opts ...operations.Option) (*operations.ListCommercePaymentMethodsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-commerce-payment-methods", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *PaymentMethods) List(ctx context.Context, request operations.ListCommer return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-paymentMethods", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-paymentMethods", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *PaymentMethods) List(ctx context.Context, request operations.ListCommer }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListCommercePaymentMethodsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommercePaymentMethods if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *PaymentMethods) List(ctx context.Context, request operations.ListCommer res.CommercePaymentMethods = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *PaymentMethods) List(ctx context.Context, request operations.ListCommer fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/payments.go b/lending/payments.go index ef3fa9e5b..df9a57164 100644 --- a/lending/payments.go +++ b/lending/payments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newPayments(sdkConfig sdkConfiguration) *Payments { // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Payments) Get(ctx context.Context, request operations.GetAccountingPaymentRequest, opts ...operations.Option) (*operations.GetAccountingPaymentResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-payment", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *Payments) Get(ctx context.Context, request operations.GetAccountingPaym return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/payments/{paymentId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/payments/{paymentId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *Payments) Get(ctx context.Context, request operations.GetAccountingPaym }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingPaymentResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingPayment if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *Payments) Get(ctx context.Context, request operations.GetAccountingPaym res.AccountingPayment = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *Payments) Get(ctx context.Context, request operations.GetAccountingPaym fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List payments @@ -169,9 +280,17 @@ func (s *Payments) Get(ctx context.Context, request operations.GetAccountingPaym // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Payments) List(ctx context.Context, request operations.ListAccountingPaymentsRequest, opts ...operations.Option) (*operations.ListAccountingPaymentsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-payments", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *Payments) List(ctx context.Context, request operations.ListAccountingPa return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/payments", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/payments", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *Payments) List(ctx context.Context, request operations.ListAccountingPa }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingPaymentsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingPayments if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *Payments) List(ctx context.Context, request operations.ListAccountingPa res.AccountingPayments = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *Payments) List(ctx context.Context, request operations.ListAccountingPa fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/pkg/models/operations/createaccount.go b/lending/pkg/models/operations/createaccount.go index 4a0a028a1..2ad1f3e1d 100644 --- a/lending/pkg/models/operations/createaccount.go +++ b/lending/pkg/models/operations/createaccount.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/createbankaccount.go b/lending/pkg/models/operations/createbankaccount.go index 01a14d638..d5bc730dc 100644 --- a/lending/pkg/models/operations/createbankaccount.go +++ b/lending/pkg/models/operations/createbankaccount.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/createbanktransactions.go b/lending/pkg/models/operations/createbanktransactions.go index b17770de1..c28e27f36 100644 --- a/lending/pkg/models/operations/createbanktransactions.go +++ b/lending/pkg/models/operations/createbanktransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/createcompany.go b/lending/pkg/models/operations/createcompany.go index b5b22a2c1..70f78ed2a 100644 --- a/lending/pkg/models/operations/createcompany.go +++ b/lending/pkg/models/operations/createcompany.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/createconnection.go b/lending/pkg/models/operations/createconnection.go index 4c871d9c7..7fc6d5217 100644 --- a/lending/pkg/models/operations/createconnection.go +++ b/lending/pkg/models/operations/createconnection.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/createdirectcost.go b/lending/pkg/models/operations/createdirectcost.go index 34b795e9a..c3bad539c 100644 --- a/lending/pkg/models/operations/createdirectcost.go +++ b/lending/pkg/models/operations/createdirectcost.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/createpayment.go b/lending/pkg/models/operations/createpayment.go index c29a65e52..23769709b 100644 --- a/lending/pkg/models/operations/createpayment.go +++ b/lending/pkg/models/operations/createpayment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/createsupplier.go b/lending/pkg/models/operations/createsupplier.go index e9264e732..4116eebf6 100644 --- a/lending/pkg/models/operations/createsupplier.go +++ b/lending/pkg/models/operations/createsupplier.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/createtransfer.go b/lending/pkg/models/operations/createtransfer.go index 9bd751902..94c451d84 100644 --- a/lending/pkg/models/operations/createtransfer.go +++ b/lending/pkg/models/operations/createtransfer.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/deletecompany.go b/lending/pkg/models/operations/deletecompany.go index 4fe14e7e9..e23526cf3 100644 --- a/lending/pkg/models/operations/deletecompany.go +++ b/lending/pkg/models/operations/deletecompany.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/deleteconnection.go b/lending/pkg/models/operations/deleteconnection.go index 6e5d2d358..c6574cf51 100644 --- a/lending/pkg/models/operations/deleteconnection.go +++ b/lending/pkg/models/operations/deleteconnection.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/downloadaccountingbillattachment.go b/lending/pkg/models/operations/downloadaccountingbillattachment.go index c81f82735..235c1d382 100644 --- a/lending/pkg/models/operations/downloadaccountingbillattachment.go +++ b/lending/pkg/models/operations/downloadaccountingbillattachment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/downloadaccountingcustomerattachment.go b/lending/pkg/models/operations/downloadaccountingcustomerattachment.go index a9890ded4..86919a442 100644 --- a/lending/pkg/models/operations/downloadaccountingcustomerattachment.go +++ b/lending/pkg/models/operations/downloadaccountingcustomerattachment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/downloadaccountingdirectcostattachment.go b/lending/pkg/models/operations/downloadaccountingdirectcostattachment.go index 455335d68..7ac1f25fb 100644 --- a/lending/pkg/models/operations/downloadaccountingdirectcostattachment.go +++ b/lending/pkg/models/operations/downloadaccountingdirectcostattachment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/downloadaccountingdirectincomeattachment.go b/lending/pkg/models/operations/downloadaccountingdirectincomeattachment.go index acc031d37..6ce9ec722 100644 --- a/lending/pkg/models/operations/downloadaccountingdirectincomeattachment.go +++ b/lending/pkg/models/operations/downloadaccountingdirectincomeattachment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/downloadaccountinginvoiceattachment.go b/lending/pkg/models/operations/downloadaccountinginvoiceattachment.go index 7559183ff..60c5de712 100644 --- a/lending/pkg/models/operations/downloadaccountinginvoiceattachment.go +++ b/lending/pkg/models/operations/downloadaccountinginvoiceattachment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/downloadaccountinginvoicepdf.go b/lending/pkg/models/operations/downloadaccountinginvoicepdf.go index 4a31912d7..93595db20 100644 --- a/lending/pkg/models/operations/downloadaccountinginvoicepdf.go +++ b/lending/pkg/models/operations/downloadaccountinginvoicepdf.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/downloadaccountingsupplierattachment.go b/lending/pkg/models/operations/downloadaccountingsupplierattachment.go index 21a87bc98..26730fb6e 100644 --- a/lending/pkg/models/operations/downloadaccountingsupplierattachment.go +++ b/lending/pkg/models/operations/downloadaccountingsupplierattachment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/downloadexcelreport.go b/lending/pkg/models/operations/downloadexcelreport.go index 6478afa5f..db83a0762 100644 --- a/lending/pkg/models/operations/downloadexcelreport.go +++ b/lending/pkg/models/operations/downloadexcelreport.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/downloadfiles.go b/lending/pkg/models/operations/downloadfiles.go index 6b73a34a9..ea7f5fff3 100644 --- a/lending/pkg/models/operations/downloadfiles.go +++ b/lending/pkg/models/operations/downloadfiles.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/endbankstatementuploadsession.go b/lending/pkg/models/operations/endbankstatementuploadsession.go new file mode 100644 index 000000000..18d777b35 --- /dev/null +++ b/lending/pkg/models/operations/endbankstatementuploadsession.go @@ -0,0 +1,76 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "net/http" +) + +type EndBankStatementUploadSessionRequest struct { + EndUploadSessionRequest *shared.EndUploadSessionRequest `request:"mediaType=application/json"` + // Unique identifier for a company. + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + // Unique identifier for a connection. + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` + // Unique identifier for the dataset that completed its sync. + DatasetID string `pathParam:"style=simple,explode=false,name=datasetId"` +} + +func (o *EndBankStatementUploadSessionRequest) GetEndUploadSessionRequest() *shared.EndUploadSessionRequest { + if o == nil { + return nil + } + return o.EndUploadSessionRequest +} + +func (o *EndBankStatementUploadSessionRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *EndBankStatementUploadSessionRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +func (o *EndBankStatementUploadSessionRequest) GetDatasetID() string { + if o == nil { + return "" + } + return o.DatasetID +} + +type EndBankStatementUploadSessionResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *EndBankStatementUploadSessionResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *EndBankStatementUploadSessionResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *EndBankStatementUploadSessionResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/generateexcelreport.go b/lending/pkg/models/operations/generateexcelreport.go index e0761545e..3007acc58 100644 --- a/lending/pkg/models/operations/generateexcelreport.go +++ b/lending/pkg/models/operations/generateexcelreport.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/generateloansummary.go b/lending/pkg/models/operations/generateloansummary.go index afa6e81f4..6754c4292 100644 --- a/lending/pkg/models/operations/generateloansummary.go +++ b/lending/pkg/models/operations/generateloansummary.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations @@ -20,7 +20,6 @@ const ( func (e SourceType) ToPointer() *SourceType { return &e } - func (e *SourceType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/operations/generateloantransactions.go b/lending/pkg/models/operations/generateloantransactions.go index e011b001c..d828cc74d 100644 --- a/lending/pkg/models/operations/generateloantransactions.go +++ b/lending/pkg/models/operations/generateloantransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations @@ -20,7 +20,6 @@ const ( func (e QueryParamSourceType) ToPointer() *QueryParamSourceType { return &e } - func (e *QueryParamSourceType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/operations/getaccountingaccount.go b/lending/pkg/models/operations/getaccountingaccount.go index b16e84f72..e79912cb8 100644 --- a/lending/pkg/models/operations/getaccountingaccount.go +++ b/lending/pkg/models/operations/getaccountingaccount.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingaccounttransaction.go b/lending/pkg/models/operations/getaccountingaccounttransaction.go index f0396ba2e..e3d423e60 100644 --- a/lending/pkg/models/operations/getaccountingaccounttransaction.go +++ b/lending/pkg/models/operations/getaccountingaccounttransaction.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingagedcreditorsreport.go b/lending/pkg/models/operations/getaccountingagedcreditorsreport.go index bb01d8fe7..410949c85 100644 --- a/lending/pkg/models/operations/getaccountingagedcreditorsreport.go +++ b/lending/pkg/models/operations/getaccountingagedcreditorsreport.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingageddebtorsreport.go b/lending/pkg/models/operations/getaccountingageddebtorsreport.go index d0794cc62..2b5df5c44 100644 --- a/lending/pkg/models/operations/getaccountingageddebtorsreport.go +++ b/lending/pkg/models/operations/getaccountingageddebtorsreport.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingbalancesheet.go b/lending/pkg/models/operations/getaccountingbalancesheet.go index b714905ab..58fdec2ff 100644 --- a/lending/pkg/models/operations/getaccountingbalancesheet.go +++ b/lending/pkg/models/operations/getaccountingbalancesheet.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingbankaccount.go b/lending/pkg/models/operations/getaccountingbankaccount.go index 484922f40..ef32fa75b 100644 --- a/lending/pkg/models/operations/getaccountingbankaccount.go +++ b/lending/pkg/models/operations/getaccountingbankaccount.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingbill.go b/lending/pkg/models/operations/getaccountingbill.go index 6cda76604..dc215824e 100644 --- a/lending/pkg/models/operations/getaccountingbill.go +++ b/lending/pkg/models/operations/getaccountingbill.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingbillattachment.go b/lending/pkg/models/operations/getaccountingbillattachment.go index 235d149b3..35dc5a1cb 100644 --- a/lending/pkg/models/operations/getaccountingbillattachment.go +++ b/lending/pkg/models/operations/getaccountingbillattachment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingbillcreditnote.go b/lending/pkg/models/operations/getaccountingbillcreditnote.go index 78dd8bf3d..be5421562 100644 --- a/lending/pkg/models/operations/getaccountingbillcreditnote.go +++ b/lending/pkg/models/operations/getaccountingbillcreditnote.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingbillpayment.go b/lending/pkg/models/operations/getaccountingbillpayment.go index 283dbc7d0..0997aebac 100644 --- a/lending/pkg/models/operations/getaccountingbillpayment.go +++ b/lending/pkg/models/operations/getaccountingbillpayment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingcashflowstatement.go b/lending/pkg/models/operations/getaccountingcashflowstatement.go index 85439ac3b..43b8be564 100644 --- a/lending/pkg/models/operations/getaccountingcashflowstatement.go +++ b/lending/pkg/models/operations/getaccountingcashflowstatement.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingcreditnote.go b/lending/pkg/models/operations/getaccountingcreditnote.go index 0d7e21767..474ada4cc 100644 --- a/lending/pkg/models/operations/getaccountingcreditnote.go +++ b/lending/pkg/models/operations/getaccountingcreditnote.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingcustomer.go b/lending/pkg/models/operations/getaccountingcustomer.go index 95c891be2..b8ab6ab5e 100644 --- a/lending/pkg/models/operations/getaccountingcustomer.go +++ b/lending/pkg/models/operations/getaccountingcustomer.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingcustomerattachment.go b/lending/pkg/models/operations/getaccountingcustomerattachment.go index ad232bf5f..55bc641df 100644 --- a/lending/pkg/models/operations/getaccountingcustomerattachment.go +++ b/lending/pkg/models/operations/getaccountingcustomerattachment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingdirectcost.go b/lending/pkg/models/operations/getaccountingdirectcost.go index 14330544f..6e24b9d41 100644 --- a/lending/pkg/models/operations/getaccountingdirectcost.go +++ b/lending/pkg/models/operations/getaccountingdirectcost.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingdirectcostattachment.go b/lending/pkg/models/operations/getaccountingdirectcostattachment.go index 491d1b35b..f8ada4eb5 100644 --- a/lending/pkg/models/operations/getaccountingdirectcostattachment.go +++ b/lending/pkg/models/operations/getaccountingdirectcostattachment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingdirectincome.go b/lending/pkg/models/operations/getaccountingdirectincome.go index 1309b0754..64b49bd59 100644 --- a/lending/pkg/models/operations/getaccountingdirectincome.go +++ b/lending/pkg/models/operations/getaccountingdirectincome.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingdirectincomeattachment.go b/lending/pkg/models/operations/getaccountingdirectincomeattachment.go index 70f7fcb6c..8e4f694a8 100644 --- a/lending/pkg/models/operations/getaccountingdirectincomeattachment.go +++ b/lending/pkg/models/operations/getaccountingdirectincomeattachment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountinginvoice.go b/lending/pkg/models/operations/getaccountinginvoice.go index c352020f3..6fc4a2891 100644 --- a/lending/pkg/models/operations/getaccountinginvoice.go +++ b/lending/pkg/models/operations/getaccountinginvoice.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountinginvoiceattachment.go b/lending/pkg/models/operations/getaccountinginvoiceattachment.go index cc2588aaa..92fbb0319 100644 --- a/lending/pkg/models/operations/getaccountinginvoiceattachment.go +++ b/lending/pkg/models/operations/getaccountinginvoiceattachment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingjournal.go b/lending/pkg/models/operations/getaccountingjournal.go index ea09303b8..271d821c2 100644 --- a/lending/pkg/models/operations/getaccountingjournal.go +++ b/lending/pkg/models/operations/getaccountingjournal.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingjournalentry.go b/lending/pkg/models/operations/getaccountingjournalentry.go index 6000ff1a4..b2ff3fedd 100644 --- a/lending/pkg/models/operations/getaccountingjournalentry.go +++ b/lending/pkg/models/operations/getaccountingjournalentry.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingpayment.go b/lending/pkg/models/operations/getaccountingpayment.go index 6cdf4448a..ff7b95ead 100644 --- a/lending/pkg/models/operations/getaccountingpayment.go +++ b/lending/pkg/models/operations/getaccountingpayment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingprofile.go b/lending/pkg/models/operations/getaccountingprofile.go index f8ed3e51c..d47f12586 100644 --- a/lending/pkg/models/operations/getaccountingprofile.go +++ b/lending/pkg/models/operations/getaccountingprofile.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingprofitandloss.go b/lending/pkg/models/operations/getaccountingprofitandloss.go index c3170e324..654c77551 100644 --- a/lending/pkg/models/operations/getaccountingprofitandloss.go +++ b/lending/pkg/models/operations/getaccountingprofitandloss.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingsupplier.go b/lending/pkg/models/operations/getaccountingsupplier.go index 0925f8ea3..07ee3d963 100644 --- a/lending/pkg/models/operations/getaccountingsupplier.go +++ b/lending/pkg/models/operations/getaccountingsupplier.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingsupplierattachment.go b/lending/pkg/models/operations/getaccountingsupplierattachment.go index 0ac8851c6..628bbfeeb 100644 --- a/lending/pkg/models/operations/getaccountingsupplierattachment.go +++ b/lending/pkg/models/operations/getaccountingsupplierattachment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getaccountingtransfer.go b/lending/pkg/models/operations/getaccountingtransfer.go index 3307cd426..3da17174f 100644 --- a/lending/pkg/models/operations/getaccountingtransfer.go +++ b/lending/pkg/models/operations/getaccountingtransfer.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getbankingaccount.go b/lending/pkg/models/operations/getbankingaccount.go index a53e743ab..3d5e30721 100644 --- a/lending/pkg/models/operations/getbankingaccount.go +++ b/lending/pkg/models/operations/getbankingaccount.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getbankingtransaction.go b/lending/pkg/models/operations/getbankingtransaction.go index 711fdc843..766632bec 100644 --- a/lending/pkg/models/operations/getbankingtransaction.go +++ b/lending/pkg/models/operations/getbankingtransaction.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getbankingtransactioncategory.go b/lending/pkg/models/operations/getbankingtransactioncategory.go index 39638d7b9..9c4e7bfdc 100644 --- a/lending/pkg/models/operations/getbankingtransactioncategory.go +++ b/lending/pkg/models/operations/getbankingtransactioncategory.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getbankstatementuploadconfiguration.go b/lending/pkg/models/operations/getbankstatementuploadconfiguration.go new file mode 100644 index 000000000..8b55c4859 --- /dev/null +++ b/lending/pkg/models/operations/getbankstatementuploadconfiguration.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "net/http" +) + +type GetBankStatementUploadConfigurationRequest struct { + // Unique identifier for a company. + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + // Unique identifier for a connection. + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` +} + +func (o *GetBankStatementUploadConfigurationRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *GetBankStatementUploadConfigurationRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +type GetBankStatementUploadConfigurationResponse struct { + // Success + BankStatementUploadConfiguration *shared.BankStatementUploadConfiguration + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetBankStatementUploadConfigurationResponse) GetBankStatementUploadConfiguration() *shared.BankStatementUploadConfiguration { + if o == nil { + return nil + } + return o.BankStatementUploadConfiguration +} + +func (o *GetBankStatementUploadConfigurationResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetBankStatementUploadConfigurationResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetBankStatementUploadConfigurationResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/getcategorizedbalancesheetstatement.go b/lending/pkg/models/operations/getcategorizedbalancesheetstatement.go index f328356fe..723493030 100644 --- a/lending/pkg/models/operations/getcategorizedbalancesheetstatement.go +++ b/lending/pkg/models/operations/getcategorizedbalancesheetstatement.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcategorizedbankstatement.go b/lending/pkg/models/operations/getcategorizedbankstatement.go index 05b6921ea..842657a8e 100644 --- a/lending/pkg/models/operations/getcategorizedbankstatement.go +++ b/lending/pkg/models/operations/getcategorizedbankstatement.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcategorizedprofitandlossstatement.go b/lending/pkg/models/operations/getcategorizedprofitandlossstatement.go index 00a4d0d4b..afb04f832 100644 --- a/lending/pkg/models/operations/getcategorizedprofitandlossstatement.go +++ b/lending/pkg/models/operations/getcategorizedprofitandlossstatement.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcommercecustomer.go b/lending/pkg/models/operations/getcommercecustomer.go index e10cd9ade..20397e1c3 100644 --- a/lending/pkg/models/operations/getcommercecustomer.go +++ b/lending/pkg/models/operations/getcommercecustomer.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcommercecustomerretentionmetrics.go b/lending/pkg/models/operations/getcommercecustomerretentionmetrics.go index 209ade476..6c330f08d 100644 --- a/lending/pkg/models/operations/getcommercecustomerretentionmetrics.go +++ b/lending/pkg/models/operations/getcommercecustomerretentionmetrics.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcommercedispute.go b/lending/pkg/models/operations/getcommercedispute.go index 2f9e9926c..2b00f3ea7 100644 --- a/lending/pkg/models/operations/getcommercedispute.go +++ b/lending/pkg/models/operations/getcommercedispute.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcommercelifetimevaluemetrics.go b/lending/pkg/models/operations/getcommercelifetimevaluemetrics.go index 399dace56..3b138327b 100644 --- a/lending/pkg/models/operations/getcommercelifetimevaluemetrics.go +++ b/lending/pkg/models/operations/getcommercelifetimevaluemetrics.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcommercelocation.go b/lending/pkg/models/operations/getcommercelocation.go index d93e2a9f4..40c53c841 100644 --- a/lending/pkg/models/operations/getcommercelocation.go +++ b/lending/pkg/models/operations/getcommercelocation.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcommerceorder.go b/lending/pkg/models/operations/getcommerceorder.go index 005f066b9..2775b80ff 100644 --- a/lending/pkg/models/operations/getcommerceorder.go +++ b/lending/pkg/models/operations/getcommerceorder.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcommerceordersreport.go b/lending/pkg/models/operations/getcommerceordersreport.go index 64a1fc4af..88c2a4f17 100644 --- a/lending/pkg/models/operations/getcommerceordersreport.go +++ b/lending/pkg/models/operations/getcommerceordersreport.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcommercepayment.go b/lending/pkg/models/operations/getcommercepayment.go index 0739aae28..4e49caf93 100644 --- a/lending/pkg/models/operations/getcommercepayment.go +++ b/lending/pkg/models/operations/getcommercepayment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcommercepaymentmethod.go b/lending/pkg/models/operations/getcommercepaymentmethod.go index 4dd1d00c8..8283d20be 100644 --- a/lending/pkg/models/operations/getcommercepaymentmethod.go +++ b/lending/pkg/models/operations/getcommercepaymentmethod.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcommerceproduct.go b/lending/pkg/models/operations/getcommerceproduct.go index c4cd870e5..e963494ca 100644 --- a/lending/pkg/models/operations/getcommerceproduct.go +++ b/lending/pkg/models/operations/getcommerceproduct.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcommerceproductcategory.go b/lending/pkg/models/operations/getcommerceproductcategory.go index 28195cedb..e2125274f 100644 --- a/lending/pkg/models/operations/getcommerceproductcategory.go +++ b/lending/pkg/models/operations/getcommerceproductcategory.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcommerceprofile.go b/lending/pkg/models/operations/getcommerceprofile.go index aee9ba353..265702f7c 100644 --- a/lending/pkg/models/operations/getcommerceprofile.go +++ b/lending/pkg/models/operations/getcommerceprofile.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcommercerefundsreport.go b/lending/pkg/models/operations/getcommercerefundsreport.go index 4f5ffca01..496c08f7e 100644 --- a/lending/pkg/models/operations/getcommercerefundsreport.go +++ b/lending/pkg/models/operations/getcommercerefundsreport.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcommercerevenuemetrics.go b/lending/pkg/models/operations/getcommercerevenuemetrics.go index 9456d2a6a..db1e73fc8 100644 --- a/lending/pkg/models/operations/getcommercerevenuemetrics.go +++ b/lending/pkg/models/operations/getcommercerevenuemetrics.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcommercetransaction.go b/lending/pkg/models/operations/getcommercetransaction.go index 02213b4c9..04b04d400 100644 --- a/lending/pkg/models/operations/getcommercetransaction.go +++ b/lending/pkg/models/operations/getcommercetransaction.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcompany.go b/lending/pkg/models/operations/getcompany.go index 5a32672dd..496497bc7 100644 --- a/lending/pkg/models/operations/getcompany.go +++ b/lending/pkg/models/operations/getcompany.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getconnection.go b/lending/pkg/models/operations/getconnection.go index f279a22ef..4c52ed569 100644 --- a/lending/pkg/models/operations/getconnection.go +++ b/lending/pkg/models/operations/getconnection.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcreatebanktransactionsmodel.go b/lending/pkg/models/operations/getcreatebanktransactionsmodel.go index d5ab4e381..caae5e177 100644 --- a/lending/pkg/models/operations/getcreatebanktransactionsmodel.go +++ b/lending/pkg/models/operations/getcreatebanktransactionsmodel.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcreatechartofaccountsmodel.go b/lending/pkg/models/operations/getcreatechartofaccountsmodel.go index 5b8e41334..a0f6e4eb6 100644 --- a/lending/pkg/models/operations/getcreatechartofaccountsmodel.go +++ b/lending/pkg/models/operations/getcreatechartofaccountsmodel.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcreatedirectcostsmodel.go b/lending/pkg/models/operations/getcreatedirectcostsmodel.go index 882c81a18..75e160dcc 100644 --- a/lending/pkg/models/operations/getcreatedirectcostsmodel.go +++ b/lending/pkg/models/operations/getcreatedirectcostsmodel.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcreateoperation.go b/lending/pkg/models/operations/getcreateoperation.go index c987727ec..38fbd019d 100644 --- a/lending/pkg/models/operations/getcreateoperation.go +++ b/lending/pkg/models/operations/getcreateoperation.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcreatepaymentmodel.go b/lending/pkg/models/operations/getcreatepaymentmodel.go index a134ddc4d..be942e6ec 100644 --- a/lending/pkg/models/operations/getcreatepaymentmodel.go +++ b/lending/pkg/models/operations/getcreatepaymentmodel.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcreatetransfersmodel.go b/lending/pkg/models/operations/getcreatetransfersmodel.go index 0e984ff3a..d9cc2f45e 100644 --- a/lending/pkg/models/operations/getcreatetransfersmodel.go +++ b/lending/pkg/models/operations/getcreatetransfersmodel.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcreateupdatebankaccountsmodel.go b/lending/pkg/models/operations/getcreateupdatebankaccountsmodel.go index dd0cf2214..6aabe2947 100644 --- a/lending/pkg/models/operations/getcreateupdatebankaccountsmodel.go +++ b/lending/pkg/models/operations/getcreateupdatebankaccountsmodel.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getcreateupdatesuppliersmodel.go b/lending/pkg/models/operations/getcreateupdatesuppliersmodel.go index 5feede2c0..f5c4529e5 100644 --- a/lending/pkg/models/operations/getcreateupdatesuppliersmodel.go +++ b/lending/pkg/models/operations/getcreateupdatesuppliersmodel.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getdataintegritystatus.go b/lending/pkg/models/operations/getdataintegritystatus.go index edc1600fd..c937066b2 100644 --- a/lending/pkg/models/operations/getdataintegritystatus.go +++ b/lending/pkg/models/operations/getdataintegritystatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getdataintegritysummaries.go b/lending/pkg/models/operations/getdataintegritysummaries.go index bfc4ce903..8ecb5b911 100644 --- a/lending/pkg/models/operations/getdataintegritysummaries.go +++ b/lending/pkg/models/operations/getdataintegritysummaries.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getdatastatus.go b/lending/pkg/models/operations/getdatastatus.go index 307f24d98..35fbf4220 100644 --- a/lending/pkg/models/operations/getdatastatus.go +++ b/lending/pkg/models/operations/getdatastatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations @@ -19,11 +19,402 @@ func (o *GetDataStatusRequest) GetCompanyID() string { return o.CompanyID } +// GetDataStatusDataStatuses - OK +type GetDataStatusDataStatuses struct { + // Describes the state of data in the Codat cache for a company and data type + AccountTransactions *shared.DataStatus `json:"accountTransactions,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + BalanceSheet *shared.DataStatus `json:"balanceSheet,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + BankAccounts *shared.DataStatus `json:"bankAccounts,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + BankTransactions *shared.DataStatus `json:"bankTransactions,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + BankingAccountBalances *shared.DataStatus `json:"banking-accountBalances,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + BankingAccounts *shared.DataStatus `json:"banking-accounts,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + BankingTransactionCategories *shared.DataStatus `json:"banking-transactionCategories,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + BankingTransactions *shared.DataStatus `json:"banking-transactions,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + BillCreditNotes *shared.DataStatus `json:"billCreditNotes,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + BillPayments *shared.DataStatus `json:"billPayments,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + Bills *shared.DataStatus `json:"bills,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + CashFlowStatement *shared.DataStatus `json:"cashFlowStatement,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + ChartOfAccounts *shared.DataStatus `json:"chartOfAccounts,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + CommerceCompanyInfo *shared.DataStatus `json:"commerce-companyInfo,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + CommerceCustomers *shared.DataStatus `json:"commerce-customers,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + CommerceDisputes *shared.DataStatus `json:"commerce-disputes,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + CommerceLocations *shared.DataStatus `json:"commerce-locations,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + CommerceOrders *shared.DataStatus `json:"commerce-orders,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + CommercePaymentMethods *shared.DataStatus `json:"commerce-paymentMethods,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + CommercePayments *shared.DataStatus `json:"commerce-payments,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + CommerceProductCategories *shared.DataStatus `json:"commerce-productCategories,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + CommerceProducts *shared.DataStatus `json:"commerce-products,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + CommerceTaxComponents *shared.DataStatus `json:"commerce-taxComponents,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + CommerceTransactions *shared.DataStatus `json:"commerce-transactions,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + Company *shared.DataStatus `json:"company,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + CreditNotes *shared.DataStatus `json:"creditNotes,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + Customers *shared.DataStatus `json:"customers,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + DirectCosts *shared.DataStatus `json:"directCosts,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + DirectIncomes *shared.DataStatus `json:"directIncomes,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + Invoices *shared.DataStatus `json:"invoices,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + ItemReceipts *shared.DataStatus `json:"itemReceipts,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + Items *shared.DataStatus `json:"items,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + JournalEntries *shared.DataStatus `json:"journalEntries,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + Journals *shared.DataStatus `json:"journals,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + PaymentMethods *shared.DataStatus `json:"paymentMethods,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + Payments *shared.DataStatus `json:"payments,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + ProfitAndLoss *shared.DataStatus `json:"profitAndLoss,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + PurchaseOrders *shared.DataStatus `json:"purchaseOrders,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + SalesOrders *shared.DataStatus `json:"salesOrders,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + Suppliers *shared.DataStatus `json:"suppliers,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + TaxRates *shared.DataStatus `json:"taxRates,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + TrackingCategories *shared.DataStatus `json:"trackingCategories,omitempty"` + // Describes the state of data in the Codat cache for a company and data type + Transfers *shared.DataStatus `json:"transfers,omitempty"` +} + +func (o *GetDataStatusDataStatuses) GetAccountTransactions() *shared.DataStatus { + if o == nil { + return nil + } + return o.AccountTransactions +} + +func (o *GetDataStatusDataStatuses) GetBalanceSheet() *shared.DataStatus { + if o == nil { + return nil + } + return o.BalanceSheet +} + +func (o *GetDataStatusDataStatuses) GetBankAccounts() *shared.DataStatus { + if o == nil { + return nil + } + return o.BankAccounts +} + +func (o *GetDataStatusDataStatuses) GetBankTransactions() *shared.DataStatus { + if o == nil { + return nil + } + return o.BankTransactions +} + +func (o *GetDataStatusDataStatuses) GetBankingAccountBalances() *shared.DataStatus { + if o == nil { + return nil + } + return o.BankingAccountBalances +} + +func (o *GetDataStatusDataStatuses) GetBankingAccounts() *shared.DataStatus { + if o == nil { + return nil + } + return o.BankingAccounts +} + +func (o *GetDataStatusDataStatuses) GetBankingTransactionCategories() *shared.DataStatus { + if o == nil { + return nil + } + return o.BankingTransactionCategories +} + +func (o *GetDataStatusDataStatuses) GetBankingTransactions() *shared.DataStatus { + if o == nil { + return nil + } + return o.BankingTransactions +} + +func (o *GetDataStatusDataStatuses) GetBillCreditNotes() *shared.DataStatus { + if o == nil { + return nil + } + return o.BillCreditNotes +} + +func (o *GetDataStatusDataStatuses) GetBillPayments() *shared.DataStatus { + if o == nil { + return nil + } + return o.BillPayments +} + +func (o *GetDataStatusDataStatuses) GetBills() *shared.DataStatus { + if o == nil { + return nil + } + return o.Bills +} + +func (o *GetDataStatusDataStatuses) GetCashFlowStatement() *shared.DataStatus { + if o == nil { + return nil + } + return o.CashFlowStatement +} + +func (o *GetDataStatusDataStatuses) GetChartOfAccounts() *shared.DataStatus { + if o == nil { + return nil + } + return o.ChartOfAccounts +} + +func (o *GetDataStatusDataStatuses) GetCommerceCompanyInfo() *shared.DataStatus { + if o == nil { + return nil + } + return o.CommerceCompanyInfo +} + +func (o *GetDataStatusDataStatuses) GetCommerceCustomers() *shared.DataStatus { + if o == nil { + return nil + } + return o.CommerceCustomers +} + +func (o *GetDataStatusDataStatuses) GetCommerceDisputes() *shared.DataStatus { + if o == nil { + return nil + } + return o.CommerceDisputes +} + +func (o *GetDataStatusDataStatuses) GetCommerceLocations() *shared.DataStatus { + if o == nil { + return nil + } + return o.CommerceLocations +} + +func (o *GetDataStatusDataStatuses) GetCommerceOrders() *shared.DataStatus { + if o == nil { + return nil + } + return o.CommerceOrders +} + +func (o *GetDataStatusDataStatuses) GetCommercePaymentMethods() *shared.DataStatus { + if o == nil { + return nil + } + return o.CommercePaymentMethods +} + +func (o *GetDataStatusDataStatuses) GetCommercePayments() *shared.DataStatus { + if o == nil { + return nil + } + return o.CommercePayments +} + +func (o *GetDataStatusDataStatuses) GetCommerceProductCategories() *shared.DataStatus { + if o == nil { + return nil + } + return o.CommerceProductCategories +} + +func (o *GetDataStatusDataStatuses) GetCommerceProducts() *shared.DataStatus { + if o == nil { + return nil + } + return o.CommerceProducts +} + +func (o *GetDataStatusDataStatuses) GetCommerceTaxComponents() *shared.DataStatus { + if o == nil { + return nil + } + return o.CommerceTaxComponents +} + +func (o *GetDataStatusDataStatuses) GetCommerceTransactions() *shared.DataStatus { + if o == nil { + return nil + } + return o.CommerceTransactions +} + +func (o *GetDataStatusDataStatuses) GetCompany() *shared.DataStatus { + if o == nil { + return nil + } + return o.Company +} + +func (o *GetDataStatusDataStatuses) GetCreditNotes() *shared.DataStatus { + if o == nil { + return nil + } + return o.CreditNotes +} + +func (o *GetDataStatusDataStatuses) GetCustomers() *shared.DataStatus { + if o == nil { + return nil + } + return o.Customers +} + +func (o *GetDataStatusDataStatuses) GetDirectCosts() *shared.DataStatus { + if o == nil { + return nil + } + return o.DirectCosts +} + +func (o *GetDataStatusDataStatuses) GetDirectIncomes() *shared.DataStatus { + if o == nil { + return nil + } + return o.DirectIncomes +} + +func (o *GetDataStatusDataStatuses) GetInvoices() *shared.DataStatus { + if o == nil { + return nil + } + return o.Invoices +} + +func (o *GetDataStatusDataStatuses) GetItemReceipts() *shared.DataStatus { + if o == nil { + return nil + } + return o.ItemReceipts +} + +func (o *GetDataStatusDataStatuses) GetItems() *shared.DataStatus { + if o == nil { + return nil + } + return o.Items +} + +func (o *GetDataStatusDataStatuses) GetJournalEntries() *shared.DataStatus { + if o == nil { + return nil + } + return o.JournalEntries +} + +func (o *GetDataStatusDataStatuses) GetJournals() *shared.DataStatus { + if o == nil { + return nil + } + return o.Journals +} + +func (o *GetDataStatusDataStatuses) GetPaymentMethods() *shared.DataStatus { + if o == nil { + return nil + } + return o.PaymentMethods +} + +func (o *GetDataStatusDataStatuses) GetPayments() *shared.DataStatus { + if o == nil { + return nil + } + return o.Payments +} + +func (o *GetDataStatusDataStatuses) GetProfitAndLoss() *shared.DataStatus { + if o == nil { + return nil + } + return o.ProfitAndLoss +} + +func (o *GetDataStatusDataStatuses) GetPurchaseOrders() *shared.DataStatus { + if o == nil { + return nil + } + return o.PurchaseOrders +} + +func (o *GetDataStatusDataStatuses) GetSalesOrders() *shared.DataStatus { + if o == nil { + return nil + } + return o.SalesOrders +} + +func (o *GetDataStatusDataStatuses) GetSuppliers() *shared.DataStatus { + if o == nil { + return nil + } + return o.Suppliers +} + +func (o *GetDataStatusDataStatuses) GetTaxRates() *shared.DataStatus { + if o == nil { + return nil + } + return o.TaxRates +} + +func (o *GetDataStatusDataStatuses) GetTrackingCategories() *shared.DataStatus { + if o == nil { + return nil + } + return o.TrackingCategories +} + +func (o *GetDataStatusDataStatuses) GetTransfers() *shared.DataStatus { + if o == nil { + return nil + } + return o.Transfers +} + type GetDataStatusResponse struct { // HTTP response content type for this operation ContentType string // OK - DataStatuses map[string]shared.DataStatus + DataStatuses *GetDataStatusDataStatuses // HTTP response status code for this operation StatusCode int // Raw HTTP response; suitable for custom response parsing @@ -37,7 +428,7 @@ func (o *GetDataStatusResponse) GetContentType() string { return o.ContentType } -func (o *GetDataStatusResponse) GetDataStatuses() map[string]shared.DataStatus { +func (o *GetDataStatusResponse) GetDataStatuses() *GetDataStatusDataStatuses { if o == nil { return nil } diff --git a/lending/pkg/models/operations/getexcelreportgenerationstatus.go b/lending/pkg/models/operations/getexcelreportgenerationstatus.go index 814a84232..8ff1946ed 100644 --- a/lending/pkg/models/operations/getexcelreportgenerationstatus.go +++ b/lending/pkg/models/operations/getexcelreportgenerationstatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/getloansummary.go b/lending/pkg/models/operations/getloansummary.go index 03be3f937..025f19593 100644 --- a/lending/pkg/models/operations/getloansummary.go +++ b/lending/pkg/models/operations/getloansummary.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations @@ -21,7 +21,6 @@ const ( func (e GetLoanSummaryQueryParamSourceType) ToPointer() *GetLoanSummaryQueryParamSourceType { return &e } - func (e *GetLoanSummaryQueryParamSourceType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/operations/getpulloperation.go b/lending/pkg/models/operations/getpulloperation.go index c942fa814..bb85548b5 100644 --- a/lending/pkg/models/operations/getpulloperation.go +++ b/lending/pkg/models/operations/getpulloperation.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/isagedcreditorsreportavailable.go b/lending/pkg/models/operations/isagedcreditorsreportavailable.go index ae5dfc136..d1f6ba535 100644 --- a/lending/pkg/models/operations/isagedcreditorsreportavailable.go +++ b/lending/pkg/models/operations/isagedcreditorsreportavailable.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/isageddebtorsreportavailable.go b/lending/pkg/models/operations/isageddebtorsreportavailable.go index 0e79200cc..6167177cc 100644 --- a/lending/pkg/models/operations/isageddebtorsreportavailable.go +++ b/lending/pkg/models/operations/isageddebtorsreportavailable.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingaccounts.go b/lending/pkg/models/operations/listaccountingaccounts.go index acdbd294c..f1ec4db20 100644 --- a/lending/pkg/models/operations/listaccountingaccounts.go +++ b/lending/pkg/models/operations/listaccountingaccounts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingaccounttransactions.go b/lending/pkg/models/operations/listaccountingaccounttransactions.go index 9c90e13b6..5df267df7 100644 --- a/lending/pkg/models/operations/listaccountingaccounttransactions.go +++ b/lending/pkg/models/operations/listaccountingaccounttransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingbankaccounts.go b/lending/pkg/models/operations/listaccountingbankaccounts.go index b255b81a5..da4afe578 100644 --- a/lending/pkg/models/operations/listaccountingbankaccounts.go +++ b/lending/pkg/models/operations/listaccountingbankaccounts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingbankaccounttransactions.go b/lending/pkg/models/operations/listaccountingbankaccounttransactions.go index 1f1377283..4c5c99dda 100644 --- a/lending/pkg/models/operations/listaccountingbankaccounttransactions.go +++ b/lending/pkg/models/operations/listaccountingbankaccounttransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingbillattachments.go b/lending/pkg/models/operations/listaccountingbillattachments.go index 677a73703..ef3eeaab9 100644 --- a/lending/pkg/models/operations/listaccountingbillattachments.go +++ b/lending/pkg/models/operations/listaccountingbillattachments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingbillcreditnotes.go b/lending/pkg/models/operations/listaccountingbillcreditnotes.go index 3fb13f7f4..f87737129 100644 --- a/lending/pkg/models/operations/listaccountingbillcreditnotes.go +++ b/lending/pkg/models/operations/listaccountingbillcreditnotes.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingbillpayments.go b/lending/pkg/models/operations/listaccountingbillpayments.go index e2d6b481c..999a0e29f 100644 --- a/lending/pkg/models/operations/listaccountingbillpayments.go +++ b/lending/pkg/models/operations/listaccountingbillpayments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingbills.go b/lending/pkg/models/operations/listaccountingbills.go index 319dac226..0571aa703 100644 --- a/lending/pkg/models/operations/listaccountingbills.go +++ b/lending/pkg/models/operations/listaccountingbills.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingcreditnotes.go b/lending/pkg/models/operations/listaccountingcreditnotes.go index fdb35ea99..3b9055b6a 100644 --- a/lending/pkg/models/operations/listaccountingcreditnotes.go +++ b/lending/pkg/models/operations/listaccountingcreditnotes.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingcustomerattachments.go b/lending/pkg/models/operations/listaccountingcustomerattachments.go index 4498e1657..83280757e 100644 --- a/lending/pkg/models/operations/listaccountingcustomerattachments.go +++ b/lending/pkg/models/operations/listaccountingcustomerattachments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingcustomers.go b/lending/pkg/models/operations/listaccountingcustomers.go index c93d4aa32..502992f4e 100644 --- a/lending/pkg/models/operations/listaccountingcustomers.go +++ b/lending/pkg/models/operations/listaccountingcustomers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingdirectcostattachments.go b/lending/pkg/models/operations/listaccountingdirectcostattachments.go index ad3ca5617..f27dd310c 100644 --- a/lending/pkg/models/operations/listaccountingdirectcostattachments.go +++ b/lending/pkg/models/operations/listaccountingdirectcostattachments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingdirectcosts.go b/lending/pkg/models/operations/listaccountingdirectcosts.go index 59b7e3322..704d03e4b 100644 --- a/lending/pkg/models/operations/listaccountingdirectcosts.go +++ b/lending/pkg/models/operations/listaccountingdirectcosts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingdirectincomeattachments.go b/lending/pkg/models/operations/listaccountingdirectincomeattachments.go index 16d79db1e..39510f05c 100644 --- a/lending/pkg/models/operations/listaccountingdirectincomeattachments.go +++ b/lending/pkg/models/operations/listaccountingdirectincomeattachments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingdirectincomes.go b/lending/pkg/models/operations/listaccountingdirectincomes.go index 66bffffe6..d551bafbe 100644 --- a/lending/pkg/models/operations/listaccountingdirectincomes.go +++ b/lending/pkg/models/operations/listaccountingdirectincomes.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountinginvoiceattachments.go b/lending/pkg/models/operations/listaccountinginvoiceattachments.go index c90ca8806..7d64df415 100644 --- a/lending/pkg/models/operations/listaccountinginvoiceattachments.go +++ b/lending/pkg/models/operations/listaccountinginvoiceattachments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountinginvoices.go b/lending/pkg/models/operations/listaccountinginvoices.go index bb2849662..b86d072fc 100644 --- a/lending/pkg/models/operations/listaccountinginvoices.go +++ b/lending/pkg/models/operations/listaccountinginvoices.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingjournalentries.go b/lending/pkg/models/operations/listaccountingjournalentries.go index 562b78d60..1b906f0b9 100644 --- a/lending/pkg/models/operations/listaccountingjournalentries.go +++ b/lending/pkg/models/operations/listaccountingjournalentries.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingjournals.go b/lending/pkg/models/operations/listaccountingjournals.go index ef3131f68..156a09720 100644 --- a/lending/pkg/models/operations/listaccountingjournals.go +++ b/lending/pkg/models/operations/listaccountingjournals.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingpayments.go b/lending/pkg/models/operations/listaccountingpayments.go index 8e922f4d9..d33ce944a 100644 --- a/lending/pkg/models/operations/listaccountingpayments.go +++ b/lending/pkg/models/operations/listaccountingpayments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingsupplierattachments.go b/lending/pkg/models/operations/listaccountingsupplierattachments.go index 884ec4772..ddfb1550a 100644 --- a/lending/pkg/models/operations/listaccountingsupplierattachments.go +++ b/lending/pkg/models/operations/listaccountingsupplierattachments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingsuppliers.go b/lending/pkg/models/operations/listaccountingsuppliers.go index fa878f386..bdf108a84 100644 --- a/lending/pkg/models/operations/listaccountingsuppliers.go +++ b/lending/pkg/models/operations/listaccountingsuppliers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listaccountingtransfers.go b/lending/pkg/models/operations/listaccountingtransfers.go index 4ca570231..92d2e4836 100644 --- a/lending/pkg/models/operations/listaccountingtransfers.go +++ b/lending/pkg/models/operations/listaccountingtransfers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listbankingaccountbalances.go b/lending/pkg/models/operations/listbankingaccountbalances.go index 0d0bee3f1..4e049d591 100644 --- a/lending/pkg/models/operations/listbankingaccountbalances.go +++ b/lending/pkg/models/operations/listbankingaccountbalances.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listbankingaccounts.go b/lending/pkg/models/operations/listbankingaccounts.go index 61a28bc86..89f377e82 100644 --- a/lending/pkg/models/operations/listbankingaccounts.go +++ b/lending/pkg/models/operations/listbankingaccounts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listbankingtransactioncategories.go b/lending/pkg/models/operations/listbankingtransactioncategories.go index c3e62cba0..8e1855d0b 100644 --- a/lending/pkg/models/operations/listbankingtransactioncategories.go +++ b/lending/pkg/models/operations/listbankingtransactioncategories.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listbankingtransactions.go b/lending/pkg/models/operations/listbankingtransactions.go index 42d97ca57..d73cafa46 100644 --- a/lending/pkg/models/operations/listbankingtransactions.go +++ b/lending/pkg/models/operations/listbankingtransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listcommercecustomers.go b/lending/pkg/models/operations/listcommercecustomers.go index 6e7b655a0..74d3f7cdc 100644 --- a/lending/pkg/models/operations/listcommercecustomers.go +++ b/lending/pkg/models/operations/listcommercecustomers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listcommercedisputes.go b/lending/pkg/models/operations/listcommercedisputes.go index d966b6fd1..b3df82e0d 100644 --- a/lending/pkg/models/operations/listcommercedisputes.go +++ b/lending/pkg/models/operations/listcommercedisputes.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listcommercelocations.go b/lending/pkg/models/operations/listcommercelocations.go index dfcc17e08..d60c70846 100644 --- a/lending/pkg/models/operations/listcommercelocations.go +++ b/lending/pkg/models/operations/listcommercelocations.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listcommerceorders.go b/lending/pkg/models/operations/listcommerceorders.go index 9143786b4..bc4b1cb17 100644 --- a/lending/pkg/models/operations/listcommerceorders.go +++ b/lending/pkg/models/operations/listcommerceorders.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listcommercepaymentmethods.go b/lending/pkg/models/operations/listcommercepaymentmethods.go index 32bd075fc..6cdfc7ff1 100644 --- a/lending/pkg/models/operations/listcommercepaymentmethods.go +++ b/lending/pkg/models/operations/listcommercepaymentmethods.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listcommercepayments.go b/lending/pkg/models/operations/listcommercepayments.go index 194134dff..95f7b4834 100644 --- a/lending/pkg/models/operations/listcommercepayments.go +++ b/lending/pkg/models/operations/listcommercepayments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listcommerceproductcategories.go b/lending/pkg/models/operations/listcommerceproductcategories.go index 6db3a2e81..710794bcc 100644 --- a/lending/pkg/models/operations/listcommerceproductcategories.go +++ b/lending/pkg/models/operations/listcommerceproductcategories.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listcommerceproducts.go b/lending/pkg/models/operations/listcommerceproducts.go index 2fc1edbac..287a1a450 100644 --- a/lending/pkg/models/operations/listcommerceproducts.go +++ b/lending/pkg/models/operations/listcommerceproducts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listcommercetransactions.go b/lending/pkg/models/operations/listcommercetransactions.go index 2f06fa7ce..313446823 100644 --- a/lending/pkg/models/operations/listcommercetransactions.go +++ b/lending/pkg/models/operations/listcommercetransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listcompanies.go b/lending/pkg/models/operations/listcompanies.go index 906a53f98..b9ad5505c 100644 --- a/lending/pkg/models/operations/listcompanies.go +++ b/lending/pkg/models/operations/listcompanies.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listconnections.go b/lending/pkg/models/operations/listconnections.go index 0127d8a0f..5f861fbd0 100644 --- a/lending/pkg/models/operations/listconnections.go +++ b/lending/pkg/models/operations/listconnections.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listcreateoperations.go b/lending/pkg/models/operations/listcreateoperations.go index 6767e6f34..2ce41b9fc 100644 --- a/lending/pkg/models/operations/listcreateoperations.go +++ b/lending/pkg/models/operations/listcreateoperations.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listdataintegritydetails.go b/lending/pkg/models/operations/listdataintegritydetails.go index 431c90ffb..df8a66c50 100644 --- a/lending/pkg/models/operations/listdataintegritydetails.go +++ b/lending/pkg/models/operations/listdataintegritydetails.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listfiles.go b/lending/pkg/models/operations/listfiles.go index a371b5832..c46463048 100644 --- a/lending/pkg/models/operations/listfiles.go +++ b/lending/pkg/models/operations/listfiles.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listloantransactions.go b/lending/pkg/models/operations/listloantransactions.go index bedbd36fc..395b2f700 100644 --- a/lending/pkg/models/operations/listloantransactions.go +++ b/lending/pkg/models/operations/listloantransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations @@ -21,7 +21,6 @@ const ( func (e ListLoanTransactionsQueryParamSourceType) ToPointer() *ListLoanTransactionsQueryParamSourceType { return &e } - func (e *ListLoanTransactionsQueryParamSourceType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/operations/listpulloperations.go b/lending/pkg/models/operations/listpulloperations.go index 484502cc1..49db9e47b 100644 --- a/lending/pkg/models/operations/listpulloperations.go +++ b/lending/pkg/models/operations/listpulloperations.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/listreconciledinvoices.go b/lending/pkg/models/operations/listreconciledinvoices.go index 9b7697b34..bd3605089 100644 --- a/lending/pkg/models/operations/listreconciledinvoices.go +++ b/lending/pkg/models/operations/listreconciledinvoices.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/options.go b/lending/pkg/models/operations/options.go index 86819818b..a4e000dc1 100644 --- a/lending/pkg/models/operations/options.go +++ b/lending/pkg/models/operations/options.go @@ -1,10 +1,12 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations import ( "errors" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" + "time" ) var ErrUnsupportedOption = errors.New("unsupported option") @@ -12,7 +14,9 @@ var ErrUnsupportedOption = errors.New("unsupported option") const ( SupportedOptionServerURL = "serverURL" SupportedOptionRetries = "retries" + SupportedOptionTimeout = "timeout" SupportedOptionAcceptHeaderOverride = "acceptHeaderOverride" + SupportedOptionURLOverride = "urlOverride" ) type AcceptHeaderEnum string @@ -29,8 +33,10 @@ func (e AcceptHeaderEnum) ToPointer() *AcceptHeaderEnum { type Options struct { ServerURL *string - Retries *utils.RetryConfig + Retries *retry.Config + Timeout *time.Duration AcceptHeaderOverride *AcceptHeaderEnum + URLOverride *string } type Option func(*Options, ...string) error @@ -64,7 +70,7 @@ func WithTemplatedServerURL(serverURL string, params map[string]string) Option { } // WithRetries allows customizing the default retry configuration. -func WithRetries(config utils.RetryConfig) Option { +func WithRetries(config retry.Config) Option { return func(opts *Options, supportedOptions ...string) error { if !utils.Contains(supportedOptions, SupportedOptionRetries) { return ErrUnsupportedOption @@ -75,6 +81,18 @@ func WithRetries(config utils.RetryConfig) Option { } } +// WithOperationTimeout allows setting the request timeout applied for an operation. +func WithOperationTimeout(timeout time.Duration) Option { + return func(opts *Options, supportedOptions ...string) error { + if !utils.Contains(supportedOptions, SupportedOptionRetries) { + return ErrUnsupportedOption + } + + opts.Timeout = &timeout + return nil + } +} + func WithAcceptHeaderOverride(acceptHeaderOverride AcceptHeaderEnum) Option { return func(opts *Options, supportedOptions ...string) error { if !utils.Contains(supportedOptions, SupportedOptionAcceptHeaderOverride) { @@ -85,3 +103,15 @@ func WithAcceptHeaderOverride(acceptHeaderOverride AcceptHeaderEnum) Option { return nil } } + +// WithURLOverride allows overriding the URL. +func WithURLOverride(urlOverride string) Option { + return func(opts *Options, supportedOptions ...string) error { + if !utils.Contains(supportedOptions, SupportedOptionURLOverride) { + return ErrUnsupportedOption + } + + opts.URLOverride = &urlOverride + return nil + } +} diff --git a/lending/pkg/models/operations/refreshalldatatypes.go b/lending/pkg/models/operations/refreshalldatatypes.go index e63b26c41..187709751 100644 --- a/lending/pkg/models/operations/refreshalldatatypes.go +++ b/lending/pkg/models/operations/refreshalldatatypes.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/refreshdatatype.go b/lending/pkg/models/operations/refreshdatatype.go index ba4930b0b..2f39f603e 100644 --- a/lending/pkg/models/operations/refreshdatatype.go +++ b/lending/pkg/models/operations/refreshdatatype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations @@ -12,7 +12,7 @@ type RefreshDataTypeRequest struct { CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` // Optionally, provide a data connection id to only queue pull operations on that connection. ConnectionID *string `queryParam:"style=form,explode=true,name=connectionId"` - // The key of a Codat data type + // A key for a Codat data type. DataType shared.SchemaDataType `pathParam:"style=simple,explode=false,name=dataType"` } diff --git a/lending/pkg/models/operations/setbankstatementuploadconfiguration.go b/lending/pkg/models/operations/setbankstatementuploadconfiguration.go new file mode 100644 index 000000000..a18a5de26 --- /dev/null +++ b/lending/pkg/models/operations/setbankstatementuploadconfiguration.go @@ -0,0 +1,76 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "net/http" +) + +type SetBankStatementUploadConfigurationRequest struct { + BankStatementUploadConfiguration *shared.BankStatementUploadConfiguration `request:"mediaType=application/json"` + // Unique identifier for a company. + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + // Unique identifier for a connection. + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` +} + +func (o *SetBankStatementUploadConfigurationRequest) GetBankStatementUploadConfiguration() *shared.BankStatementUploadConfiguration { + if o == nil { + return nil + } + return o.BankStatementUploadConfiguration +} + +func (o *SetBankStatementUploadConfigurationRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *SetBankStatementUploadConfigurationRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +type SetBankStatementUploadConfigurationResponse struct { + // Success + BankStatementUploadConfiguration *shared.BankStatementUploadConfiguration + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *SetBankStatementUploadConfigurationResponse) GetBankStatementUploadConfiguration() *shared.BankStatementUploadConfiguration { + if o == nil { + return nil + } + return o.BankStatementUploadConfiguration +} + +func (o *SetBankStatementUploadConfigurationResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *SetBankStatementUploadConfigurationResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *SetBankStatementUploadConfigurationResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/startbankstatementuploadsession.go b/lending/pkg/models/operations/startbankstatementuploadsession.go new file mode 100644 index 000000000..faeea681e --- /dev/null +++ b/lending/pkg/models/operations/startbankstatementuploadsession.go @@ -0,0 +1,76 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "net/http" +) + +type StartBankStatementUploadSessionRequest struct { + StartUploadSessionRequest *shared.StartUploadSessionRequest `request:"mediaType=application/json"` + // Unique identifier for a company. + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + // Unique identifier for a connection. + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` +} + +func (o *StartBankStatementUploadSessionRequest) GetStartUploadSessionRequest() *shared.StartUploadSessionRequest { + if o == nil { + return nil + } + return o.StartUploadSessionRequest +} + +func (o *StartBankStatementUploadSessionRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *StartBankStatementUploadSessionRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +type StartBankStatementUploadSessionResponse struct { + // HTTP response content type for this operation + ContentType string + // Success + PullOperation *shared.PullOperation + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *StartBankStatementUploadSessionResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *StartBankStatementUploadSessionResponse) GetPullOperation() *shared.PullOperation { + if o == nil { + return nil + } + return o.PullOperation +} + +func (o *StartBankStatementUploadSessionResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *StartBankStatementUploadSessionResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/unlinkconnection.go b/lending/pkg/models/operations/unlinkconnection.go index be5d1fa84..9e7c0ea77 100644 --- a/lending/pkg/models/operations/unlinkconnection.go +++ b/lending/pkg/models/operations/unlinkconnection.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/updatecompany.go b/lending/pkg/models/operations/updatecompany.go index 07814bc9e..3779f0c32 100644 --- a/lending/pkg/models/operations/updatecompany.go +++ b/lending/pkg/models/operations/updatecompany.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/operations/uploadbankstatementdata.go b/lending/pkg/models/operations/uploadbankstatementdata.go new file mode 100644 index 000000000..43d06a494 --- /dev/null +++ b/lending/pkg/models/operations/uploadbankstatementdata.go @@ -0,0 +1,173 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "errors" + "fmt" + "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" + "net/http" +) + +type UploadBankStatementDataRequestBodyType string + +const ( + UploadBankStatementDataRequestBodyTypeBankingAccount UploadBankStatementDataRequestBodyType = "BankingAccount" + UploadBankStatementDataRequestBodyTypeBankingTransactions UploadBankStatementDataRequestBodyType = "BankingTransactions" + UploadBankStatementDataRequestBodyTypeAny UploadBankStatementDataRequestBodyType = "any" +) + +type UploadBankStatementDataRequestBody struct { + BankingAccount *shared.BankingAccount + BankingTransactions *shared.BankingTransactions + Any any + + Type UploadBankStatementDataRequestBodyType +} + +func CreateUploadBankStatementDataRequestBodyBankingAccount(bankingAccount shared.BankingAccount) UploadBankStatementDataRequestBody { + typ := UploadBankStatementDataRequestBodyTypeBankingAccount + + return UploadBankStatementDataRequestBody{ + BankingAccount: &bankingAccount, + Type: typ, + } +} + +func CreateUploadBankStatementDataRequestBodyBankingTransactions(bankingTransactions shared.BankingTransactions) UploadBankStatementDataRequestBody { + typ := UploadBankStatementDataRequestBodyTypeBankingTransactions + + return UploadBankStatementDataRequestBody{ + BankingTransactions: &bankingTransactions, + Type: typ, + } +} + +func CreateUploadBankStatementDataRequestBodyAny(any any) UploadBankStatementDataRequestBody { + typ := UploadBankStatementDataRequestBodyTypeAny + + return UploadBankStatementDataRequestBody{ + Any: any, + Type: typ, + } +} + +func (u *UploadBankStatementDataRequestBody) UnmarshalJSON(data []byte) error { + + var bankingTransactions shared.BankingTransactions = shared.BankingTransactions{} + if err := utils.UnmarshalJSON(data, &bankingTransactions, "", true, true); err == nil { + u.BankingTransactions = &bankingTransactions + u.Type = UploadBankStatementDataRequestBodyTypeBankingTransactions + return nil + } + + var bankingAccount shared.BankingAccount = shared.BankingAccount{} + if err := utils.UnmarshalJSON(data, &bankingAccount, "", true, true); err == nil { + u.BankingAccount = &bankingAccount + u.Type = UploadBankStatementDataRequestBodyTypeBankingAccount + return nil + } + + var any any = nil + if err := utils.UnmarshalJSON(data, &any, "", true, true); err == nil { + u.Any = any + u.Type = UploadBankStatementDataRequestBodyTypeAny + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for UploadBankStatementDataRequestBody", string(data)) +} + +func (u UploadBankStatementDataRequestBody) MarshalJSON() ([]byte, error) { + if u.BankingAccount != nil { + return utils.MarshalJSON(u.BankingAccount, "", true) + } + + if u.BankingTransactions != nil { + return utils.MarshalJSON(u.BankingTransactions, "", true) + } + + if u.Any != nil { + return utils.MarshalJSON(u.Any, "", true) + } + + return nil, errors.New("could not marshal union type UploadBankStatementDataRequestBody: all fields are null") +} + +type UploadBankStatementDataRequest struct { + RequestBody UploadBankStatementDataRequestBody `request:"mediaType=application/json"` + // Unique identifier for a company. + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + // Unique identifier for a connection. + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` + // Unique identifier for the dataset that completed its sync. + DatasetID string `pathParam:"style=simple,explode=false,name=datasetId"` + // The endpoint path of the third-party banking service that the request body originates from. Only required if the source is not `codat`. + Path *shared.Path `queryParam:"style=form,explode=true,name=path"` +} + +func (o *UploadBankStatementDataRequest) GetRequestBody() UploadBankStatementDataRequestBody { + if o == nil { + return UploadBankStatementDataRequestBody{} + } + return o.RequestBody +} + +func (o *UploadBankStatementDataRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *UploadBankStatementDataRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +func (o *UploadBankStatementDataRequest) GetDatasetID() string { + if o == nil { + return "" + } + return o.DatasetID +} + +func (o *UploadBankStatementDataRequest) GetPath() *shared.Path { + if o == nil { + return nil + } + return o.Path +} + +type UploadBankStatementDataResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *UploadBankStatementDataResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *UploadBankStatementDataResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *UploadBankStatementDataResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/uploadfiles.go b/lending/pkg/models/operations/uploadfiles.go index 3974410b3..73986dd1d 100644 --- a/lending/pkg/models/operations/uploadfiles.go +++ b/lending/pkg/models/operations/uploadfiles.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations diff --git a/lending/pkg/models/sdkerrors/errormessage.go b/lending/pkg/models/sdkerrors/errormessage.go index be8f0ff0a..8eea0f394 100644 --- a/lending/pkg/models/sdkerrors/errormessage.go +++ b/lending/pkg/models/sdkerrors/errormessage.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package sdkerrors diff --git a/lending/pkg/models/sdkerrors/sdkerror.go b/lending/pkg/models/sdkerrors/sdkerror.go index 5c1affd31..7d63b9813 100644 --- a/lending/pkg/models/sdkerrors/sdkerror.go +++ b/lending/pkg/models/sdkerrors/sdkerror.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package sdkerrors diff --git a/lending/pkg/models/shared/accountbalance.go b/lending/pkg/models/shared/accountbalance.go index a655f1ad6..951628219 100644 --- a/lending/pkg/models/shared/accountbalance.go +++ b/lending/pkg/models/shared/accountbalance.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -15,7 +15,7 @@ type AccountBalance struct { // Funds that are not yet available in the balance Pending *decimal.Big `decimal:"number" json:"pending,omitempty"` // Funds reserved as holdings - Reserved interface{} `json:"reserved,omitempty"` + Reserved any `json:"reserved,omitempty"` } func (a AccountBalance) MarshalJSON() ([]byte, error) { @@ -50,7 +50,7 @@ func (o *AccountBalance) GetPending() *decimal.Big { return o.Pending } -func (o *AccountBalance) GetReserved() interface{} { +func (o *AccountBalance) GetReserved() any { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accountbalanceamounts.go b/lending/pkg/models/shared/accountbalanceamounts.go index 1d9109920..983eca5bc 100644 --- a/lending/pkg/models/shared/accountbalanceamounts.go +++ b/lending/pkg/models/shared/accountbalanceamounts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountcategoriesupdatedwebhook.go b/lending/pkg/models/shared/accountcategoriesupdatedwebhook.go index da3c71bac..ee4171112 100644 --- a/lending/pkg/models/shared/accountcategoriesupdatedwebhook.go +++ b/lending/pkg/models/shared/accountcategoriesupdatedwebhook.go @@ -1,8 +1,8 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared -// AccountCategoriesUpdatedWebhook - Webhook request body for account categories updated. +// AccountCategoriesUpdatedWebhook - Webhook request body for the "Account categories updated" event. type AccountCategoriesUpdatedWebhook struct { // Unique identifier of the webhook event. AlertID *string `json:"AlertId,omitempty"` @@ -15,9 +15,11 @@ type AccountCategoriesUpdatedWebhook struct { Data *AccountCategoriesUpdatedWebhookData `json:"Data,omitempty"` // Unique identifier for a company's data connection. DataConnectionID *string `json:"DataConnectionId,omitempty"` - // A human readable message about the webhook. + // A human-readable message about the webhook. Message *string `json:"Message,omitempty"` // Unique identifier for the rule. + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. RuleID *string `json:"RuleId,omitempty"` // The type of rule. RuleType *string `json:"RuleType,omitempty"` diff --git a/lending/pkg/models/shared/accountcategoriesupdatedwebhookdata.go b/lending/pkg/models/shared/accountcategoriesupdatedwebhookdata.go index 17412e05f..d4ed5ed2a 100644 --- a/lending/pkg/models/shared/accountcategoriesupdatedwebhookdata.go +++ b/lending/pkg/models/shared/accountcategoriesupdatedwebhookdata.go @@ -1,9 +1,9 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared type AccountCategoriesUpdatedWebhookData struct { - // The date on which this account categories were last modified in Codat. + // The date on which the company's account categories were last modified in Codat. ModifiedDate *string `json:"modifiedDate,omitempty"` } diff --git a/lending/pkg/models/shared/accountcategorylevel.go b/lending/pkg/models/shared/accountcategorylevel.go index 6445487ac..fdc467e29 100644 --- a/lending/pkg/models/shared/accountcategorylevel.go +++ b/lending/pkg/models/shared/accountcategorylevel.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountidentifiers.go b/lending/pkg/models/shared/accountidentifiers.go index ddee65f25..190a30e49 100644 --- a/lending/pkg/models/shared/accountidentifiers.go +++ b/lending/pkg/models/shared/accountidentifiers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountidentifiertype.go b/lending/pkg/models/shared/accountidentifiertype.go index 625c4201b..6d65ef0a1 100644 --- a/lending/pkg/models/shared/accountidentifiertype.go +++ b/lending/pkg/models/shared/accountidentifiertype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -23,7 +23,6 @@ const ( func (e AccountIdentifierType) ToPointer() *AccountIdentifierType { return &e } - func (e *AccountIdentifierType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/accountingaccount.go b/lending/pkg/models/shared/accountingaccount.go index 7173982be..0ec9e1348 100644 --- a/lending/pkg/models/shared/accountingaccount.go +++ b/lending/pkg/models/shared/accountingaccount.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -133,7 +133,7 @@ type AccountingAccount struct { Status *AccountStatus `json:"status,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Type of account Type *AccountType `json:"type,omitempty"` diff --git a/lending/pkg/models/shared/accountingaccounts.go b/lending/pkg/models/shared/accountingaccounts.go index 4228fd0da..065f82b9f 100644 --- a/lending/pkg/models/shared/accountingaccounts.go +++ b/lending/pkg/models/shared/accountingaccounts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingaccounttransaction.go b/lending/pkg/models/shared/accountingaccounttransaction.go index 8381bbd97..bdab0b55f 100644 --- a/lending/pkg/models/shared/accountingaccounttransaction.go +++ b/lending/pkg/models/shared/accountingaccounttransaction.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -9,21 +9,20 @@ import ( "github.com/ericlagergren/decimal" ) -// Status - The status of the account transaction. -type Status string +// AccountingAccountTransactionStatus - The status of the account transaction. +type AccountingAccountTransactionStatus string const ( - StatusUnknown Status = "Unknown" - StatusUnreconciled Status = "Unreconciled" - StatusReconciled Status = "Reconciled" - StatusVoid Status = "Void" + AccountingAccountTransactionStatusUnknown AccountingAccountTransactionStatus = "Unknown" + AccountingAccountTransactionStatusUnreconciled AccountingAccountTransactionStatus = "Unreconciled" + AccountingAccountTransactionStatusReconciled AccountingAccountTransactionStatus = "Reconciled" + AccountingAccountTransactionStatusVoid AccountingAccountTransactionStatus = "Void" ) -func (e Status) ToPointer() *Status { +func (e AccountingAccountTransactionStatus) ToPointer() *AccountingAccountTransactionStatus { return &e } - -func (e *Status) UnmarshalJSON(data []byte) error { +func (e *AccountingAccountTransactionStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err @@ -36,20 +35,20 @@ func (e *Status) UnmarshalJSON(data []byte) error { case "Reconciled": fallthrough case "Void": - *e = Status(v) + *e = AccountingAccountTransactionStatus(v) return nil default: - return fmt.Errorf("invalid value for Status: %v", v) + return fmt.Errorf("invalid value for AccountingAccountTransactionStatus: %v", v) } } -// AccountingAccountTransaction - > **Language tip:** In Codat, account transactions represent all transactions posted to a bank account within an accounting platform. For bank transactions posted within a banking platform, refer to [Banking transactions](https://docs.codat.io/lending-api#/operations/list-all-banking-transactions). +// AccountingAccountTransaction - > **Language tip:** In Codat, account transactions represent all transactions posted to a bank account within an accounting software. For bank transactions posted within a banking platform, refer to [Banking transactions](https://docs.codat.io/lending-api#/operations/list-all-banking-transactions). // // > View the coverage for account transactions in the Data coverage explorer. // // ## Overview // -// In Codat’s data model, account transactions represent bank activity within an accounting platform. All transactions that go through a bank account are recorded as account transactions. +// In Codat’s data model, account transactions represent bank activity within an accounting software. All transactions that go through a bank account are recorded as account transactions. // // Account transactions are created as a result of different business activities, for example: // @@ -77,9 +76,9 @@ type AccountingAccountTransaction struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -102,7 +101,7 @@ type AccountingAccountTransaction struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // @@ -134,7 +133,7 @@ type AccountingAccountTransaction struct { Note *string `json:"note,omitempty"` SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` // The status of the account transaction. - Status *Status `json:"status,omitempty"` + Status *AccountingAccountTransactionStatus `json:"status,omitempty"` // Total amount of the account transactions, inclusive of tax. TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` // Identifier of the transaction (unique to the company). @@ -222,7 +221,7 @@ func (o *AccountingAccountTransaction) GetSourceModifiedDate() *string { return o.SourceModifiedDate } -func (o *AccountingAccountTransaction) GetStatus() *Status { +func (o *AccountingAccountTransaction) GetStatus() *AccountingAccountTransactionStatus { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accountingaccounttransactions.go b/lending/pkg/models/shared/accountingaccounttransactions.go index 09ae02983..7850c9cc2 100644 --- a/lending/pkg/models/shared/accountingaccounttransactions.go +++ b/lending/pkg/models/shared/accountingaccounttransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingaddress.go b/lending/pkg/models/shared/accountingaddress.go index 9e218cbd1..b9c0d27c2 100644 --- a/lending/pkg/models/shared/accountingaddress.go +++ b/lending/pkg/models/shared/accountingaddress.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingaddresstype.go b/lending/pkg/models/shared/accountingaddresstype.go index c98699efe..a0c620b32 100644 --- a/lending/pkg/models/shared/accountingaddresstype.go +++ b/lending/pkg/models/shared/accountingaddresstype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e AccountingAddressType) ToPointer() *AccountingAddressType { return &e } - func (e *AccountingAddressType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/accountingagedcreditorreport.go b/lending/pkg/models/shared/accountingagedcreditorreport.go index b9e9ac7d6..768421326 100644 --- a/lending/pkg/models/shared/accountingagedcreditorreport.go +++ b/lending/pkg/models/shared/accountingagedcreditorreport.go @@ -1,10 +1,10 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared // AccountingAgedCreditorReport - The Aged Creditors report shows the total balance owed by a business to its suppliers over time. // -// You can generate it for a company based on recently synced data from your customers' accounting platforms. The report is available in the **Reports** tab in the Codat portal. +// You can generate it for a company based on recently synced data from your customers' accounting software. The report is available in the **Reports** tab in the Codat portal. // // Total assets or liabilities are grouped into 30-day periods for each supplier, up to the current date. You can adjust the report date, period length, and number of periods to show on each report. The data can be grouped by customer or currency. // diff --git a/lending/pkg/models/shared/accountingageddebtorreport.go b/lending/pkg/models/shared/accountingageddebtorreport.go index 32dc2f9b1..35cbe01ec 100644 --- a/lending/pkg/models/shared/accountingageddebtorreport.go +++ b/lending/pkg/models/shared/accountingageddebtorreport.go @@ -1,10 +1,10 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared // AccountingAgedDebtorReport - The Aged Debtors report shows the total outstanding balance due from customers to the business over time. // -// You can generate it for a company based on recently synced data from your customers' accounting platforms. The report is available in the **Reports** tab in the Codat portal. +// You can generate it for a company based on recently synced data from your customers' accounting software. The report is available in the **Reports** tab in the Codat portal. // // Total assets or liabilities are grouped into 30-day periods for each customer, up to the current date. You can adjust the report date, period length, and number of periods to show on each report. The data can be grouped by customer or currency. // diff --git a/lending/pkg/models/shared/accountingattachment.go b/lending/pkg/models/shared/accountingattachment.go index 094b4717e..48bf38be8 100644 --- a/lending/pkg/models/shared/accountingattachment.go +++ b/lending/pkg/models/shared/accountingattachment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -47,9 +47,9 @@ type AccountingAttachment struct { DateCreated *string `json:"dateCreated,omitempty"` // File size in bytes. For example, if this reads **46153**, then the file size is 46kb. FileSize *int `json:"fileSize,omitempty"` - // Identifier for the attachment, unique for the company in the accounting platform. + // Identifier for the attachment, unique for the company in the accounting software. ID *string `json:"id,omitempty"` - // 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. + // If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. IncludeWhenSent *bool `json:"includeWhenSent,omitempty"` ModifiedDate *string `json:"modifiedDate,omitempty"` // Name of the attachment file. diff --git a/lending/pkg/models/shared/accountingbalancesheet.go b/lending/pkg/models/shared/accountingbalancesheet.go index f167f43e7..2370e6ac1 100644 --- a/lending/pkg/models/shared/accountingbalancesheet.go +++ b/lending/pkg/models/shared/accountingbalancesheet.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -13,13 +13,13 @@ package shared // > A profit and loss report summarises the total revenue, expenses, and profit or loss during a specified time period. A balance sheet report shows the financial position of a company at a specific moment in time. // // **Structure of this report** -// This report will reflect the structure and line descriptions that the business has set in their own accounting platform. +// This report will reflect the structure and line descriptions that the business has set in their own accounting software. // // **History** // By default, Codat pulls (up to) 24 months of balance sheets for a company. You can adjust this to fetch more history, where available, by updating the `monthsToSync` value for `balanceSheet` on the [data type settings endpoint](https://docs.codat.io/lending-api#/operations/update-sync-settings). // // **Want to pull this in a standardised structure?** -// Our [Enhanced Financials](https://docs.codat.io/assess/enhanced-financials/overview) endpoints provide the same report under standardized headings, allowing you to pull it in the same format for all of your business customers. +// Our [Enhanced Financials](https://docs.codat.io/lending/features/financial-statements-overview) endpoints provide the same report under standardized headings, allowing you to pull it in the same format for all of your business customers. type AccountingBalanceSheet struct { // The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. // diff --git a/lending/pkg/models/shared/accountingbankaccount.go b/lending/pkg/models/shared/accountingbankaccount.go index baf4ddf0f..21b31b060 100644 --- a/lending/pkg/models/shared/accountingbankaccount.go +++ b/lending/pkg/models/shared/accountingbankaccount.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -20,11 +20,11 @@ import ( // A list of bank accounts associated with a company and a specific data connection. // // Bank accounts data includes: -// * The name and ID of the account in the accounting platform. +// * The name and ID of the account in the accounting software. // * The currency and balance of the account. // * The sort code and account number. type AccountingBankAccount struct { - // Name of the bank account in the accounting platform. + // Name of the bank account in the accounting software. AccountName *string `json:"accountName,omitempty"` // Account number for the bank account. // @@ -52,7 +52,7 @@ type AccountingBankAccount struct { Currency *string `json:"currency,omitempty"` // International bank account number of the account. Often used when making or receiving international payments. IBan *string `json:"iBan,omitempty"` - // Identifier for the account, unique for the company in the accounting platform. + // Identifier for the account, unique for the company in the accounting software. ID *string `json:"id,omitempty"` // The institution of the bank account. Institution *string `json:"institution,omitempty"` @@ -70,9 +70,11 @@ type AccountingBankAccount struct { // The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. SortCode *string `json:"sortCode,omitempty"` SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` + // Status of the bank account. + Status *BankAccountStatus `json:"status,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` } @@ -192,6 +194,13 @@ func (o *AccountingBankAccount) GetSourceModifiedDate() *string { return o.SourceModifiedDate } +func (o *AccountingBankAccount) GetStatus() *BankAccountStatus { + if o == nil { + return nil + } + return o.Status +} + func (o *AccountingBankAccount) GetSupplementalData() *SupplementalData { if o == nil { return nil diff --git a/lending/pkg/models/shared/accountingbankaccounts.go b/lending/pkg/models/shared/accountingbankaccounts.go index 242c643d3..335aaee95 100644 --- a/lending/pkg/models/shared/accountingbankaccounts.go +++ b/lending/pkg/models/shared/accountingbankaccounts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingbankaccounttype.go b/lending/pkg/models/shared/accountingbankaccounttype.go index 65a47c0d9..0c724e539 100644 --- a/lending/pkg/models/shared/accountingbankaccounttype.go +++ b/lending/pkg/models/shared/accountingbankaccounttype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -21,7 +21,6 @@ const ( func (e AccountingBankAccountType) ToPointer() *AccountingBankAccountType { return &e } - func (e *AccountingBankAccountType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/accountingbanktransaction.go b/lending/pkg/models/shared/accountingbanktransaction.go index 83d973c2b..2d2274263 100644 --- a/lending/pkg/models/shared/accountingbanktransaction.go +++ b/lending/pkg/models/shared/accountingbanktransaction.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -52,10 +52,10 @@ type AccountingBankTransaction struct { ClearedOnDate *string `json:"clearedOnDate,omitempty"` // Description of the bank transaction. Description *string `json:"description,omitempty"` - // Identifier for the bank transaction, unique to the company in the accounting platform. + // Identifier for the bank transaction, unique to the company in the accounting software. ID *string `json:"id,omitempty"` ModifiedDate *string `json:"modifiedDate,omitempty"` - // `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting platform. + // `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting software. Reconciled *bool `json:"reconciled,omitempty"` SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` // Type of transaction for the bank statement line. diff --git a/lending/pkg/models/shared/accountingbanktransactions.go b/lending/pkg/models/shared/accountingbanktransactions.go index 18b639b77..12a11fe13 100644 --- a/lending/pkg/models/shared/accountingbanktransactions.go +++ b/lending/pkg/models/shared/accountingbanktransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingbill.go b/lending/pkg/models/shared/accountingbill.go index 9e3ac38b0..d6186d99b 100644 --- a/lending/pkg/models/shared/accountingbill.go +++ b/lending/pkg/models/shared/accountingbill.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -8,9 +8,9 @@ import ( ) type PurchaseOrderReference struct { - // Identifier for the purchase order, unique for the company in the accounting platform. + // Identifier for the purchase order, unique for the company in the accounting software. ID *string `json:"id,omitempty"` - // Friendly reference for the purchase order, commonly generated by the accounting platform. + // Friendly reference for the purchase order, commonly generated by the accounting software. PurchaseOrderNumber *string `json:"purchaseOrderNumber,omitempty"` } @@ -76,7 +76,7 @@ func (o *WithholdingTax) GetName() string { // * 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*. +// Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's *expenses*. // // You can find these types of transactions in our [Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) data model. type AccountingBill struct { @@ -96,9 +96,9 @@ type AccountingBill struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -121,10 +121,10 @@ type AccountingBill struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` DueDate *string `json:"dueDate,omitempty"` - // Identifier for the bill, unique for the company in the accounting platform. + // Identifier for the bill, unique for the company in the accounting software. ID *string `json:"id,omitempty"` IssueDate string `json:"issueDate"` // Array of Bill line items. @@ -145,7 +145,7 @@ type AccountingBill struct { SubTotal *decimal.Big `decimal:"number" json:"subTotal"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Reference to the supplier the record relates to. SupplierRef *SupplierRef `json:"supplierRef,omitempty"` diff --git a/lending/pkg/models/shared/accountingbillcreditnote.go b/lending/pkg/models/shared/accountingbillcreditnote.go index 12cbfc0c0..0fa0e4542 100644 --- a/lending/pkg/models/shared/accountingbillcreditnote.go +++ b/lending/pkg/models/shared/accountingbillcreditnote.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -46,6 +46,8 @@ type AccountingBillCreditNote struct { AllocatedOnDate *string `json:"allocatedOnDate,omitempty"` // Friendly reference for the bill credit note. BillCreditNoteNumber *string `json:"billCreditNoteNumber,omitempty"` + // An array of records the credit note was created from. + CreatedFromRefs []RecordRef `json:"createdFromRefs,omitempty"` // The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. // // ## Unknown currencies @@ -60,9 +62,9 @@ type AccountingBillCreditNote struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -85,11 +87,11 @@ type AccountingBillCreditNote struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // Percentage rate of any discount applied to the bill credit note. DiscountPercentage *decimal.Big `decimal:"number" json:"discountPercentage"` - // Identifier for the bill credit note that is unique to a company in the accounting platform. + // Identifier for the bill credit note that is unique to a company in the accounting software. ID *string `json:"id,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // @@ -128,7 +130,7 @@ type AccountingBillCreditNote struct { SubTotal *decimal.Big `decimal:"number" json:"subTotal"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Reference to the supplier the record relates to. SupplierRef *SupplierRef `json:"supplierRef,omitempty"` @@ -137,8 +139,8 @@ type AccountingBillCreditNote struct { // Total value of any discounts applied. TotalDiscount *decimal.Big `decimal:"number" json:"totalDiscount"` // Amount of tax included in the bill credit note. - TotalTaxAmount *decimal.Big `decimal:"number" json:"totalTaxAmount"` - WithholdingTax []WithholdingTaxItems `json:"withholdingTax,omitempty"` + TotalTaxAmount *decimal.Big `decimal:"number" json:"totalTaxAmount"` + WithholdingTax []Items `json:"withholdingTax,omitempty"` } func (a AccountingBillCreditNote) MarshalJSON() ([]byte, error) { @@ -166,6 +168,13 @@ func (o *AccountingBillCreditNote) GetBillCreditNoteNumber() *string { return o.BillCreditNoteNumber } +func (o *AccountingBillCreditNote) GetCreatedFromRefs() []RecordRef { + if o == nil { + return nil + } + return o.CreatedFromRefs +} + func (o *AccountingBillCreditNote) GetCurrency() *string { if o == nil { return nil @@ -299,7 +308,7 @@ func (o *AccountingBillCreditNote) GetTotalTaxAmount() *decimal.Big { return o.TotalTaxAmount } -func (o *AccountingBillCreditNote) GetWithholdingTax() []WithholdingTaxItems { +func (o *AccountingBillCreditNote) GetWithholdingTax() []Items { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accountingbillcreditnotes.go b/lending/pkg/models/shared/accountingbillcreditnotes.go index 035d0beb8..5a7b0767f 100644 --- a/lending/pkg/models/shared/accountingbillcreditnotes.go +++ b/lending/pkg/models/shared/accountingbillcreditnotes.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingbillpayment.go b/lending/pkg/models/shared/accountingbillpayment.go index 7e588cdb2..8dd7edcfb 100644 --- a/lending/pkg/models/shared/accountingbillpayment.go +++ b/lending/pkg/models/shared/accountingbillpayment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -25,7 +25,7 @@ import ( // - 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. +// Depending on the bill payments which are allowed by the underlying accounting software, some of these types may be combined. Please see the example data section for samples of what these cases look like. // // In Codat, a bill payment contains details of: // @@ -34,7 +34,7 @@ import ( // - 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/lending-api#/schemas/DirectCost) data model. +// Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's _expenses_. You can find these types of transactions in our [Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) data model. // // Bill payments is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). // @@ -137,7 +137,7 @@ import ( // // > 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. +// > Not all accounting software support linked payments in this way. In these platforms you may see a payment on account and a refund on account. // // ## Foreign currencies // @@ -167,9 +167,9 @@ type AccountingBillPayment struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -192,10 +192,10 @@ type AccountingBillPayment struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` Date string `json:"date"` - // Identifier for the bill payment, unique for the company in the accounting platform. + // Identifier for the bill payment, unique for the company in the accounting software. ID *string `json:"id,omitempty"` // An array of bill payment lines. Lines []BillPaymentLine `json:"lines,omitempty"` @@ -209,7 +209,7 @@ type AccountingBillPayment struct { SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` SupplierRef *SupplierRef `json:"supplierRef,omitempty"` // 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/lending/pkg/models/shared/accountingbillpayments.go b/lending/pkg/models/shared/accountingbillpayments.go index e81ac00e0..a7c419cde 100644 --- a/lending/pkg/models/shared/accountingbillpayments.go +++ b/lending/pkg/models/shared/accountingbillpayments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingbills.go b/lending/pkg/models/shared/accountingbills.go index 06c9bd7a6..5c1e2ef4f 100644 --- a/lending/pkg/models/shared/accountingbills.go +++ b/lending/pkg/models/shared/accountingbills.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingcashflowstatement.go b/lending/pkg/models/shared/accountingcashflowstatement.go index 830bd01e0..3c024295f 100644 --- a/lending/pkg/models/shared/accountingcashflowstatement.go +++ b/lending/pkg/models/shared/accountingcashflowstatement.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingcompanyinfo.go b/lending/pkg/models/shared/accountingcompanyinfo.go index 910b629a1..c79552a38 100644 --- a/lending/pkg/models/shared/accountingcompanyinfo.go +++ b/lending/pkg/models/shared/accountingcompanyinfo.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -8,13 +8,13 @@ package shared // // > **Company information or companies?** // > -// > Company profile is standard information that is held in the accounting platform about a company. `Companies` is an endpoint that lists businesses in the Codat system that have linked and shared their data sources. +// > Company profile is standard information that is held in the accounting software about a company. `Companies` is an endpoint that lists businesses in the Codat system that have linked and shared their data sources. type AccountingCompanyInfo struct { - // Identifier or reference for the company in the accounting platform. + // Identifier or reference for the company in the accounting software. AccountingPlatformRef *string `json:"accountingPlatformRef,omitempty"` // An array of Addresses. Addresses []AccountingAddress `json:"addresses,omitempty"` - // Currency set in the accounting platform of the linked company. Used by the currency rate. + // Currency set in the accounting software of the linked company. Used by the currency rate. BaseCurrency *string `json:"baseCurrency,omitempty"` // Registered legal name of the linked company. CompanyLegalName *string `json:"companyLegalName,omitempty"` @@ -90,7 +90,7 @@ type AccountingCompanyInfo struct { SourceUrls map[string]string `json:"sourceUrls,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Company tax number. TaxNumber *string `json:"taxNumber,omitempty"` diff --git a/lending/pkg/models/shared/accountingcreateaccountresponse.go b/lending/pkg/models/shared/accountingcreateaccountresponse.go index 953aadf48..fdef1af14 100644 --- a/lending/pkg/models/shared/accountingcreateaccountresponse.go +++ b/lending/pkg/models/shared/accountingcreateaccountresponse.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -135,7 +135,7 @@ type AccountingCreateAccountResponseAccountingAccount struct { Status *AccountStatus `json:"status,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Type of account Type *AccountType `json:"type,omitempty"` @@ -294,7 +294,7 @@ type AccountingCreateAccountResponse struct { Data *AccountingCreateAccountResponseAccountingAccount `json:"data,omitempty"` // Unique identifier for a company's data connection. DataConnectionKey string `json:"dataConnectionKey"` - // Available Data types + // Available data types DataType *DataType `json:"dataType,omitempty"` // A message about the error. ErrorMessage *string `json:"errorMessage,omitempty"` diff --git a/lending/pkg/models/shared/accountingcreatebankaccountresponse.go b/lending/pkg/models/shared/accountingcreatebankaccountresponse.go index f7da22b8c..2de059a21 100644 --- a/lending/pkg/models/shared/accountingcreatebankaccountresponse.go +++ b/lending/pkg/models/shared/accountingcreatebankaccountresponse.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -20,13 +20,13 @@ import ( // A list of bank accounts associated with a company and a specific data connection. // // Bank accounts data includes: -// * The name and ID of the account in the accounting platform. +// * The name and ID of the account in the accounting software. // * The currency and balance of the account. // * The sort code and account number. // // Deprecated type: This will be removed in a future release, please migrate away from it as soon as possible. type AccountingCreateBankAccountResponseAccountingBankAccount struct { - // Name of the bank account in the accounting platform. + // Name of the bank account in the accounting software. AccountName *string `json:"accountName,omitempty"` // Account number for the bank account. // @@ -54,7 +54,7 @@ type AccountingCreateBankAccountResponseAccountingBankAccount struct { Currency *string `json:"currency,omitempty"` // International bank account number of the account. Often used when making or receiving international payments. IBan *string `json:"iBan,omitempty"` - // Identifier for the account, unique for the company in the accounting platform. + // Identifier for the account, unique for the company in the accounting software. ID *string `json:"id,omitempty"` // The institution of the bank account. Institution *string `json:"institution,omitempty"` @@ -72,9 +72,11 @@ type AccountingCreateBankAccountResponseAccountingBankAccount struct { // The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. SortCode *string `json:"sortCode,omitempty"` SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` + // Status of the bank account. + Status *BankAccountStatus `json:"status,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` } @@ -194,6 +196,13 @@ func (o *AccountingCreateBankAccountResponseAccountingBankAccount) GetSourceModi return o.SourceModifiedDate } +func (o *AccountingCreateBankAccountResponseAccountingBankAccount) GetStatus() *BankAccountStatus { + if o == nil { + return nil + } + return o.Status +} + func (o *AccountingCreateBankAccountResponseAccountingBankAccount) GetSupplementalData() *SupplementalData { if o == nil { return nil @@ -229,7 +238,7 @@ type AccountingCreateBankAccountResponse struct { Data *AccountingCreateBankAccountResponseAccountingBankAccount `json:"data,omitempty"` // Unique identifier for a company's data connection. DataConnectionKey string `json:"dataConnectionKey"` - // Available Data types + // Available data types DataType *DataType `json:"dataType,omitempty"` // A message about the error. ErrorMessage *string `json:"errorMessage,omitempty"` diff --git a/lending/pkg/models/shared/accountingcreatebanktransactions.go b/lending/pkg/models/shared/accountingcreatebanktransactions.go index f6c860f8f..9f1bcd4dc 100644 --- a/lending/pkg/models/shared/accountingcreatebanktransactions.go +++ b/lending/pkg/models/shared/accountingcreatebanktransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingcreatebanktransactionsresponse.go b/lending/pkg/models/shared/accountingcreatebanktransactionsresponse.go index bd2f32c04..d017d7419 100644 --- a/lending/pkg/models/shared/accountingcreatebanktransactionsresponse.go +++ b/lending/pkg/models/shared/accountingcreatebanktransactionsresponse.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -53,7 +53,7 @@ type AccountingCreateBankTransactionsResponse struct { Data *AccountingCreateBankAccountTransactions `json:"data,omitempty"` // Unique identifier for a company's data connection. DataConnectionKey string `json:"dataConnectionKey"` - // Available Data types + // Available data types DataType *DataType `json:"dataType,omitempty"` // A message about the error. ErrorMessage *string `json:"errorMessage,omitempty"` diff --git a/lending/pkg/models/shared/accountingcreatedirectcostresponse.go b/lending/pkg/models/shared/accountingcreatedirectcostresponse.go index 9816f3fe6..d9007c418 100644 --- a/lending/pkg/models/shared/accountingcreatedirectcostresponse.go +++ b/lending/pkg/models/shared/accountingcreatedirectcostresponse.go @@ -1,65 +1,13 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared import ( - "encoding/json" - "fmt" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "github.com/ericlagergren/decimal" ) -// AccountingCreateDirectCostResponseDataType - Allowed name of the 'dataType'. -type AccountingCreateDirectCostResponseDataType string - -const ( - AccountingCreateDirectCostResponseDataTypeCustomers AccountingCreateDirectCostResponseDataType = "customers" - AccountingCreateDirectCostResponseDataTypeSuppliers AccountingCreateDirectCostResponseDataType = "suppliers" -) - -func (e AccountingCreateDirectCostResponseDataType) ToPointer() *AccountingCreateDirectCostResponseDataType { - return &e -} - -func (e *AccountingCreateDirectCostResponseDataType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "customers": - fallthrough - case "suppliers": - *e = AccountingCreateDirectCostResponseDataType(v) - return nil - default: - return fmt.Errorf("invalid value for AccountingCreateDirectCostResponseDataType: %v", v) - } -} - -// AccountingCreateDirectCostResponseContactReference - A customer or supplier associated with the direct cost. -type AccountingCreateDirectCostResponseContactReference struct { - // Allowed name of the 'dataType'. - DataType *AccountingCreateDirectCostResponseDataType `json:"dataType,omitempty"` - // Unique identifier for a customer or supplier. - ID string `json:"id"` -} - -func (o *AccountingCreateDirectCostResponseContactReference) GetDataType() *AccountingCreateDirectCostResponseDataType { - if o == nil { - return nil - } - return o.DataType -} - -func (o *AccountingCreateDirectCostResponseContactReference) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -// AccountingCreateDirectCostResponseAccountingDirectCost - > **Language tip:** Direct costs may also be referred to as **Spend transactions**, **Spend money transactions**, or **Payments** in various accounting platforms. +// AccountingCreateDirectCostResponseAccountingDirectCost - > **Language tip:** Direct costs may also be referred to as **Spend transactions**, **Spend money transactions**, or **Payments** in various accounting software. // // > View the coverage for direct costs in the Data coverage explorer. // @@ -77,8 +25,7 @@ func (o *AccountingCreateDirectCostResponseContactReference) GetID() string { // // Deprecated type: This will be removed in a future release, please migrate away from it as soon as possible. type AccountingCreateDirectCostResponseAccountingDirectCost struct { - // A customer or supplier associated with the direct cost. - ContactRef *AccountingCreateDirectCostResponseContactReference `json:"contactRef,omitempty"` + ContactRef *ContactRef `json:"contactRef,omitempty"` // The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. // // ## Unknown currencies @@ -93,9 +40,9 @@ type AccountingCreateDirectCostResponseAccountingDirectCost struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -118,7 +65,7 @@ type AccountingCreateDirectCostResponseAccountingDirectCost struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // Identifier of the direct cost, unique for the company. ID *string `json:"id,omitempty"` @@ -157,7 +104,7 @@ type AccountingCreateDirectCostResponseAccountingDirectCost struct { SubTotal *decimal.Big `decimal:"number" json:"subTotal"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // The total amount of tax on the direct costs. TaxAmount *decimal.Big `decimal:"number" json:"taxAmount"` @@ -176,7 +123,7 @@ func (a *AccountingCreateDirectCostResponseAccountingDirectCost) UnmarshalJSON(d return nil } -func (o *AccountingCreateDirectCostResponseAccountingDirectCost) GetContactRef() *AccountingCreateDirectCostResponseContactReference { +func (o *AccountingCreateDirectCostResponseAccountingDirectCost) GetContactRef() *ContactRef { if o == nil { return nil } @@ -316,7 +263,7 @@ type AccountingCreateDirectCostResponse struct { Data *AccountingCreateDirectCostResponseAccountingDirectCost `json:"data,omitempty"` // Unique identifier for a company's data connection. DataConnectionKey string `json:"dataConnectionKey"` - // Available Data types + // Available data types DataType *DataType `json:"dataType,omitempty"` // A message about the error. ErrorMessage *string `json:"errorMessage,omitempty"` diff --git a/lending/pkg/models/shared/accountingcreatepaymentresponse.go b/lending/pkg/models/shared/accountingcreatepaymentresponse.go index 8ad917c4d..89445cbaf 100644 --- a/lending/pkg/models/shared/accountingcreatepaymentresponse.go +++ b/lending/pkg/models/shared/accountingcreatepaymentresponse.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -23,7 +23,7 @@ import ( // - An allocation of a customer's credit note, either to an invoice or maybe a refund. // - A payment made directly to that accounts receivable account. This might be an overpayment or a prepayment. It might also be the refund of a payment made directly to an accounts receivable account. // -// Depending on the payments allowed by the underlying accounting package, some payment types may be combined. Please see the example for more details. +// Depending on the payments allowed by the underlying accounting software, some payment types may be combined. Please see the example for more details. // // In Codat, a payment contains details of: // @@ -128,7 +128,7 @@ import ( // // > **Support for linked payments** // > -// > Not all accounting packages support linking payments in this way. In some platforms, you may see a payment on account and a refund on account. +// > Not all accounting software support linking payments in this way. In some platforms, you may see a payment on account and a refund on account. // // ## Foreign currencies // @@ -698,9 +698,9 @@ type AccountingCreatePaymentResponseAccountingPayment struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -723,7 +723,7 @@ type AccountingCreatePaymentResponseAccountingPayment struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` CustomerRef *AccountingCustomerRef `json:"customerRef,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: @@ -746,7 +746,7 @@ type AccountingCreatePaymentResponseAccountingPayment struct { // > Not all dates from Codat will contain information about time zones. // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. Date string `json:"date"` - // Identifier for the payment, unique to the company in the accounting platform. + // Identifier for the payment, unique to the company in the accounting software. ID *string `json:"id,omitempty"` // An array of payment lines. Lines []PaymentLine `json:"lines,omitempty"` @@ -754,14 +754,14 @@ type AccountingCreatePaymentResponseAccountingPayment struct { ModifiedDate *string `json:"modifiedDate,omitempty"` // Any additional information associated with the payment. Note *string `json:"note,omitempty"` - // The payment method the record is linked to in the accounting or commerce platform. + // The payment method the record is linked to in the accounting or commerce software. PaymentMethodRef *PaymentMethodRef `json:"paymentMethodRef,omitempty"` // Friendly reference for the payment. Reference *string `json:"reference,omitempty"` SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` @@ -911,7 +911,7 @@ type AccountingCreatePaymentResponse struct { Data *AccountingCreatePaymentResponseAccountingPayment `json:"data,omitempty"` // Unique identifier for a company's data connection. DataConnectionKey string `json:"dataConnectionKey"` - // Available Data types + // Available data types DataType *DataType `json:"dataType,omitempty"` // A message about the error. ErrorMessage *string `json:"errorMessage,omitempty"` diff --git a/lending/pkg/models/shared/accountingcreatesupplierresponse.go b/lending/pkg/models/shared/accountingcreatesupplierresponse.go index 738e631b3..6c1c7cd2a 100644 --- a/lending/pkg/models/shared/accountingcreatesupplierresponse.go +++ b/lending/pkg/models/shared/accountingcreatesupplierresponse.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -18,7 +18,7 @@ type AccountingCreateSupplierResponseAccountingSupplier struct { DefaultCurrency *string `json:"defaultCurrency,omitempty"` // Email address that the supplier may be contacted on. EmailAddress *string `json:"emailAddress,omitempty"` - // Identifier for the supplier, unique to the company in the accounting platform. + // Identifier for the supplier, unique to the company in the accounting software. ID *string `json:"id,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` ModifiedDate *string `json:"modifiedDate,omitempty"` @@ -31,7 +31,7 @@ type AccountingCreateSupplierResponseAccountingSupplier struct { Status SupplierStatus `json:"status"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Name of the supplier as recorded in the accounting system, typically the company name. SupplierName *string `json:"supplierName,omitempty"` @@ -165,7 +165,7 @@ type AccountingCreateSupplierResponse struct { Data *AccountingCreateSupplierResponseAccountingSupplier `json:"data,omitempty"` // Unique identifier for a company's data connection. DataConnectionKey string `json:"dataConnectionKey"` - // Available Data types + // Available data types DataType *DataType `json:"dataType,omitempty"` // A message about the error. ErrorMessage *string `json:"errorMessage,omitempty"` diff --git a/lending/pkg/models/shared/accountingcreatetransferresponse.go b/lending/pkg/models/shared/accountingcreatetransferresponse.go index 701615fee..5fc31d9e4 100644 --- a/lending/pkg/models/shared/accountingcreatetransferresponse.go +++ b/lending/pkg/models/shared/accountingcreatetransferresponse.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -8,7 +8,6 @@ package shared // // Deprecated type: This will be removed in a future release, please migrate away from it as soon as possible. type AccountingCreateTransferResponseAccountingTransfer struct { - // A customer or supplier associated with the direct cost. ContactRef *ContactRef `json:"contactRef,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // @@ -43,7 +42,7 @@ type AccountingCreateTransferResponseAccountingTransfer struct { SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Account details of the account sending or receiving the transfer. To *TransferAccount `json:"to,omitempty"` @@ -163,7 +162,7 @@ type AccountingCreateTransferResponse struct { Data *AccountingCreateTransferResponseAccountingTransfer `json:"data,omitempty"` // Unique identifier for a company's data connection. DataConnectionKey string `json:"dataConnectionKey"` - // Available Data types + // Available data types DataType *DataType `json:"dataType,omitempty"` // A message about the error. ErrorMessage *string `json:"errorMessage,omitempty"` diff --git a/lending/pkg/models/shared/accountingcreditnote.go b/lending/pkg/models/shared/accountingcreditnote.go index c1a422b85..4a0e6505c 100644 --- a/lending/pkg/models/shared/accountingcreditnote.go +++ b/lending/pkg/models/shared/accountingcreditnote.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -60,9 +60,9 @@ type AccountingCreditNote struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -85,12 +85,12 @@ type AccountingCreditNote struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` CustomerRef *AccountingCustomerRef `json:"customerRef,omitempty"` // Percentage rate (from 0 to 100) of discounts applied to the credit note. DiscountPercentage *decimal.Big `decimal:"number" json:"discountPercentage"` - // Identifier for the credit note, unique to the company in the accounting platform. + // Identifier for the credit note, unique to the company in the accounting software. ID *string `json:"id,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // @@ -115,7 +115,7 @@ type AccountingCreditNote struct { LineItems []CreditNoteLineItem `json:"lineItems,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` ModifiedDate *string `json:"modifiedDate,omitempty"` - // Any additional information about the credit note. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when a credit note is emailed from the accounting platform to the customer. + // Any additional information about the credit note. Where possible, Codat links to a data field in the accounting software that is publicly available. This means that the contents of the note field are included when a credit note is emailed from the accounting software to the customer. Note *string `json:"note,omitempty"` // An array of payment allocations. PaymentAllocations []AccountingPaymentAllocation `json:"paymentAllocations,omitempty"` @@ -128,15 +128,15 @@ type AccountingCreditNote struct { SubTotal *decimal.Big `decimal:"number" json:"subTotal"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Total amount of credit that has been applied to the customer's accounts receivable TotalAmount *decimal.Big `decimal:"number" json:"totalAmount"` // Any discounts applied to the credit note amount. TotalDiscount *decimal.Big `decimal:"number" json:"totalDiscount"` // Any tax applied to the credit note amount. - TotalTaxAmount *decimal.Big `decimal:"number" json:"totalTaxAmount"` - WithholdingTax []WithholdingTaxItems `json:"withholdingTax,omitempty"` + TotalTaxAmount *decimal.Big `decimal:"number" json:"totalTaxAmount"` + WithholdingTax []Items `json:"withholdingTax,omitempty"` } func (a AccountingCreditNote) MarshalJSON() ([]byte, error) { @@ -311,7 +311,7 @@ func (o *AccountingCreditNote) GetTotalTaxAmount() *decimal.Big { return o.TotalTaxAmount } -func (o *AccountingCreditNote) GetWithholdingTax() []WithholdingTaxItems { +func (o *AccountingCreditNote) GetWithholdingTax() []Items { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accountingcreditnotes.go b/lending/pkg/models/shared/accountingcreditnotes.go index 8bd0af3ef..ed0285aaa 100644 --- a/lending/pkg/models/shared/accountingcreditnotes.go +++ b/lending/pkg/models/shared/accountingcreditnotes.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingcustomer.go b/lending/pkg/models/shared/accountingcustomer.go index acd245127..a6c4ded0f 100644 --- a/lending/pkg/models/shared/accountingcustomer.go +++ b/lending/pkg/models/shared/accountingcustomer.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -28,7 +28,7 @@ type AccountingCustomer struct { DefaultCurrency *string `json:"defaultCurrency,omitempty"` // Email address the customer can be contacted by. EmailAddress *string `json:"emailAddress,omitempty"` - // Identifier for the customer, unique to the company in the accounting platform. + // Identifier for the customer, unique to the company in the accounting software. ID *string `json:"id,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` ModifiedDate *string `json:"modifiedDate,omitempty"` @@ -41,7 +41,7 @@ type AccountingCustomer struct { Status CustomerStatus `json:"status"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Company tax number. TaxNumber *string `json:"taxNumber,omitempty"` diff --git a/lending/pkg/models/shared/accountingcustomerref.go b/lending/pkg/models/shared/accountingcustomerref.go index cc74cca3c..4629e853d 100644 --- a/lending/pkg/models/shared/accountingcustomerref.go +++ b/lending/pkg/models/shared/accountingcustomerref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingcustomers.go b/lending/pkg/models/shared/accountingcustomers.go index de686d593..2c91bc917 100644 --- a/lending/pkg/models/shared/accountingcustomers.go +++ b/lending/pkg/models/shared/accountingcustomers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingdirectcost.go b/lending/pkg/models/shared/accountingdirectcost.go index ec21a1b85..83b160b50 100644 --- a/lending/pkg/models/shared/accountingdirectcost.go +++ b/lending/pkg/models/shared/accountingdirectcost.go @@ -1,65 +1,13 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared import ( - "encoding/json" - "fmt" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "github.com/ericlagergren/decimal" ) -// AccountingDirectCostDataType - Allowed name of the 'dataType'. -type AccountingDirectCostDataType string - -const ( - AccountingDirectCostDataTypeCustomers AccountingDirectCostDataType = "customers" - AccountingDirectCostDataTypeSuppliers AccountingDirectCostDataType = "suppliers" -) - -func (e AccountingDirectCostDataType) ToPointer() *AccountingDirectCostDataType { - return &e -} - -func (e *AccountingDirectCostDataType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "customers": - fallthrough - case "suppliers": - *e = AccountingDirectCostDataType(v) - return nil - default: - return fmt.Errorf("invalid value for AccountingDirectCostDataType: %v", v) - } -} - -// AccountingDirectCostContactReference - A customer or supplier associated with the direct cost. -type AccountingDirectCostContactReference struct { - // Allowed name of the 'dataType'. - DataType *AccountingDirectCostDataType `json:"dataType,omitempty"` - // Unique identifier for a customer or supplier. - ID string `json:"id"` -} - -func (o *AccountingDirectCostContactReference) GetDataType() *AccountingDirectCostDataType { - if o == nil { - return nil - } - return o.DataType -} - -func (o *AccountingDirectCostContactReference) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -// AccountingDirectCost - > **Language tip:** Direct costs may also be referred to as **Spend transactions**, **Spend money transactions**, or **Payments** in various accounting platforms. +// AccountingDirectCost - > **Language tip:** Direct costs may also be referred to as **Spend transactions**, **Spend money transactions**, or **Payments** in various accounting software. // // > View the coverage for direct costs in the Data coverage explorer. // @@ -75,8 +23,7 @@ func (o *AccountingDirectCostContactReference) GetID() string { // // Direct costs is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). type AccountingDirectCost struct { - // A customer or supplier associated with the direct cost. - ContactRef *AccountingDirectCostContactReference `json:"contactRef,omitempty"` + ContactRef *ContactRef `json:"contactRef,omitempty"` // The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. // // ## Unknown currencies @@ -91,9 +38,9 @@ type AccountingDirectCost struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -116,7 +63,7 @@ type AccountingDirectCost struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // Identifier of the direct cost, unique for the company. ID *string `json:"id,omitempty"` @@ -155,7 +102,7 @@ type AccountingDirectCost struct { SubTotal *decimal.Big `decimal:"number" json:"subTotal"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // The total amount of tax on the direct costs. TaxAmount *decimal.Big `decimal:"number" json:"taxAmount"` @@ -174,7 +121,7 @@ func (a *AccountingDirectCost) UnmarshalJSON(data []byte) error { return nil } -func (o *AccountingDirectCost) GetContactRef() *AccountingDirectCostContactReference { +func (o *AccountingDirectCost) GetContactRef() *ContactRef { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accountingdirectcosts.go b/lending/pkg/models/shared/accountingdirectcosts.go index 7ebbb9ac8..86f4cec36 100644 --- a/lending/pkg/models/shared/accountingdirectcosts.go +++ b/lending/pkg/models/shared/accountingdirectcosts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingdirectincome.go b/lending/pkg/models/shared/accountingdirectincome.go index e5eded3be..1d118ffd9 100644 --- a/lending/pkg/models/shared/accountingdirectincome.go +++ b/lending/pkg/models/shared/accountingdirectincome.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -7,7 +7,7 @@ import ( "github.com/ericlagergren/decimal" ) -// AccountingDirectIncome - > **Language tip:** Direct incomes may also be referred to as **Receive transactions**, **Receive money transactions**, **Sales receipts**, or **Cash sales** in various accounting platforms. +// AccountingDirectIncome - > **Language tip:** Direct incomes may also be referred to as **Receive transactions**, **Receive money transactions**, **Sales receipts**, or **Cash sales** in various accounting software. // // > View the coverage for direct incomes in the Data coverage explorer. // @@ -23,7 +23,6 @@ import ( // // Direct incomes is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). type AccountingDirectIncome struct { - // A customer or supplier associated with the direct cost. ContactRef *ContactRef `json:"contactRef,omitempty"` // The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. // @@ -39,9 +38,9 @@ type AccountingDirectIncome struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -64,7 +63,7 @@ type AccountingDirectIncome struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // Identifier of the direct income, unique for the company. ID *string `json:"id,omitempty"` @@ -102,7 +101,7 @@ type AccountingDirectIncome struct { SubTotal *decimal.Big `decimal:"number" json:"subTotal"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // The total amount of tax on the direct incomes. TaxAmount *decimal.Big `decimal:"number" json:"taxAmount"` diff --git a/lending/pkg/models/shared/accountingdirectincomes.go b/lending/pkg/models/shared/accountingdirectincomes.go index abc25b2df..085b2df18 100644 --- a/lending/pkg/models/shared/accountingdirectincomes.go +++ b/lending/pkg/models/shared/accountingdirectincomes.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountinginvoice.go b/lending/pkg/models/shared/accountinginvoice.go index ee3cc80a9..110a93068 100644 --- a/lending/pkg/models/shared/accountinginvoice.go +++ b/lending/pkg/models/shared/accountinginvoice.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e AccountingInvoiceDataType) ToPointer() *AccountingInvoiceDataType { return &e } - func (e *AccountingInvoiceDataType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { @@ -105,9 +104,9 @@ type AccountingInvoice struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -130,7 +129,7 @@ type AccountingInvoice struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` CustomerRef *AccountingCustomerRef `json:"customerRef,omitempty"` // Percentage rate (from 0 to 100) of discounts applied to the invoice. For example: A 5% discount will return a value of `5`, not `0.05`. @@ -155,7 +154,7 @@ type AccountingInvoice struct { // > Not all dates from Codat will contain information about time zones. // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. DueDate *string `json:"dueDate,omitempty"` - // Identifier for the invoice, unique to the company in the accounting platform. + // Identifier for the invoice, unique to the company in the accounting software. ID *string `json:"id,omitempty"` // Friendly reference for the invoice. If available, this appears in the file name of invoice attachments. InvoiceNumber *string `json:"invoiceNumber,omitempty"` @@ -183,7 +182,7 @@ type AccountingInvoice struct { LineItems []InvoiceLineItem `json:"lineItems,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` ModifiedDate *string `json:"modifiedDate,omitempty"` - // Any additional information about the invoice. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when an invoice is emailed from the accounting platform to the customer. + // Any additional information about the invoice. Where possible, Codat links to a data field in the accounting software that is publicly available. This means that the contents of the note field are included when an invoice is emailed from the accounting software to the customer. Note *string `json:"note,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // @@ -222,15 +221,15 @@ type AccountingInvoice struct { SubTotal *decimal.Big `decimal:"number" json:"subTotal,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Amount of the invoice, inclusive of tax. TotalAmount *decimal.Big `decimal:"number" json:"totalAmount"` // Numerical value of discounts applied to the invoice. TotalDiscount *decimal.Big `decimal:"number" json:"totalDiscount,omitempty"` // Amount of tax on the invoice. - TotalTaxAmount *decimal.Big `decimal:"number" json:"totalTaxAmount"` - WithholdingTax []WithholdingTaxItems `json:"withholdingTax,omitempty"` + TotalTaxAmount *decimal.Big `decimal:"number" json:"totalTaxAmount"` + WithholdingTax []Items `json:"withholdingTax,omitempty"` } func (a AccountingInvoice) MarshalJSON() ([]byte, error) { @@ -419,7 +418,7 @@ func (o *AccountingInvoice) GetTotalTaxAmount() *decimal.Big { return o.TotalTaxAmount } -func (o *AccountingInvoice) GetWithholdingTax() []WithholdingTaxItems { +func (o *AccountingInvoice) GetWithholdingTax() []Items { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accountinginvoices.go b/lending/pkg/models/shared/accountinginvoices.go index 444c557a4..3732e654e 100644 --- a/lending/pkg/models/shared/accountinginvoices.go +++ b/lending/pkg/models/shared/accountinginvoices.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingjournal.go b/lending/pkg/models/shared/accountingjournal.go index b4218b332..dbe3d675e 100644 --- a/lending/pkg/models/shared/accountingjournal.go +++ b/lending/pkg/models/shared/accountingjournal.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -23,7 +23,7 @@ package shared // - [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. +// > When pushing journal entries to an accounting software that doesn’t support multiple journals (multi-book accounting), the entries will be linked to the platform-generic journal. The Journals data type will only include one object. type AccountingJournal struct { // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // diff --git a/lending/pkg/models/shared/accountingjournalentries.go b/lending/pkg/models/shared/accountingjournalentries.go index 1cecd11a1..eec2f42d8 100644 --- a/lending/pkg/models/shared/accountingjournalentries.go +++ b/lending/pkg/models/shared/accountingjournalentries.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingjournalentry.go b/lending/pkg/models/shared/accountingjournalentry.go index b53bf6130..8bf64575f 100644 --- a/lending/pkg/models/shared/accountingjournalentry.go +++ b/lending/pkg/models/shared/accountingjournalentry.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -47,7 +47,7 @@ type AccountingJournalEntry struct { CreatedOn *string `json:"createdOn,omitempty"` // Optional description of the journal entry. Description *string `json:"description,omitempty"` - // Unique identifier of the journal entry for the company in the accounting platform. + // Unique identifier of the journal entry for the company in the accounting software. ID *string `json:"id,omitempty"` // An array of journal lines. JournalLines []JournalLine `json:"journalLines,omitempty"` @@ -80,7 +80,7 @@ type AccountingJournalEntry struct { SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // diff --git a/lending/pkg/models/shared/accountingjournals.go b/lending/pkg/models/shared/accountingjournals.go index a14e0e87a..5e2c0ba29 100644 --- a/lending/pkg/models/shared/accountingjournals.go +++ b/lending/pkg/models/shared/accountingjournals.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingpayment.go b/lending/pkg/models/shared/accountingpayment.go index e89b16e63..2f88553d6 100644 --- a/lending/pkg/models/shared/accountingpayment.go +++ b/lending/pkg/models/shared/accountingpayment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -23,7 +23,7 @@ import ( // - An allocation of a customer's credit note, either to an invoice or maybe a refund. // - A payment made directly to that accounts receivable account. This might be an overpayment or a prepayment. It might also be the refund of a payment made directly to an accounts receivable account. // -// Depending on the payments allowed by the underlying accounting package, some payment types may be combined. Please see the example for more details. +// Depending on the payments allowed by the underlying accounting software, some payment types may be combined. Please see the example for more details. // // In Codat, a payment contains details of: // @@ -128,7 +128,7 @@ import ( // // > **Support for linked payments** // > -// > Not all accounting packages support linking payments in this way. In some platforms, you may see a payment on account and a refund on account. +// > Not all accounting software support linking payments in this way. In some platforms, you may see a payment on account and a refund on account. // // ## Foreign currencies // @@ -696,9 +696,9 @@ type AccountingPayment struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -721,7 +721,7 @@ type AccountingPayment struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` CustomerRef *AccountingCustomerRef `json:"customerRef,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: @@ -744,7 +744,7 @@ type AccountingPayment struct { // > Not all dates from Codat will contain information about time zones. // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. Date string `json:"date"` - // Identifier for the payment, unique to the company in the accounting platform. + // Identifier for the payment, unique to the company in the accounting software. ID *string `json:"id,omitempty"` // An array of payment lines. Lines []PaymentLine `json:"lines,omitempty"` @@ -752,14 +752,14 @@ type AccountingPayment struct { ModifiedDate *string `json:"modifiedDate,omitempty"` // Any additional information associated with the payment. Note *string `json:"note,omitempty"` - // The payment method the record is linked to in the accounting or commerce platform. + // The payment method the record is linked to in the accounting or commerce software. PaymentMethodRef *PaymentMethodRef `json:"paymentMethodRef,omitempty"` // Friendly reference for the payment. Reference *string `json:"reference,omitempty"` SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` diff --git a/lending/pkg/models/shared/accountingpaymentallocation.go b/lending/pkg/models/shared/accountingpaymentallocation.go index bf1999f95..6a090775e 100644 --- a/lending/pkg/models/shared/accountingpaymentallocation.go +++ b/lending/pkg/models/shared/accountingpaymentallocation.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -42,9 +42,9 @@ type Allocation struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -67,7 +67,7 @@ type Allocation struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // The total amount that has been allocated. TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` diff --git a/lending/pkg/models/shared/accountingpayments.go b/lending/pkg/models/shared/accountingpayments.go index 56b5aed13..11b3a3deb 100644 --- a/lending/pkg/models/shared/accountingpayments.go +++ b/lending/pkg/models/shared/accountingpayments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingprofitandlossreport.go b/lending/pkg/models/shared/accountingprofitandlossreport.go index afd655666..e5be73890 100644 --- a/lending/pkg/models/shared/accountingprofitandlossreport.go +++ b/lending/pkg/models/shared/accountingprofitandlossreport.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -16,13 +16,13 @@ package shared // > Profit and loss reports summarise the total revenue, expenses, and profit or loss over a specified time period. A balance sheet report presents all assets, liability, and equity for a given date. // // **Structure of this report** -// This report will reflect the structure and line descriptions that the business has set in their own accounting platform. +// This report will reflect the structure and line descriptions that the business has set in their own accounting software. // // **History** // By default, Codat pulls (up to) 24 months of profit and loss history for a company. You can adjust this to fetch more history, where available, by updating the `monthsToSync` value for `profitAndLoss` on the [data type settings endpoint](https://docs.codat.io/lending-api#/operations/post-profile-syncSettings). // // **Want to pull this in a standardised structure?** -// Our [Enhanced Financials](https://docs.codat.io/assess/reports/enhanced-financials/financials) endpoints provide the same report under standardized headings, allowing you to pull it in the same format for all of your business customers. +// Our [Enhanced Financials](https://docs.codat.io/lending/features/financial-statements-overview) endpoints provide the same report under standardized headings, allowing you to pull it in the same format for all of your business customers. type AccountingProfitAndLossReport struct { // Base currency of the company in which the profit and loss report is presented. Currency string `json:"currency"` diff --git a/lending/pkg/models/shared/accountingsupplier.go b/lending/pkg/models/shared/accountingsupplier.go index adab40b22..9a386b1da 100644 --- a/lending/pkg/models/shared/accountingsupplier.go +++ b/lending/pkg/models/shared/accountingsupplier.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -16,7 +16,7 @@ type AccountingSupplier struct { DefaultCurrency *string `json:"defaultCurrency,omitempty"` // Email address that the supplier may be contacted on. EmailAddress *string `json:"emailAddress,omitempty"` - // Identifier for the supplier, unique to the company in the accounting platform. + // Identifier for the supplier, unique to the company in the accounting software. ID *string `json:"id,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` ModifiedDate *string `json:"modifiedDate,omitempty"` @@ -29,7 +29,7 @@ type AccountingSupplier struct { Status SupplierStatus `json:"status"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Name of the supplier as recorded in the accounting system, typically the company name. SupplierName *string `json:"supplierName,omitempty"` diff --git a/lending/pkg/models/shared/accountingsuppliers.go b/lending/pkg/models/shared/accountingsuppliers.go index 07583e81f..c41a0c276 100644 --- a/lending/pkg/models/shared/accountingsuppliers.go +++ b/lending/pkg/models/shared/accountingsuppliers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountingtransfer.go b/lending/pkg/models/shared/accountingtransfer.go index 43f70a692..c1977dbc2 100644 --- a/lending/pkg/models/shared/accountingtransfer.go +++ b/lending/pkg/models/shared/accountingtransfer.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -6,7 +6,6 @@ package shared // // A transfer records the movement of money between two bank accounts, or between a bank account and a nominal account. It is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). type AccountingTransfer struct { - // A customer or supplier associated with the direct cost. ContactRef *ContactRef `json:"contactRef,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // @@ -41,7 +40,7 @@ type AccountingTransfer struct { SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Account details of the account sending or receiving the transfer. To *TransferAccount `json:"to,omitempty"` diff --git a/lending/pkg/models/shared/accountingtransfers.go b/lending/pkg/models/shared/accountingtransfers.go index efdb81525..b8fd64e6c 100644 --- a/lending/pkg/models/shared/accountingtransfers.go +++ b/lending/pkg/models/shared/accountingtransfers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountinstitution.go b/lending/pkg/models/shared/accountinstitution.go index 2615a0d84..fc5d9b263 100644 --- a/lending/pkg/models/shared/accountinstitution.go +++ b/lending/pkg/models/shared/accountinstitution.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountprototype.go b/lending/pkg/models/shared/accountprototype.go index 62f73edb7..c06aa27a3 100644 --- a/lending/pkg/models/shared/accountprototype.go +++ b/lending/pkg/models/shared/accountprototype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -100,7 +100,7 @@ type AccountPrototype struct { Status *AccountStatus `json:"status,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Type of account Type *AccountType `json:"type,omitempty"` diff --git a/lending/pkg/models/shared/accountref.go b/lending/pkg/models/shared/accountref.go index a62aae1ef..49e13a2b9 100644 --- a/lending/pkg/models/shared/accountref.go +++ b/lending/pkg/models/shared/accountref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accounts.go b/lending/pkg/models/shared/accounts.go index 2e4483c85..208189a41 100644 --- a/lending/pkg/models/shared/accounts.go +++ b/lending/pkg/models/shared/accounts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountspayabletracking.go b/lending/pkg/models/shared/accountspayabletracking.go index ca4772c78..67fd649c9 100644 --- a/lending/pkg/models/shared/accountspayabletracking.go +++ b/lending/pkg/models/shared/accountspayabletracking.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountsreceivabletracking.go b/lending/pkg/models/shared/accountsreceivabletracking.go index 525f5f026..2fe3ec19f 100644 --- a/lending/pkg/models/shared/accountsreceivabletracking.go +++ b/lending/pkg/models/shared/accountsreceivabletracking.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accountstatus.go b/lending/pkg/models/shared/accountstatus.go index 17493901b..c86b01e74 100644 --- a/lending/pkg/models/shared/accountstatus.go +++ b/lending/pkg/models/shared/accountstatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -20,7 +20,6 @@ const ( func (e AccountStatus) ToPointer() *AccountStatus { return &e } - func (e *AccountStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/accounttransactionline.go b/lending/pkg/models/shared/accounttransactionline.go index f179f0b20..7d72b00fb 100644 --- a/lending/pkg/models/shared/accounttransactionline.go +++ b/lending/pkg/models/shared/accounttransactionline.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/accounttransactionlinerecordref.go b/lending/pkg/models/shared/accounttransactionlinerecordref.go index da9bcf17b..d2f8c9374 100644 --- a/lending/pkg/models/shared/accounttransactionlinerecordref.go +++ b/lending/pkg/models/shared/accounttransactionlinerecordref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -27,7 +27,6 @@ const ( func (e AccountTransactionLineRecordRefDataType) ToPointer() *AccountTransactionLineRecordRefDataType { return &e } - func (e *AccountTransactionLineRecordRefDataType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/accounttype.go b/lending/pkg/models/shared/accounttype.go index 771c270b3..95bc921a7 100644 --- a/lending/pkg/models/shared/accounttype.go +++ b/lending/pkg/models/shared/accounttype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -22,7 +22,6 @@ const ( func (e AccountType) ToPointer() *AccountType { return &e } - func (e *AccountType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/agedcreditor.go b/lending/pkg/models/shared/agedcreditor.go index 4aded7dee..74941430f 100644 --- a/lending/pkg/models/shared/agedcreditor.go +++ b/lending/pkg/models/shared/agedcreditor.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/agedcurrencyoutstanding.go b/lending/pkg/models/shared/agedcurrencyoutstanding.go index 19eff827a..b59e3ed9f 100644 --- a/lending/pkg/models/shared/agedcurrencyoutstanding.go +++ b/lending/pkg/models/shared/agedcurrencyoutstanding.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/ageddebtor.go b/lending/pkg/models/shared/ageddebtor.go index 83ea68cd8..594721c65 100644 --- a/lending/pkg/models/shared/ageddebtor.go +++ b/lending/pkg/models/shared/ageddebtor.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/agedoutstandingamount.go b/lending/pkg/models/shared/agedoutstandingamount.go index 061240f4b..f9685c3ff 100644 --- a/lending/pkg/models/shared/agedoutstandingamount.go +++ b/lending/pkg/models/shared/agedoutstandingamount.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/agedoutstandingamountdetail.go b/lending/pkg/models/shared/agedoutstandingamountdetail.go index 14afabddb..b8763631e 100644 --- a/lending/pkg/models/shared/agedoutstandingamountdetail.go +++ b/lending/pkg/models/shared/agedoutstandingamountdetail.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/attachments.go b/lending/pkg/models/shared/attachments.go index c5441a28e..63bd4e8e3 100644 --- a/lending/pkg/models/shared/attachments.go +++ b/lending/pkg/models/shared/attachments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/balancesheet.go b/lending/pkg/models/shared/balancesheet.go index 3fbdc93b8..50e012e28 100644 --- a/lending/pkg/models/shared/balancesheet.go +++ b/lending/pkg/models/shared/balancesheet.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -28,9 +28,9 @@ type BalanceSheet struct { // > // > Not all dates from Codat will contain information about time zones. // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - Date *string `json:"date,omitempty"` - Equity *ReportLineInput `json:"equity,omitempty"` - Liabilities *ReportLineInput `json:"liabilities,omitempty"` + Date *string `json:"date,omitempty"` + Equity *ReportLine `json:"equity,omitempty"` + Liabilities *ReportLine `json:"liabilities,omitempty"` // Value of net assets for a company in their base currency. NetAssets *decimal.Big `decimal:"number" json:"netAssets"` } @@ -60,14 +60,14 @@ func (o *BalanceSheet) GetDate() *string { return o.Date } -func (o *BalanceSheet) GetEquity() *ReportLineInput { +func (o *BalanceSheet) GetEquity() *ReportLine { if o == nil { return nil } return o.Equity } -func (o *BalanceSheet) GetLiabilities() *ReportLineInput { +func (o *BalanceSheet) GetLiabilities() *ReportLine { if o == nil { return nil } diff --git a/lending/pkg/models/shared/bankaccountref.go b/lending/pkg/models/shared/bankaccountref.go index 62d1d9ba0..b71b03faa 100644 --- a/lending/pkg/models/shared/bankaccountref.go +++ b/lending/pkg/models/shared/bankaccountref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/bankaccountstatus.go b/lending/pkg/models/shared/bankaccountstatus.go new file mode 100644 index 000000000..893fd2099 --- /dev/null +++ b/lending/pkg/models/shared/bankaccountstatus.go @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +// BankAccountStatus - Status of the bank account. +type BankAccountStatus string + +const ( + BankAccountStatusUnknown BankAccountStatus = "Unknown" + BankAccountStatusActive BankAccountStatus = "Active" + BankAccountStatusArchived BankAccountStatus = "Archived" + BankAccountStatusPending BankAccountStatus = "Pending" +) + +func (e BankAccountStatus) ToPointer() *BankAccountStatus { + return &e +} +func (e *BankAccountStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "Unknown": + fallthrough + case "Active": + fallthrough + case "Archived": + fallthrough + case "Pending": + *e = BankAccountStatus(v) + return nil + default: + return fmt.Errorf("invalid value for BankAccountStatus: %v", v) + } +} diff --git a/lending/pkg/models/shared/bankingaccount.go b/lending/pkg/models/shared/bankingaccount.go index a0285f890..5536f68d4 100644 --- a/lending/pkg/models/shared/bankingaccount.go +++ b/lending/pkg/models/shared/bankingaccount.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/bankingaccountbalance.go b/lending/pkg/models/shared/bankingaccountbalance.go index 14275236a..32927be87 100644 --- a/lending/pkg/models/shared/bankingaccountbalance.go +++ b/lending/pkg/models/shared/bankingaccountbalance.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/bankingaccountbalances.go b/lending/pkg/models/shared/bankingaccountbalances.go index 72ee9fedd..f70f18ebd 100644 --- a/lending/pkg/models/shared/bankingaccountbalances.go +++ b/lending/pkg/models/shared/bankingaccountbalances.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/bankingaccounts.go b/lending/pkg/models/shared/bankingaccounts.go index cde85256f..3de9e3443 100644 --- a/lending/pkg/models/shared/bankingaccounts.go +++ b/lending/pkg/models/shared/bankingaccounts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/bankingtransaction.go b/lending/pkg/models/shared/bankingtransaction.go index d4f2368fe..a2650e252 100644 --- a/lending/pkg/models/shared/bankingtransaction.go +++ b/lending/pkg/models/shared/bankingtransaction.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/bankingtransactioncategories.go b/lending/pkg/models/shared/bankingtransactioncategories.go index 690934981..a2287a74c 100644 --- a/lending/pkg/models/shared/bankingtransactioncategories.go +++ b/lending/pkg/models/shared/bankingtransactioncategories.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/bankingtransactioncategory.go b/lending/pkg/models/shared/bankingtransactioncategory.go index 1c6e30c6c..8f306ff4e 100644 --- a/lending/pkg/models/shared/bankingtransactioncategory.go +++ b/lending/pkg/models/shared/bankingtransactioncategory.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/bankingtransactionref.go b/lending/pkg/models/shared/bankingtransactionref.go index cf662f0f7..b28a9e914 100644 --- a/lending/pkg/models/shared/bankingtransactionref.go +++ b/lending/pkg/models/shared/bankingtransactionref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/bankingtransactions.go b/lending/pkg/models/shared/bankingtransactions.go index f6793cda7..c865e69cd 100644 --- a/lending/pkg/models/shared/bankingtransactions.go +++ b/lending/pkg/models/shared/bankingtransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/bankstatementuploadconfiguration.go b/lending/pkg/models/shared/bankstatementuploadconfiguration.go new file mode 100644 index 000000000..26e1c6c31 --- /dev/null +++ b/lending/pkg/models/shared/bankstatementuploadconfiguration.go @@ -0,0 +1,63 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +// Source - The source of the banking data that determines its format +type Source string + +const ( + SourceCodat Source = "codat" +) + +func (e Source) ToPointer() *Source { + return &e +} +func (e *Source) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "codat": + *e = Source(v) + return nil + default: + return fmt.Errorf("invalid value for Source: %v", v) + } +} + +// BankStatementUploadConfiguration - Configuration settings for uploading banking data to Codat +type BankStatementUploadConfiguration struct { + // The ID of the account in the third-party platform + AccountID *string `json:"accountId,omitempty"` + // TrueLayer provider ID (only required if source is TrueLayer) + ProviderID *string `json:"providerId,omitempty"` + // The source of the banking data that determines its format + Source *Source `json:"source,omitempty"` +} + +func (o *BankStatementUploadConfiguration) GetAccountID() *string { + if o == nil { + return nil + } + return o.AccountID +} + +func (o *BankStatementUploadConfiguration) GetProviderID() *string { + if o == nil { + return nil + } + return o.ProviderID +} + +func (o *BankStatementUploadConfiguration) GetSource() *Source { + if o == nil { + return nil + } + return o.Source +} diff --git a/lending/pkg/models/shared/banktransactiontype.go b/lending/pkg/models/shared/banktransactiontype.go index 2053ae353..1b752b2cd 100644 --- a/lending/pkg/models/shared/banktransactiontype.go +++ b/lending/pkg/models/shared/banktransactiontype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -34,7 +34,6 @@ const ( func (e BankTransactionType) ToPointer() *BankTransactionType { return &e } - func (e *BankTransactionType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/billcreditnotelineitem.go b/lending/pkg/models/shared/billcreditnotelineitem.go index cf5b6e873..ebf8716a6 100644 --- a/lending/pkg/models/shared/billcreditnotelineitem.go +++ b/lending/pkg/models/shared/billcreditnotelineitem.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -9,9 +9,9 @@ import ( // ItemReference - Reference to the item the line is linked to. type ItemReference struct { - // Unique identifier for the item in the accounting platform. + // Unique identifier for the item in the accounting software. ID string `json:"id"` - // Name of the item in the accounting platform. + // Name of the item in the accounting software. Name *string `json:"name,omitempty"` } @@ -42,9 +42,9 @@ func (o *ItemReference) GetName() *string { type TaxRateReference struct { // Applicable tax rate. EffectiveTaxRate *decimal.Big `decimal:"number" json:"effectiveTaxRate,omitempty"` - // Unique identifier for the tax rate in the accounting platform. + // Unique identifier for the tax rate in the accounting software. ID *string `json:"id,omitempty"` - // Name of the tax rate in the accounting platform. + // Name of the tax rate in the accounting software. Name *string `json:"name,omitempty"` } @@ -83,6 +83,10 @@ func (o *TaxRateReference) GetName() *string { type BillCreditNoteLineItem struct { // 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. AccountRef *AccountRef `json:"accountRef,omitempty"` + // Links the current record line to the underlying record line that created it. + // + // For example, if a bill is generated from a purchase order, this property allows you to connect the bill line item to the purchase order line item in our data model. + CreatedFromLineRef *Zero `json:"createdFromLineRef,omitempty"` // Friendly name of each line item. For example, the goods or service for which credit has been received. Description *string `json:"description,omitempty"` // Value of any discounts applied. @@ -118,6 +122,8 @@ type BillCreditNoteLineItem struct { TrackingCategoryRefs []TrackingCategoryRef `json:"trackingCategoryRefs,omitempty"` // Unit price of the goods or service. UnitAmount *decimal.Big `decimal:"number" json:"unitAmount"` + // The measurement which defines a unit for this item (e.g. 'kilogram', 'litre'). + UnitOfMeasurement *string `json:"unitOfMeasurement,omitempty"` } func (b BillCreditNoteLineItem) MarshalJSON() ([]byte, error) { @@ -138,6 +144,13 @@ func (o *BillCreditNoteLineItem) GetAccountRef() *AccountRef { return o.AccountRef } +func (o *BillCreditNoteLineItem) GetCreatedFromLineRef() *Zero { + if o == nil { + return nil + } + return o.CreatedFromLineRef +} + func (o *BillCreditNoteLineItem) GetDescription() *string { if o == nil { return nil @@ -221,3 +234,10 @@ func (o *BillCreditNoteLineItem) GetUnitAmount() *decimal.Big { } return o.UnitAmount } + +func (o *BillCreditNoteLineItem) GetUnitOfMeasurement() *string { + if o == nil { + return nil + } + return o.UnitOfMeasurement +} diff --git a/lending/pkg/models/shared/billcreditnotestatus.go b/lending/pkg/models/shared/billcreditnotestatus.go index e7422d323..be3d21095 100644 --- a/lending/pkg/models/shared/billcreditnotestatus.go +++ b/lending/pkg/models/shared/billcreditnotestatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -22,7 +22,6 @@ const ( func (e BillCreditNoteStatus) ToPointer() *BillCreditNoteStatus { return &e } - func (e *BillCreditNoteStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/billedtotype.go b/lending/pkg/models/shared/billedtotype.go index 509b51398..53fd09666 100644 --- a/lending/pkg/models/shared/billedtotype.go +++ b/lending/pkg/models/shared/billedtotype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -20,7 +20,6 @@ const ( func (e BilledToType) ToPointer() *BilledToType { return &e } - func (e *BilledToType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/billedtotype1.go b/lending/pkg/models/shared/billedtotype1.go index 4075b5cda..55b27f6d2 100644 --- a/lending/pkg/models/shared/billedtotype1.go +++ b/lending/pkg/models/shared/billedtotype1.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e BilledToType1) ToPointer() *BilledToType1 { return &e } - func (e *BilledToType1) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/billlineitem.go b/lending/pkg/models/shared/billlineitem.go index 546fac673..4312eb987 100644 --- a/lending/pkg/models/shared/billlineitem.go +++ b/lending/pkg/models/shared/billlineitem.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -14,12 +14,12 @@ type BillLineItemDataType string const ( BillLineItemDataTypePurchaseOrders BillLineItemDataType = "purchaseOrders" + BillLineItemDataTypeBills BillLineItemDataType = "bills" ) func (e BillLineItemDataType) ToPointer() *BillLineItemDataType { return &e } - func (e *BillLineItemDataType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { @@ -27,6 +27,8 @@ func (e *BillLineItemDataType) UnmarshalJSON(data []byte) error { } switch v { case "purchaseOrders": + fallthrough + case "bills": *e = BillLineItemDataType(v) return nil default: diff --git a/lending/pkg/models/shared/billpaymentline.go b/lending/pkg/models/shared/billpaymentline.go index 482bf0fed..184da4714 100644 --- a/lending/pkg/models/shared/billpaymentline.go +++ b/lending/pkg/models/shared/billpaymentline.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/billpaymentlinelink.go b/lending/pkg/models/shared/billpaymentlinelink.go index 90525ebdf..bf5f48579 100644 --- a/lending/pkg/models/shared/billpaymentlinelink.go +++ b/lending/pkg/models/shared/billpaymentlinelink.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,9 +19,9 @@ type BillPaymentLineLink struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -44,7 +44,7 @@ type BillPaymentLineLink struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // Unique identifier of the transaction represented by the link. ID *string `json:"id,omitempty"` diff --git a/lending/pkg/models/shared/billpaymentlinelinktype.go b/lending/pkg/models/shared/billpaymentlinelinktype.go index 2ef2d431c..b642e2265 100644 --- a/lending/pkg/models/shared/billpaymentlinelinktype.go +++ b/lending/pkg/models/shared/billpaymentlinelinktype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -26,7 +26,6 @@ const ( func (e BillPaymentLineLinkType) ToPointer() *BillPaymentLineLinkType { return &e } - func (e *BillPaymentLineLinkType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/billstatus.go b/lending/pkg/models/shared/billstatus.go index 44af45412..7b5feb61f 100644 --- a/lending/pkg/models/shared/billstatus.go +++ b/lending/pkg/models/shared/billstatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -22,7 +22,6 @@ const ( func (e BillStatus) ToPointer() *BillStatus { return &e } - func (e *BillStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/cashflowstatement.go b/lending/pkg/models/shared/cashflowstatement.go index 42adf75f2..5d687a0a0 100644 --- a/lending/pkg/models/shared/cashflowstatement.go +++ b/lending/pkg/models/shared/cashflowstatement.go @@ -1,10 +1,10 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared type CashFlowStatement struct { - CashPayments *ReportLineInput `json:"cashPayments,omitempty"` - CashReceipts *ReportLineInput `json:"cashReceipts,omitempty"` + CashPayments *ReportLine `json:"cashPayments,omitempty"` + CashReceipts *ReportLine `json:"cashReceipts,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -47,14 +47,14 @@ type CashFlowStatement struct { ToDate *string `json:"toDate,omitempty"` } -func (o *CashFlowStatement) GetCashPayments() *ReportLineInput { +func (o *CashFlowStatement) GetCashPayments() *ReportLine { if o == nil { return nil } return o.CashPayments } -func (o *CashFlowStatement) GetCashReceipts() *ReportLineInput { +func (o *CashFlowStatement) GetCashReceipts() *ReportLine { if o == nil { return nil } diff --git a/lending/pkg/models/shared/clientratelimitreachedwebhook.go b/lending/pkg/models/shared/clientratelimitreachedwebhook.go index 80e4c8bdd..5e146f608 100644 --- a/lending/pkg/models/shared/clientratelimitreachedwebhook.go +++ b/lending/pkg/models/shared/clientratelimitreachedwebhook.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -11,9 +11,11 @@ type ClientRateLimitReachedWebhook struct { // Name of your client in Codat. ClientName *string `json:"ClientName,omitempty"` Data *ClientRateLimitReachedWebhookData `json:"Data,omitempty"` - // A human readable message about the webhook. + // A human-readable message about the webhook. Message *string `json:"Message,omitempty"` // Unique identifier for the rule. + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. RuleID *string `json:"RuleId,omitempty"` // The type of rule. RuleType *string `json:"RuleType,omitempty"` diff --git a/lending/pkg/models/shared/clientratelimitreachedwebhookdata.go b/lending/pkg/models/shared/clientratelimitreachedwebhookdata.go index c93fcdbd5..fdbf9b562 100644 --- a/lending/pkg/models/shared/clientratelimitreachedwebhookdata.go +++ b/lending/pkg/models/shared/clientratelimitreachedwebhookdata.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/clientratelimitresetwebhook.go b/lending/pkg/models/shared/clientratelimitresetwebhook.go index 6590a2378..84fdbc67b 100644 --- a/lending/pkg/models/shared/clientratelimitresetwebhook.go +++ b/lending/pkg/models/shared/clientratelimitresetwebhook.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -11,9 +11,11 @@ type ClientRateLimitResetWebhook struct { // Name of your client in Codat. ClientName *string `json:"ClientName,omitempty"` Data *ClientRateLimitResetWebhookData `json:"Data,omitempty"` - // A human readable message about the webhook. + // A human-readable message about the webhook. Message *string `json:"Message,omitempty"` // Unique identifier for the rule. + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. RuleID *string `json:"RuleId,omitempty"` // The type of rule. RuleType *string `json:"RuleType,omitempty"` diff --git a/lending/pkg/models/shared/clientratelimitresetwebhookdata.go b/lending/pkg/models/shared/clientratelimitresetwebhookdata.go index ed8df8957..bd5fe0580 100644 --- a/lending/pkg/models/shared/clientratelimitresetwebhookdata.go +++ b/lending/pkg/models/shared/clientratelimitresetwebhookdata.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -25,7 +25,7 @@ type ClientRateLimitResetWebhookData struct { // > Not all dates from Codat will contain information about time zones. // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. ExpiresUtc *string `json:"ExpiresUtc,omitempty"` - // Total number of request remaining for your client. + // Total number of requests remaining for your client. QuotaRemaining *int64 `json:"QuotaRemaining,omitempty"` // The reason for your rate limit quota being reset. ResetReason *string `json:"ResetReason,omitempty"` diff --git a/lending/pkg/models/shared/clientratelimitwebhook.go b/lending/pkg/models/shared/clientratelimitwebhook.go new file mode 100644 index 000000000..5dfc990df --- /dev/null +++ b/lending/pkg/models/shared/clientratelimitwebhook.go @@ -0,0 +1,59 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +type ClientRateLimitWebhook struct { + // The type of event. + EventType *string `json:"eventType,omitempty"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + GeneratedDate *string `json:"generatedDate,omitempty"` + // Unique identifier of the event. + ID *string `json:"id,omitempty"` + Payload *ClientRateLimitWebhookPayload `json:"payload,omitempty"` +} + +func (o *ClientRateLimitWebhook) GetEventType() *string { + if o == nil { + return nil + } + return o.EventType +} + +func (o *ClientRateLimitWebhook) GetGeneratedDate() *string { + if o == nil { + return nil + } + return o.GeneratedDate +} + +func (o *ClientRateLimitWebhook) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *ClientRateLimitWebhook) GetPayload() *ClientRateLimitWebhookPayload { + if o == nil { + return nil + } + return o.Payload +} diff --git a/lending/pkg/models/shared/clientratelimitwebhookpayload.go b/lending/pkg/models/shared/clientratelimitwebhookpayload.go new file mode 100644 index 000000000..eb9ed0b2e --- /dev/null +++ b/lending/pkg/models/shared/clientratelimitwebhookpayload.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +type ClientRateLimitWebhookPayload struct { + // The number of available requests per day. + DailyQuota *int64 `json:"dailyQuota,omitempty"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + ExpiryDate *string `json:"expiryDate,omitempty"` + // Total number of requests remaining for your client. + QuotaRemaining *int64 `json:"quotaRemaining,omitempty"` +} + +func (o *ClientRateLimitWebhookPayload) GetDailyQuota() *int64 { + if o == nil { + return nil + } + return o.DailyQuota +} + +func (o *ClientRateLimitWebhookPayload) GetExpiryDate() *string { + if o == nil { + return nil + } + return o.ExpiryDate +} + +func (o *ClientRateLimitWebhookPayload) GetQuotaRemaining() *int64 { + if o == nil { + return nil + } + return o.QuotaRemaining +} diff --git a/lending/pkg/models/shared/codatfile.go b/lending/pkg/models/shared/codatfile.go index c8b6ca1b2..6ba85d709 100644 --- a/lending/pkg/models/shared/codatfile.go +++ b/lending/pkg/models/shared/codatfile.go @@ -1,15 +1,16 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared type CodatFile struct { - Content []byte `multipartForm:"content"` + // This field accepts []byte data or io.Reader implementations, such as *os.File. + Content any `multipartForm:"content"` FileName string `multipartForm:"name=fileName"` } -func (o *CodatFile) GetContent() []byte { +func (o *CodatFile) GetContent() any { if o == nil { - return []byte{} + return nil } return o.Content } diff --git a/lending/pkg/models/shared/commerceaddress.go b/lending/pkg/models/shared/commerceaddress.go index 0482b0f65..7360215aa 100644 --- a/lending/pkg/models/shared/commerceaddress.go +++ b/lending/pkg/models/shared/commerceaddress.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commerceaddresstype.go b/lending/pkg/models/shared/commerceaddresstype.go index f338f5ea7..7d4c0bf05 100644 --- a/lending/pkg/models/shared/commerceaddresstype.go +++ b/lending/pkg/models/shared/commerceaddresstype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -21,7 +21,6 @@ const ( func (e CommerceAddressType) ToPointer() *CommerceAddressType { return &e } - func (e *CommerceAddressType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/commercecompanyinfo.go b/lending/pkg/models/shared/commercecompanyinfo.go index 04eb08178..28edd93f9 100644 --- a/lending/pkg/models/shared/commercecompanyinfo.go +++ b/lending/pkg/models/shared/commercecompanyinfo.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,7 @@ type CommerceCompanyInfo struct { // // There are only a very small number of edge cases where this currency code is returned by the Codat system. BaseCurrency *string `json:"baseCurrency,omitempty"` - // Identifier or reference for the company in the commerce platform + // Identifier or reference for the company in the commerce software CommercePlatformRef *string `json:"commercePlatformRef,omitempty"` // The full legal name of the company CompanyLegalName *string `json:"companyLegalName,omitempty"` diff --git a/lending/pkg/models/shared/commercecustomer.go b/lending/pkg/models/shared/commercecustomer.go index 8163ab1db..16ff504ea 100644 --- a/lending/pkg/models/shared/commercecustomer.go +++ b/lending/pkg/models/shared/commercecustomer.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commercecustomerref.go b/lending/pkg/models/shared/commercecustomerref.go index 88f4eb694..0d6249192 100644 --- a/lending/pkg/models/shared/commercecustomerref.go +++ b/lending/pkg/models/shared/commercecustomerref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commercecustomers.go b/lending/pkg/models/shared/commercecustomers.go index 925f584b2..060cfb078 100644 --- a/lending/pkg/models/shared/commercecustomers.go +++ b/lending/pkg/models/shared/commercecustomers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commercedispute.go b/lending/pkg/models/shared/commercedispute.go index b444ff221..197bab37d 100644 --- a/lending/pkg/models/shared/commercedispute.go +++ b/lending/pkg/models/shared/commercedispute.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -70,7 +70,7 @@ type CommerceDispute struct { // Current status of the dispute Status *DisputeStatus `json:"status,omitempty"` // Total transaction amount that is under dispute. - TotalAmount interface{} `json:"totalAmount,omitempty"` + TotalAmount any `json:"totalAmount,omitempty"` } func (o *CommerceDispute) GetCreatedDate() *string { @@ -136,7 +136,7 @@ func (o *CommerceDispute) GetStatus() *DisputeStatus { return o.Status } -func (o *CommerceDispute) GetTotalAmount() interface{} { +func (o *CommerceDispute) GetTotalAmount() any { if o == nil { return nil } diff --git a/lending/pkg/models/shared/commercedisputes.go b/lending/pkg/models/shared/commercedisputes.go index 150b495df..0bf5825d4 100644 --- a/lending/pkg/models/shared/commercedisputes.go +++ b/lending/pkg/models/shared/commercedisputes.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commercelocation.go b/lending/pkg/models/shared/commercelocation.go index 7a7178702..b2bf721da 100644 --- a/lending/pkg/models/shared/commercelocation.go +++ b/lending/pkg/models/shared/commercelocation.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commercelocations.go b/lending/pkg/models/shared/commercelocations.go index 3f86798b1..0b2b13ca6 100644 --- a/lending/pkg/models/shared/commercelocations.go +++ b/lending/pkg/models/shared/commercelocations.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commerceorder.go b/lending/pkg/models/shared/commerceorder.go index b5ae78e41..12a3b58b6 100644 --- a/lending/pkg/models/shared/commerceorder.go +++ b/lending/pkg/models/shared/commerceorder.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -73,7 +73,7 @@ type CommerceOrder struct { SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Total amount of the order, including discounts, refunds, and tax, but excluding gratuities. TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` diff --git a/lending/pkg/models/shared/commerceorders.go b/lending/pkg/models/shared/commerceorders.go index e2c30c690..f5ba18c23 100644 --- a/lending/pkg/models/shared/commerceorders.go +++ b/lending/pkg/models/shared/commerceorders.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commercepayment.go b/lending/pkg/models/shared/commercepayment.go index ac7211221..9d6e8ba18 100644 --- a/lending/pkg/models/shared/commercepayment.go +++ b/lending/pkg/models/shared/commercepayment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -68,7 +68,7 @@ type CommercePayment struct { // A unique, persistent identifier for this record ID string `json:"id"` ModifiedDate *string `json:"modifiedDate,omitempty"` - // The payment method the record is linked to in the accounting or commerce platform. + // The payment method the record is linked to in the accounting or commerce software. PaymentMethodRef *PaymentMethodRef `json:"paymentMethodRef,omitempty"` // Service provider of the payment, if applicable. PaymentProvider *string `json:"paymentProvider,omitempty"` @@ -77,7 +77,7 @@ type CommercePayment struct { Status *PaymentStatus `json:"status,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` } diff --git a/lending/pkg/models/shared/commercepaymentmethod.go b/lending/pkg/models/shared/commercepaymentmethod.go index 28a52349b..ba7d1d3ae 100644 --- a/lending/pkg/models/shared/commercepaymentmethod.go +++ b/lending/pkg/models/shared/commercepaymentmethod.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e CommercePaymentMethodStatus) ToPointer() *CommercePaymentMethodStatus { return &e } - func (e *CommercePaymentMethodStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/commercepaymentmethods.go b/lending/pkg/models/shared/commercepaymentmethods.go index 66241e48d..7736a0382 100644 --- a/lending/pkg/models/shared/commercepaymentmethods.go +++ b/lending/pkg/models/shared/commercepaymentmethods.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commercepayments.go b/lending/pkg/models/shared/commercepayments.go index 46848f1b1..10ef816d7 100644 --- a/lending/pkg/models/shared/commercepayments.go +++ b/lending/pkg/models/shared/commercepayments.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commerceproduct.go b/lending/pkg/models/shared/commerceproduct.go index e37e71ae7..8ed10c38c 100644 --- a/lending/pkg/models/shared/commerceproduct.go +++ b/lending/pkg/models/shared/commerceproduct.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -20,7 +20,7 @@ type CommerceProduct struct { Name *string `json:"name,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` Variants []ProductVariant `json:"variants,omitempty"` } diff --git a/lending/pkg/models/shared/commerceproductcategories.go b/lending/pkg/models/shared/commerceproductcategories.go index c9a01e33d..2f5639e4c 100644 --- a/lending/pkg/models/shared/commerceproductcategories.go +++ b/lending/pkg/models/shared/commerceproductcategories.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commerceproductcategory.go b/lending/pkg/models/shared/commerceproductcategory.go index 958cfd985..075b12b41 100644 --- a/lending/pkg/models/shared/commerceproductcategory.go +++ b/lending/pkg/models/shared/commerceproductcategory.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commerceproducts.go b/lending/pkg/models/shared/commerceproducts.go index be5c15333..87f2c7cfe 100644 --- a/lending/pkg/models/shared/commerceproducts.go +++ b/lending/pkg/models/shared/commerceproducts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commercerecordref.go b/lending/pkg/models/shared/commercerecordref.go index fd583612f..de703f141 100644 --- a/lending/pkg/models/shared/commercerecordref.go +++ b/lending/pkg/models/shared/commercerecordref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commercereport.go b/lending/pkg/models/shared/commercereport.go index 45db0d649..251db10ea 100644 --- a/lending/pkg/models/shared/commercereport.go +++ b/lending/pkg/models/shared/commercereport.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commercereportcomponent.go b/lending/pkg/models/shared/commercereportcomponent.go index 51ba16310..95d4cdda7 100644 --- a/lending/pkg/models/shared/commercereportcomponent.go +++ b/lending/pkg/models/shared/commercereportcomponent.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commercereportdimension.go b/lending/pkg/models/shared/commercereportdimension.go index 0927517f6..f4fdc92f9 100644 --- a/lending/pkg/models/shared/commercereportdimension.go +++ b/lending/pkg/models/shared/commercereportdimension.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commercereporterror.go b/lending/pkg/models/shared/commercereporterror.go index fb76da986..e6c766c5a 100644 --- a/lending/pkg/models/shared/commercereporterror.go +++ b/lending/pkg/models/shared/commercereporterror.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commercereportmeasure.go b/lending/pkg/models/shared/commercereportmeasure.go index 6485b3ee8..6f233e4ba 100644 --- a/lending/pkg/models/shared/commercereportmeasure.go +++ b/lending/pkg/models/shared/commercereportmeasure.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/commercetransaction.go b/lending/pkg/models/shared/commercetransaction.go index 594a217c7..5b4eb501e 100644 --- a/lending/pkg/models/shared/commercetransaction.go +++ b/lending/pkg/models/shared/commercetransaction.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -70,11 +70,11 @@ type CommerceTransaction struct { // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. SourceCreatedDate *string `json:"sourceCreatedDate,omitempty"` SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` - // Non-standardised transaction type data from the commerce platform + // Non-standardised transaction type data from the commerce software SubType *string `json:"subType,omitempty"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // The total transaction amount TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` diff --git a/lending/pkg/models/shared/commercetransactions.go b/lending/pkg/models/shared/commercetransactions.go index 315fea2c1..0789c67e2 100644 --- a/lending/pkg/models/shared/commercetransactions.go +++ b/lending/pkg/models/shared/commercetransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/companies.go b/lending/pkg/models/shared/companies.go index 5a5574be6..2776b0604 100644 --- a/lending/pkg/models/shared/companies.go +++ b/lending/pkg/models/shared/companies.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/company.go b/lending/pkg/models/shared/company.go index c027f4b80..ea774ec3f 100644 --- a/lending/pkg/models/shared/company.go +++ b/lending/pkg/models/shared/company.go @@ -1,17 +1,9 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared -type GroupReference struct { - // Unique identifier for the group. - ID *string `json:"id,omitempty"` -} - -func (o *GroupReference) GetID() *string { - if o == nil { - return nil - } - return o.ID +// Tags - A collection of user-defined key-value pairs that store custom metadata against the company. +type Tags struct { } // Company - In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/lending-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. @@ -45,8 +37,6 @@ type Company struct { DataConnections []Connection `json:"dataConnections,omitempty"` // Additional information about the company. This can be used to store foreign IDs, references, etc. Description *string `json:"description,omitempty"` - // An array of groups the company has been assigned to. - Groups []GroupReference `json:"groups,omitempty"` // Unique identifier for your SMB in Codat. ID string `json:"id"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: @@ -71,12 +61,10 @@ type Company struct { LastSync *string `json:"lastSync,omitempty"` // The name of the company Name string `json:"name"` - // `platformKeys` name used when creating the company. - // - // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - Platform *string `json:"platform,omitempty"` // 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. Redirect string `json:"redirect"` + // A collection of user-defined key-value pairs that store custom metadata against the company. + Tags *Tags `json:"tags,omitempty"` } func (o *Company) GetCreated() *string { @@ -107,13 +95,6 @@ func (o *Company) GetDescription() *string { return o.Description } -func (o *Company) GetGroups() []GroupReference { - if o == nil { - return nil - } - return o.Groups -} - func (o *Company) GetID() string { if o == nil { return "" @@ -135,16 +116,16 @@ func (o *Company) GetName() string { return o.Name } -func (o *Company) GetPlatform() *string { +func (o *Company) GetRedirect() string { if o == nil { - return nil + return "" } - return o.Platform + return o.Redirect } -func (o *Company) GetRedirect() string { +func (o *Company) GetTags() *Tags { if o == nil { - return "" + return nil } - return o.Redirect + return o.Tags } diff --git a/lending/pkg/models/shared/companyrequestbody.go b/lending/pkg/models/shared/companyrequestbody.go index b16534c27..01191107d 100644 --- a/lending/pkg/models/shared/companyrequestbody.go +++ b/lending/pkg/models/shared/companyrequestbody.go @@ -1,12 +1,24 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared +type GroupReference struct { + // Unique identifier for the group. + ID *string `json:"id,omitempty"` +} + +func (o *GroupReference) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + type CompanyRequestBody struct { // Additional information about the company. This can be used to store foreign IDs, references, etc. Description *string `json:"description,omitempty"` // Reference to the groups that the company is assigned to. - Groups []Items `json:"groups,omitempty"` + Groups []GroupReference `json:"groups,omitempty"` // Name of company being connected. Name string `json:"name"` } @@ -18,7 +30,7 @@ func (o *CompanyRequestBody) GetDescription() *string { return o.Description } -func (o *CompanyRequestBody) GetGroups() []Items { +func (o *CompanyRequestBody) GetGroups() []GroupReference { if o == nil { return nil } diff --git a/lending/pkg/models/shared/connection.go b/lending/pkg/models/shared/connection.go index f929e33ae..ab31ca986 100644 --- a/lending/pkg/models/shared/connection.go +++ b/lending/pkg/models/shared/connection.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -23,7 +23,6 @@ const ( func (e SourceType) ToPointer() *SourceType { return &e } - func (e *SourceType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { @@ -61,7 +60,7 @@ func (e *SourceType) UnmarshalJSON(data []byte) error { // // 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). type Connection struct { - AdditionalProperties interface{} `json:"additionalProperties,omitempty"` + AdditionalProperties any `json:"additionalProperties,omitempty"` ConnectionInfo map[string]string `json:"connectionInfo,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // @@ -122,7 +121,7 @@ type Connection struct { Status DataConnectionStatus `json:"status"` } -func (o *Connection) GetAdditionalProperties() interface{} { +func (o *Connection) GetAdditionalProperties() any { if o == nil { return nil } diff --git a/lending/pkg/models/shared/connections.go b/lending/pkg/models/shared/connections.go index 24ae6e665..e20874757 100644 --- a/lending/pkg/models/shared/connections.go +++ b/lending/pkg/models/shared/connections.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/contact.go b/lending/pkg/models/shared/contact.go index 0f25ad87b..816734361 100644 --- a/lending/pkg/models/shared/contact.go +++ b/lending/pkg/models/shared/contact.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/contactref.go b/lending/pkg/models/shared/contactref.go index 37e14cc2b..cd1ca222f 100644 --- a/lending/pkg/models/shared/contactref.go +++ b/lending/pkg/models/shared/contactref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -18,7 +18,6 @@ const ( func (e ContactRefDataType) ToPointer() *ContactRefDataType { return &e } - func (e *ContactRefDataType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { @@ -35,7 +34,6 @@ func (e *ContactRefDataType) UnmarshalJSON(data []byte) error { } } -// ContactRef - A customer or supplier associated with the direct cost. type ContactRef struct { // Allowed name of the 'dataType'. DataType *ContactRefDataType `json:"dataType,omitempty"` diff --git a/lending/pkg/models/shared/createbankaccounttransaction.go b/lending/pkg/models/shared/createbankaccounttransaction.go index 4e4acb2db..cbb3e4163 100644 --- a/lending/pkg/models/shared/createbankaccounttransaction.go +++ b/lending/pkg/models/shared/createbankaccounttransaction.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -34,7 +34,7 @@ type CreateBankAccountTransaction struct { Date *string `json:"date,omitempty"` // Description of the bank transaction. Description *string `json:"description,omitempty"` - // Identifier for the bank account transaction, unique for the company in the accounting platform. + // Identifier for the bank account transaction, unique for the company in the accounting software. ID *string `json:"id,omitempty"` } diff --git a/lending/pkg/models/shared/creditnotelineitem.go b/lending/pkg/models/shared/creditnotelineitem.go index 52a1153b4..eface4dfe 100644 --- a/lending/pkg/models/shared/creditnotelineitem.go +++ b/lending/pkg/models/shared/creditnotelineitem.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/creditnotestatus.go b/lending/pkg/models/shared/creditnotestatus.go index c38d43c80..c6c9026b1 100644 --- a/lending/pkg/models/shared/creditnotestatus.go +++ b/lending/pkg/models/shared/creditnotestatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -22,7 +22,6 @@ const ( func (e CreditNoteStatus) ToPointer() *CreditNoteStatus { return &e } - func (e *CreditNoteStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/customerstatus.go b/lending/pkg/models/shared/customerstatus.go index 1d5c0e8ef..d399ae91c 100644 --- a/lending/pkg/models/shared/customerstatus.go +++ b/lending/pkg/models/shared/customerstatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e CustomerStatus) ToPointer() *CustomerStatus { return &e } - func (e *CustomerStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/dataconnectionerror.go b/lending/pkg/models/shared/dataconnectionerror.go index 757486ba3..2bbff7093 100644 --- a/lending/pkg/models/shared/dataconnectionerror.go +++ b/lending/pkg/models/shared/dataconnectionerror.go @@ -1,9 +1,41 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared +import ( + "encoding/json" + "fmt" +) + +// ErrorStatus - The current status of a transient error. Null statuses indicate that the error is not transient. +type ErrorStatus string + +const ( + ErrorStatusActive ErrorStatus = "Active" + ErrorStatusResolved ErrorStatus = "Resolved" +) + +func (e ErrorStatus) ToPointer() *ErrorStatus { + return &e +} +func (e *ErrorStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "Active": + fallthrough + case "Resolved": + *e = ErrorStatus(v) + return nil + default: + return fmt.Errorf("invalid value for ErrorStatus: %v", v) + } +} + type DataConnectionError struct { - // A brief message about the error. + // A message about a error returned by Codat. ErrorMessage *string `json:"errorMessage,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // @@ -25,9 +57,31 @@ type DataConnectionError struct { // > Not all dates from Codat will contain information about time zones. // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. ErroredOnUtc *string `json:"erroredOnUtc,omitempty"` - // The HTTP status code returned by the error. + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + ResolvedOnUtc *string `json:"resolvedOnUtc,omitempty"` + // The current status of a transient error. Null statuses indicate that the error is not transient. + Status *ErrorStatus `json:"status,omitempty"` + // The HTTP status code returned by the source platform when the error occurred. StatusCode *string `json:"statusCode,omitempty"` - // A non-numeric status code/text. + // A non-numeric status code/text returned by the source platform when the error occurred. StatusText *string `json:"statusText,omitempty"` } @@ -45,6 +99,20 @@ func (o *DataConnectionError) GetErroredOnUtc() *string { return o.ErroredOnUtc } +func (o *DataConnectionError) GetResolvedOnUtc() *string { + if o == nil { + return nil + } + return o.ResolvedOnUtc +} + +func (o *DataConnectionError) GetStatus() *ErrorStatus { + if o == nil { + return nil + } + return o.Status +} + func (o *DataConnectionError) GetStatusCode() *string { if o == nil { return nil diff --git a/lending/pkg/models/shared/dataconnectionstatus.go b/lending/pkg/models/shared/dataconnectionstatus.go index ec5254876..f7e281bc9 100644 --- a/lending/pkg/models/shared/dataconnectionstatus.go +++ b/lending/pkg/models/shared/dataconnectionstatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -20,7 +20,6 @@ const ( func (e DataConnectionStatus) ToPointer() *DataConnectionStatus { return &e } - func (e *DataConnectionStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/dataintegrityamounts.go b/lending/pkg/models/shared/dataintegrityamounts.go index a6776bc3e..0af2ffeca 100644 --- a/lending/pkg/models/shared/dataintegrityamounts.go +++ b/lending/pkg/models/shared/dataintegrityamounts.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/dataintegritybyamount.go b/lending/pkg/models/shared/dataintegritybyamount.go index 5ce37a7bc..6f0969c27 100644 --- a/lending/pkg/models/shared/dataintegritybyamount.go +++ b/lending/pkg/models/shared/dataintegritybyamount.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/dataintegritybycount.go b/lending/pkg/models/shared/dataintegritybycount.go index ef62bf460..6a57df366 100644 --- a/lending/pkg/models/shared/dataintegritybycount.go +++ b/lending/pkg/models/shared/dataintegritybycount.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/dataintegrityconnectionid.go b/lending/pkg/models/shared/dataintegrityconnectionid.go index ff2a879ab..7d3f876ea 100644 --- a/lending/pkg/models/shared/dataintegrityconnectionid.go +++ b/lending/pkg/models/shared/dataintegrityconnectionid.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/dataintegritydatatype.go b/lending/pkg/models/shared/dataintegritydatatype.go index 3314abaae..6f6a9ec4e 100644 --- a/lending/pkg/models/shared/dataintegritydatatype.go +++ b/lending/pkg/models/shared/dataintegritydatatype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e DataIntegrityDataType) ToPointer() *DataIntegrityDataType { return &e } - func (e *DataIntegrityDataType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/dataintegritydates.go b/lending/pkg/models/shared/dataintegritydates.go index 56b726769..579569973 100644 --- a/lending/pkg/models/shared/dataintegritydates.go +++ b/lending/pkg/models/shared/dataintegritydates.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/dataintegritydetail.go b/lending/pkg/models/shared/dataintegritydetail.go index d4a9e7f85..7ef40f228 100644 --- a/lending/pkg/models/shared/dataintegritydetail.go +++ b/lending/pkg/models/shared/dataintegritydetail.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/dataintegritydetails.go b/lending/pkg/models/shared/dataintegritydetails.go index 32a25069f..43b3b8714 100644 --- a/lending/pkg/models/shared/dataintegritydetails.go +++ b/lending/pkg/models/shared/dataintegritydetails.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/dataintegritymatch.go b/lending/pkg/models/shared/dataintegritymatch.go index 0b4e19062..bb560f67b 100644 --- a/lending/pkg/models/shared/dataintegritymatch.go +++ b/lending/pkg/models/shared/dataintegritymatch.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/dataintegritystatus.go b/lending/pkg/models/shared/dataintegritystatus.go index 4f26e93a9..c323e74d3 100644 --- a/lending/pkg/models/shared/dataintegritystatus.go +++ b/lending/pkg/models/shared/dataintegritystatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/dataintegritystatuses.go b/lending/pkg/models/shared/dataintegritystatuses.go index c137d5c1b..173c545c0 100644 --- a/lending/pkg/models/shared/dataintegritystatuses.go +++ b/lending/pkg/models/shared/dataintegritystatuses.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/dataintegritystatusinfo.go b/lending/pkg/models/shared/dataintegritystatusinfo.go index 2b32a052e..25a205e7d 100644 --- a/lending/pkg/models/shared/dataintegritystatusinfo.go +++ b/lending/pkg/models/shared/dataintegritystatusinfo.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/dataintegritysummaries.go b/lending/pkg/models/shared/dataintegritysummaries.go index 6e9501f59..050db62ee 100644 --- a/lending/pkg/models/shared/dataintegritysummaries.go +++ b/lending/pkg/models/shared/dataintegritysummaries.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/dataintegritysummary.go b/lending/pkg/models/shared/dataintegritysummary.go index 32ed5b2a1..c03360127 100644 --- a/lending/pkg/models/shared/dataintegritysummary.go +++ b/lending/pkg/models/shared/dataintegritysummary.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/datasource.go b/lending/pkg/models/shared/datasource.go index 69936e3e4..7a4d463df 100644 --- a/lending/pkg/models/shared/datasource.go +++ b/lending/pkg/models/shared/datasource.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/datastatus.go b/lending/pkg/models/shared/datastatus.go index 8fe5aa5fe..83281553c 100644 --- a/lending/pkg/models/shared/datastatus.go +++ b/lending/pkg/models/shared/datastatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -7,7 +7,7 @@ import ( "fmt" ) -// DataTypes - Available Data types +// DataTypes - Available data types type DataTypes string const ( @@ -59,7 +59,6 @@ const ( func (e DataTypes) ToPointer() *DataTypes { return &e } - func (e *DataTypes) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { @@ -160,9 +159,9 @@ func (e *DataTypes) UnmarshalJSON(data []byte) error { // DataStatus - Describes the state of data in the Codat cache for a company and data type type DataStatus struct { - // The current status of the dataset in Codat's cache. - CurrentStatus string `json:"currentStatus"` - // Available Data types + // The current status of the dataset. + CurrentStatus Status `json:"currentStatus"` + // Available data types DataType DataTypes `json:"dataType"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // @@ -190,9 +189,9 @@ type DataStatus struct { LatestSyncID *string `json:"latestSyncId,omitempty"` } -func (o *DataStatus) GetCurrentStatus() string { +func (o *DataStatus) GetCurrentStatus() Status { if o == nil { - return "" + return Status("") } return o.CurrentStatus } diff --git a/lending/pkg/models/shared/datatype.go b/lending/pkg/models/shared/datatype.go index 33d80c2cb..1d26b3108 100644 --- a/lending/pkg/models/shared/datatype.go +++ b/lending/pkg/models/shared/datatype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -7,7 +7,7 @@ import ( "fmt" ) -// DataType - Available Data types +// DataType - Available data types type DataType string const ( @@ -59,7 +59,6 @@ const ( func (e DataType) ToPointer() *DataType { return &e } - func (e *DataType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/directcostlineitem.go b/lending/pkg/models/shared/directcostlineitem.go index d2106dee2..7fe3b19fb 100644 --- a/lending/pkg/models/shared/directcostlineitem.go +++ b/lending/pkg/models/shared/directcostlineitem.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/directcostprototype.go b/lending/pkg/models/shared/directcostprototype.go index 747d860d7..805c87650 100644 --- a/lending/pkg/models/shared/directcostprototype.go +++ b/lending/pkg/models/shared/directcostprototype.go @@ -1,67 +1,14 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared import ( - "encoding/json" - "fmt" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "github.com/ericlagergren/decimal" ) -// DirectCostPrototypeDataType - Allowed name of the 'dataType'. -type DirectCostPrototypeDataType string - -const ( - DirectCostPrototypeDataTypeCustomers DirectCostPrototypeDataType = "customers" - DirectCostPrototypeDataTypeSuppliers DirectCostPrototypeDataType = "suppliers" -) - -func (e DirectCostPrototypeDataType) ToPointer() *DirectCostPrototypeDataType { - return &e -} - -func (e *DirectCostPrototypeDataType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "customers": - fallthrough - case "suppliers": - *e = DirectCostPrototypeDataType(v) - return nil - default: - return fmt.Errorf("invalid value for DirectCostPrototypeDataType: %v", v) - } -} - -// ContactReference - A customer or supplier associated with the direct cost. -type ContactReference struct { - // Allowed name of the 'dataType'. - DataType *DirectCostPrototypeDataType `json:"dataType,omitempty"` - // Unique identifier for a customer or supplier. - ID string `json:"id"` -} - -func (o *ContactReference) GetDataType() *DirectCostPrototypeDataType { - if o == nil { - return nil - } - return o.DataType -} - -func (o *ContactReference) GetID() string { - if o == nil { - return "" - } - return o.ID -} - type DirectCostPrototype struct { - // A customer or supplier associated with the direct cost. - ContactRef *ContactReference `json:"contactRef,omitempty"` + ContactRef *ContactRef `json:"contactRef,omitempty"` // The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. // // ## Unknown currencies @@ -76,9 +23,9 @@ type DirectCostPrototype struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -101,7 +48,7 @@ type DirectCostPrototype struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // @@ -135,7 +82,7 @@ type DirectCostPrototype struct { SubTotal *decimal.Big `decimal:"number" json:"subTotal"` // 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/supplemental-data/overview) about supplemental data. + // It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // The total amount of tax on the direct costs. TaxAmount *decimal.Big `decimal:"number" json:"taxAmount"` @@ -154,7 +101,7 @@ func (d *DirectCostPrototype) UnmarshalJSON(data []byte) error { return nil } -func (o *DirectCostPrototype) GetContactRef() *ContactReference { +func (o *DirectCostPrototype) GetContactRef() *ContactRef { if o == nil { return nil } diff --git a/lending/pkg/models/shared/directincomelineitem.go b/lending/pkg/models/shared/directincomelineitem.go index e9ac59d19..89a0120d0 100644 --- a/lending/pkg/models/shared/directincomelineitem.go +++ b/lending/pkg/models/shared/directincomelineitem.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/disputestatus.go b/lending/pkg/models/shared/disputestatus.go index 2c6d5ba55..8d624553a 100644 --- a/lending/pkg/models/shared/disputestatus.go +++ b/lending/pkg/models/shared/disputestatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -27,7 +27,6 @@ const ( func (e DisputeStatus) ToPointer() *DisputeStatus { return &e } - func (e *DisputeStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/enduploadsessionrequest.go b/lending/pkg/models/shared/enduploadsessionrequest.go new file mode 100644 index 000000000..e9560beb1 --- /dev/null +++ b/lending/pkg/models/shared/enduploadsessionrequest.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +// EndUploadSessionRequestStatus - An indicator to cancel the dataset processing or trigger ingestion and enrichment of data. +type EndUploadSessionRequestStatus string + +const ( + EndUploadSessionRequestStatusCancel EndUploadSessionRequestStatus = "Cancel" + EndUploadSessionRequestStatusProcess EndUploadSessionRequestStatus = "Process" +) + +func (e EndUploadSessionRequestStatus) ToPointer() *EndUploadSessionRequestStatus { + return &e +} +func (e *EndUploadSessionRequestStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "Cancel": + fallthrough + case "Process": + *e = EndUploadSessionRequestStatus(v) + return nil + default: + return fmt.Errorf("invalid value for EndUploadSessionRequestStatus: %v", v) + } +} + +type EndUploadSessionRequest struct { + // An indicator to cancel the dataset processing or trigger ingestion and enrichment of data. + Status *EndUploadSessionRequestStatus `json:"status,omitempty"` +} + +func (o *EndUploadSessionRequest) GetStatus() *EndUploadSessionRequestStatus { + if o == nil { + return nil + } + return o.Status +} diff --git a/lending/pkg/models/shared/enhancedcashflowitem.go b/lending/pkg/models/shared/enhancedcashflowitem.go index 4647ee2e0..dfe1447ba 100644 --- a/lending/pkg/models/shared/enhancedcashflowitem.go +++ b/lending/pkg/models/shared/enhancedcashflowitem.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/enhancedcashflowtransaction.go b/lending/pkg/models/shared/enhancedcashflowtransaction.go index 35ccc0b58..bf18c8193 100644 --- a/lending/pkg/models/shared/enhancedcashflowtransaction.go +++ b/lending/pkg/models/shared/enhancedcashflowtransaction.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -12,6 +12,8 @@ type EnhancedCashFlowTransaction struct { AccountRef *AccountRef `json:"accountRef,omitempty"` // The bank transaction amount. Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` + // An array of counterparty names involved in the transaction. + CounterpartyNames []string `json:"counterpartyNames,omitempty"` // The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. // // ## Unknown currencies @@ -44,6 +46,26 @@ type EnhancedCashFlowTransaction struct { Description *string `json:"description,omitempty"` // The unique identifier of the bank transaction. ID *string `json:"id,omitempty"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + ModifiedDate *string `json:"modifiedDate,omitempty"` // Returns the payment processor responsible for the transaction. PlatformName *string `json:"platformName,omitempty"` // A source reference containing the `sourceType` object "Banking". @@ -76,6 +98,13 @@ func (o *EnhancedCashFlowTransaction) GetAmount() *decimal.Big { return o.Amount } +func (o *EnhancedCashFlowTransaction) GetCounterpartyNames() []string { + if o == nil { + return nil + } + return o.CounterpartyNames +} + func (o *EnhancedCashFlowTransaction) GetCurrency() *string { if o == nil { return nil @@ -104,6 +133,13 @@ func (o *EnhancedCashFlowTransaction) GetID() *string { return o.ID } +func (o *EnhancedCashFlowTransaction) GetModifiedDate() *string { + if o == nil { + return nil + } + return o.ModifiedDate +} + func (o *EnhancedCashFlowTransaction) GetPlatformName() *string { if o == nil { return nil diff --git a/lending/pkg/models/shared/enhancedcashflowtransactions.go b/lending/pkg/models/shared/enhancedcashflowtransactions.go index 07c95f2d4..392f5889e 100644 --- a/lending/pkg/models/shared/enhancedcashflowtransactions.go +++ b/lending/pkg/models/shared/enhancedcashflowtransactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/enhancedfinancialreport.go b/lending/pkg/models/shared/enhancedfinancialreport.go index 0bbe2e8df..a677da181 100644 --- a/lending/pkg/models/shared/enhancedfinancialreport.go +++ b/lending/pkg/models/shared/enhancedfinancialreport.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/enhancedinvoicereportitem.go b/lending/pkg/models/shared/enhancedinvoicereportitem.go index 640bcbf4a..78c25949f 100644 --- a/lending/pkg/models/shared/enhancedinvoicereportitem.go +++ b/lending/pkg/models/shared/enhancedinvoicereportitem.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -39,7 +39,7 @@ type EnhancedInvoiceReportItem struct { // > Not all dates from Codat will contain information about time zones. // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. DueDate *string `json:"dueDate,omitempty"` - // ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. + // ID of the invoice, which may be a GUID but it may be something else depending on the accounting software. ID *string `json:"id,omitempty"` // Invoice number. InvoiceNumber *string `json:"invoiceNumber,omitempty"` diff --git a/lending/pkg/models/shared/enhancedinvoicesreport.go b/lending/pkg/models/shared/enhancedinvoicesreport.go index 6f75a5e39..9242f6396 100644 --- a/lending/pkg/models/shared/enhancedinvoicesreport.go +++ b/lending/pkg/models/shared/enhancedinvoicesreport.go @@ -1,8 +1,8 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared -// EnhancedInvoicesReport - The enhanced invoices report takes the key elements of the Invoices report verifying those marked as paid in the accounting platform have actually been paid by matching with the bank statement. +// EnhancedInvoicesReport - The enhanced invoices report takes the key elements of the Invoices report verifying those marked as paid in the accounting software have actually been paid by matching with the bank statement. type EnhancedInvoicesReport struct { // Report additional information, which is specific to Lending API reports. ReportInfo *ReportInfo `json:"reportInfo,omitempty"` diff --git a/lending/pkg/models/shared/enhancedreportaccountcategory.go b/lending/pkg/models/shared/enhancedreportaccountcategory.go index 5e7984242..0b4ccc704 100644 --- a/lending/pkg/models/shared/enhancedreportaccountcategory.go +++ b/lending/pkg/models/shared/enhancedreportaccountcategory.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/enhancedreportinfo.go b/lending/pkg/models/shared/enhancedreportinfo.go index b98456d5d..7dd11f995 100644 --- a/lending/pkg/models/shared/enhancedreportinfo.go +++ b/lending/pkg/models/shared/enhancedreportinfo.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/errorvalidation.go b/lending/pkg/models/shared/errorvalidation.go index 89c18c7fc..3f12091c8 100644 --- a/lending/pkg/models/shared/errorvalidation.go +++ b/lending/pkg/models/shared/errorvalidation.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/errorvalidationitem.go b/lending/pkg/models/shared/errorvalidationitem.go index 9a3c1252f..b97f640eb 100644 --- a/lending/pkg/models/shared/errorvalidationitem.go +++ b/lending/pkg/models/shared/errorvalidationitem.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/excelreporttypes.go b/lending/pkg/models/shared/excelreporttypes.go index 2da58921e..83371b2fe 100644 --- a/lending/pkg/models/shared/excelreporttypes.go +++ b/lending/pkg/models/shared/excelreporttypes.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -20,7 +20,6 @@ const ( func (e ExcelReportTypes) ToPointer() *ExcelReportTypes { return &e } - func (e *ExcelReportTypes) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/excelstatus.go b/lending/pkg/models/shared/excelstatus.go index 2a5c1b26b..ab2865e68 100644 --- a/lending/pkg/models/shared/excelstatus.go +++ b/lending/pkg/models/shared/excelstatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/file.go b/lending/pkg/models/shared/file.go index 1153f1703..e6ff1175a 100644 --- a/lending/pkg/models/shared/file.go +++ b/lending/pkg/models/shared/file.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/fileupload.go b/lending/pkg/models/shared/fileupload.go index ea0c35b80..992edf06f 100644 --- a/lending/pkg/models/shared/fileupload.go +++ b/lending/pkg/models/shared/fileupload.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/halref.go b/lending/pkg/models/shared/halref.go index 06ee18c03..f7b86c830 100644 --- a/lending/pkg/models/shared/halref.go +++ b/lending/pkg/models/shared/halref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/integritystatus.go b/lending/pkg/models/shared/integritystatus.go index 12d37126a..538147b96 100644 --- a/lending/pkg/models/shared/integritystatus.go +++ b/lending/pkg/models/shared/integritystatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -20,7 +20,6 @@ const ( func (e IntegrityStatus) ToPointer() *IntegrityStatus { return &e } - func (e *IntegrityStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/invoicelineitem.go b/lending/pkg/models/shared/invoicelineitem.go index 75992450b..fb0fb4bd4 100644 --- a/lending/pkg/models/shared/invoicelineitem.go +++ b/lending/pkg/models/shared/invoicelineitem.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/invoicestatus.go b/lending/pkg/models/shared/invoicestatus.go index 8cfe8e3ab..179d0595a 100644 --- a/lending/pkg/models/shared/invoicestatus.go +++ b/lending/pkg/models/shared/invoicestatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -28,7 +28,6 @@ const ( func (e InvoiceStatus) ToPointer() *InvoiceStatus { return &e } - func (e *InvoiceStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/itemref.go b/lending/pkg/models/shared/itemref.go index ea97bd6ec..eeca54b1c 100644 --- a/lending/pkg/models/shared/itemref.go +++ b/lending/pkg/models/shared/itemref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/items.go b/lending/pkg/models/shared/items.go index 347f72f2e..645c243f5 100644 --- a/lending/pkg/models/shared/items.go +++ b/lending/pkg/models/shared/items.go @@ -1,15 +1,40 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared +import ( + "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" + "github.com/ericlagergren/decimal" +) + type Items struct { - // Unique identifier for the group. - ID *string `json:"id,omitempty"` + // Amount of tax withheld. + Amount *decimal.Big `decimal:"number" json:"amount"` + // Name assigned to withheld tax. + Name string `json:"name"` +} + +func (i Items) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *Items) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Items) GetAmount() *decimal.Big { + if o == nil { + return new(decimal.Big).SetFloat64(0.0) + } + return o.Amount } -func (o *Items) GetID() *string { +func (o *Items) GetName() string { if o == nil { - return nil + return "" } - return o.ID + return o.Name } diff --git a/lending/pkg/models/shared/journalentryrecordref.go b/lending/pkg/models/shared/journalentryrecordref.go index 06db221ac..f6d9b9688 100644 --- a/lending/pkg/models/shared/journalentryrecordref.go +++ b/lending/pkg/models/shared/journalentryrecordref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -27,7 +27,6 @@ const ( func (e JournalEntryRecordRefDataType) ToPointer() *JournalEntryRecordRefDataType { return &e } - func (e *JournalEntryRecordRefDataType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/journalline.go b/lending/pkg/models/shared/journalline.go index 7299352fc..0d310e32f 100644 --- a/lending/pkg/models/shared/journalline.go +++ b/lending/pkg/models/shared/journalline.go @@ -1,12 +1,62 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared import ( + "encoding/json" + "fmt" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "github.com/ericlagergren/decimal" ) +// JournalLineDataType - Allowed name of the 'dataType'. +type JournalLineDataType string + +const ( + JournalLineDataTypeCustomers JournalLineDataType = "customers" + JournalLineDataTypeSuppliers JournalLineDataType = "suppliers" +) + +func (e JournalLineDataType) ToPointer() *JournalLineDataType { + return &e +} +func (e *JournalLineDataType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "customers": + fallthrough + case "suppliers": + *e = JournalLineDataType(v) + return nil + default: + return fmt.Errorf("invalid value for JournalLineDataType: %v", v) + } +} + +type ContactReference struct { + // Allowed name of the 'dataType'. + DataType *JournalLineDataType `json:"dataType,omitempty"` + // Unique identifier for a customer or supplier. + ID string `json:"id"` +} + +func (o *ContactReference) GetDataType() *JournalLineDataType { + if o == nil { + return nil + } + return o.DataType +} + +func (o *ContactReference) GetID() string { + if o == nil { + return "" + } + return o.ID +} + // JournalLineTracking - List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.) type JournalLineTracking struct { RecordRefs []TrackingRecordRef `json:"recordRefs,omitempty"` @@ -21,7 +71,8 @@ func (o *JournalLineTracking) GetRecordRefs() []TrackingRecordRef { type JournalLine struct { // 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. - AccountRef *AccountRef `json:"accountRef,omitempty"` + AccountRef *AccountRef `json:"accountRef,omitempty"` + ContactRef *ContactReference `json:"contactRef,omitempty"` // Currency for the journal line item. Currency *string `json:"currency,omitempty"` // Description of the journal line item. @@ -50,6 +101,13 @@ func (o *JournalLine) GetAccountRef() *AccountRef { return o.AccountRef } +func (o *JournalLine) GetContactRef() *ContactReference { + if o == nil { + return nil + } + return o.ContactRef +} + func (o *JournalLine) GetCurrency() *string { if o == nil { return nil diff --git a/lending/pkg/models/shared/journalref.go b/lending/pkg/models/shared/journalref.go index e1c67bf37..bed9f332b 100644 --- a/lending/pkg/models/shared/journalref.go +++ b/lending/pkg/models/shared/journalref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/journalstatus.go b/lending/pkg/models/shared/journalstatus.go index d612b6fd8..a7176c05a 100644 --- a/lending/pkg/models/shared/journalstatus.go +++ b/lending/pkg/models/shared/journalstatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e JournalStatus) ToPointer() *JournalStatus { return &e } - func (e *JournalStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/lendingcustomerref.go b/lending/pkg/models/shared/lendingcustomerref.go index 8e87bf925..adfeb5407 100644 --- a/lending/pkg/models/shared/lendingcustomerref.go +++ b/lending/pkg/models/shared/lendingcustomerref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/links.go b/lending/pkg/models/shared/links.go index df8dac300..9feb26261 100644 --- a/lending/pkg/models/shared/links.go +++ b/lending/pkg/models/shared/links.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/loanref.go b/lending/pkg/models/shared/loanref.go index 2434d91f5..e1883a652 100644 --- a/lending/pkg/models/shared/loanref.go +++ b/lending/pkg/models/shared/loanref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/loansummary.go b/lending/pkg/models/shared/loansummary.go index 6ef999daf..19f1b5f8f 100644 --- a/lending/pkg/models/shared/loansummary.go +++ b/lending/pkg/models/shared/loansummary.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/loansummaryintegrationtype.go b/lending/pkg/models/shared/loansummaryintegrationtype.go index b3b6f58a7..7d3b651ce 100644 --- a/lending/pkg/models/shared/loansummaryintegrationtype.go +++ b/lending/pkg/models/shared/loansummaryintegrationtype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e LoanSummaryIntegrationType) ToPointer() *LoanSummaryIntegrationType { return &e } - func (e *LoanSummaryIntegrationType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/loansummaryrecordref.go b/lending/pkg/models/shared/loansummaryrecordref.go index de9aca630..3d9c02062 100644 --- a/lending/pkg/models/shared/loansummaryrecordref.go +++ b/lending/pkg/models/shared/loansummaryrecordref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/loansummaryrecordreftype.go b/lending/pkg/models/shared/loansummaryrecordreftype.go index 623e7bae7..66b5d07cd 100644 --- a/lending/pkg/models/shared/loansummaryrecordreftype.go +++ b/lending/pkg/models/shared/loansummaryrecordreftype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e LoanSummaryRecordRefType) ToPointer() *LoanSummaryRecordRefType { return &e } - func (e *LoanSummaryRecordRefType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/loansummaryreportinfo.go b/lending/pkg/models/shared/loansummaryreportinfo.go index 4857973db..43a824fd4 100644 --- a/lending/pkg/models/shared/loansummaryreportinfo.go +++ b/lending/pkg/models/shared/loansummaryreportinfo.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/loansummaryreportitem.go b/lending/pkg/models/shared/loansummaryreportitem.go index b1c4d5357..c47964aac 100644 --- a/lending/pkg/models/shared/loansummaryreportitem.go +++ b/lending/pkg/models/shared/loansummaryreportitem.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -13,8 +13,8 @@ type LoanSummaryReportItem struct { // The description of the object being referred to. E.g. the account. Description *string `json:"description,omitempty"` // The name of lender providing the loan. - LenderName *string `json:"lenderName,omitempty"` - RecordRef *LoanSummaryRecordRef `json:"recordRef,omitempty"` + Lender *string `json:"lender,omitempty"` + RecordRef *LoanSummaryRecordRef `json:"recordRef,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -66,11 +66,11 @@ func (o *LoanSummaryReportItem) GetDescription() *string { return o.Description } -func (o *LoanSummaryReportItem) GetLenderName() *string { +func (o *LoanSummaryReportItem) GetLender() *string { if o == nil { return nil } - return o.LenderName + return o.Lender } func (o *LoanSummaryReportItem) GetRecordRef() *LoanSummaryRecordRef { diff --git a/lending/pkg/models/shared/loantransactions.go b/lending/pkg/models/shared/loantransactions.go index 5c25db9f6..3c76cc547 100644 --- a/lending/pkg/models/shared/loantransactions.go +++ b/lending/pkg/models/shared/loantransactions.go @@ -1,16 +1,16 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared type LoanTransactions struct { // If there are no errors, an empty array is returned. - Errors []interface{} `json:"errors,omitempty"` + Errors []any `json:"errors,omitempty"` ReportInfo *LoanTransactionsReportInfo `json:"reportInfo,omitempty"` // Contains object of reporting properties. The loan ref will reference a different object depending on the integration type. ReportItems []ReportItems `json:"reportItems,omitempty"` } -func (o *LoanTransactions) GetErrors() []interface{} { +func (o *LoanTransactions) GetErrors() []any { if o == nil { return nil } diff --git a/lending/pkg/models/shared/loantransactionsreportinfo.go b/lending/pkg/models/shared/loantransactionsreportinfo.go index 92733d4cd..a441b8a6b 100644 --- a/lending/pkg/models/shared/loantransactionsreportinfo.go +++ b/lending/pkg/models/shared/loantransactionsreportinfo.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/locationref.go b/lending/pkg/models/shared/locationref.go index 8fea0331f..b7f782559 100644 --- a/lending/pkg/models/shared/locationref.go +++ b/lending/pkg/models/shared/locationref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/metadata.go b/lending/pkg/models/shared/metadata.go index 85a209bbb..851caf39d 100644 --- a/lending/pkg/models/shared/metadata.go +++ b/lending/pkg/models/shared/metadata.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/orderdiscountallocation.go b/lending/pkg/models/shared/orderdiscountallocation.go index d364834e8..ec6b77267 100644 --- a/lending/pkg/models/shared/orderdiscountallocation.go +++ b/lending/pkg/models/shared/orderdiscountallocation.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/orderlineitem.go b/lending/pkg/models/shared/orderlineitem.go index 37847ad9e..550e4de16 100644 --- a/lending/pkg/models/shared/orderlineitem.go +++ b/lending/pkg/models/shared/orderlineitem.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/path.go b/lending/pkg/models/shared/path.go new file mode 100644 index 000000000..dd524ffd6 --- /dev/null +++ b/lending/pkg/models/shared/path.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +type Path string + +const ( + PathAuthGet Path = "auth/get" +) + +func (e Path) ToPointer() *Path { + return &e +} +func (e *Path) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "auth/get": + *e = Path(v) + return nil + default: + return fmt.Errorf("invalid value for Path: %v", v) + } +} diff --git a/lending/pkg/models/shared/payment.go b/lending/pkg/models/shared/payment.go index 5cc818f0b..b9c8511a8 100644 --- a/lending/pkg/models/shared/payment.go +++ b/lending/pkg/models/shared/payment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -25,9 +25,9 @@ type Payment struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -50,7 +50,7 @@ type Payment struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // @@ -72,7 +72,7 @@ type Payment struct { // > Not all dates from Codat will contain information about time zones. // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. Date *string `json:"date,omitempty"` - // ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. + // ID of the invoice, which may be a GUID but it may be something else depending on the accounting software. ID *string `json:"id,omitempty"` // The type of payment. PaymentType *string `json:"paymentType,omitempty"` diff --git a/lending/pkg/models/shared/paymentallocationpayment.go b/lending/pkg/models/shared/paymentallocationpayment.go index 5b042a89c..97cecc2d5 100644 --- a/lending/pkg/models/shared/paymentallocationpayment.go +++ b/lending/pkg/models/shared/paymentallocationpayment.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -24,9 +24,9 @@ type PaymentAllocationPayment struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -49,7 +49,7 @@ type PaymentAllocationPayment struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // Identifier of the allocated payment. ID *string `json:"id,omitempty"` diff --git a/lending/pkg/models/shared/paymentline.go b/lending/pkg/models/shared/paymentline.go index 9fc2291f0..f094a8613 100644 --- a/lending/pkg/models/shared/paymentline.go +++ b/lending/pkg/models/shared/paymentline.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/paymentlinelink.go b/lending/pkg/models/shared/paymentlinelink.go index 8268f528e..29ed542cf 100644 --- a/lending/pkg/models/shared/paymentlinelink.go +++ b/lending/pkg/models/shared/paymentlinelink.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -18,9 +18,9 @@ type PaymentLineLink struct { // // 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). + // Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). // - // For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + // For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. // // ## Examples with base currency of GBP // @@ -43,7 +43,7 @@ type PaymentLineLink struct { // // | Integration | Scenario | System behavior | // |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| - // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + // | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // Unique identifier of the transaction represented by the link. ID *string `json:"id,omitempty"` diff --git a/lending/pkg/models/shared/paymentlinktype.go b/lending/pkg/models/shared/paymentlinktype.go index 1149c6a11..6e35d51c9 100644 --- a/lending/pkg/models/shared/paymentlinktype.go +++ b/lending/pkg/models/shared/paymentlinktype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -36,7 +36,6 @@ const ( func (e PaymentLinkType) ToPointer() *PaymentLinkType { return &e } - func (e *PaymentLinkType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/paymentmethodref.go b/lending/pkg/models/shared/paymentmethodref.go index a1694da7f..beee5a811 100644 --- a/lending/pkg/models/shared/paymentmethodref.go +++ b/lending/pkg/models/shared/paymentmethodref.go @@ -1,8 +1,8 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared -// PaymentMethodRef - The payment method the record is linked to in the accounting or commerce platform. +// PaymentMethodRef - The payment method the record is linked to in the accounting or commerce software. type PaymentMethodRef struct { // The unique identifier of the location being referenced. ID string `json:"id"` diff --git a/lending/pkg/models/shared/paymentref.go b/lending/pkg/models/shared/paymentref.go index ac9d6c527..b488fafc9 100644 --- a/lending/pkg/models/shared/paymentref.go +++ b/lending/pkg/models/shared/paymentref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/paymentstatus.go b/lending/pkg/models/shared/paymentstatus.go index 726a47a47..4b8f3e952 100644 --- a/lending/pkg/models/shared/paymentstatus.go +++ b/lending/pkg/models/shared/paymentstatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -22,7 +22,6 @@ const ( func (e PaymentStatus) ToPointer() *PaymentStatus { return &e } - func (e *PaymentStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/paymenttype.go b/lending/pkg/models/shared/paymenttype.go index 8edccc260..18bd7c7a7 100644 --- a/lending/pkg/models/shared/paymenttype.go +++ b/lending/pkg/models/shared/paymenttype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -28,7 +28,6 @@ const ( func (e PaymentType) ToPointer() *PaymentType { return &e } - func (e *PaymentType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/periodunit.go b/lending/pkg/models/shared/periodunit.go index 46628180b..3b15198fc 100644 --- a/lending/pkg/models/shared/periodunit.go +++ b/lending/pkg/models/shared/periodunit.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e PeriodUnit) ToPointer() *PeriodUnit { return &e } - func (e *PeriodUnit) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/phonenumber.go b/lending/pkg/models/shared/phonenumber.go index 8261c383a..104ad252b 100644 --- a/lending/pkg/models/shared/phonenumber.go +++ b/lending/pkg/models/shared/phonenumber.go @@ -1,10 +1,10 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared type PhoneNumber struct { // A phone number. - Number *string `json:"number"` + Number *string `json:"number,omitempty"` // The type of phone number Type PhoneNumberType `json:"type"` } diff --git a/lending/pkg/models/shared/phonenumbertype.go b/lending/pkg/models/shared/phonenumbertype.go index 650172b3f..f9ed3f44c 100644 --- a/lending/pkg/models/shared/phonenumbertype.go +++ b/lending/pkg/models/shared/phonenumbertype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -21,7 +21,6 @@ const ( func (e PhoneNumberType) ToPointer() *PhoneNumberType { return &e } - func (e *PhoneNumberType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/productinventory.go b/lending/pkg/models/shared/productinventory.go index 85c7a87a0..a6b7baa36 100644 --- a/lending/pkg/models/shared/productinventory.go +++ b/lending/pkg/models/shared/productinventory.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/productinventorylocation.go b/lending/pkg/models/shared/productinventorylocation.go index 4e74f1644..3b3cfaad4 100644 --- a/lending/pkg/models/shared/productinventorylocation.go +++ b/lending/pkg/models/shared/productinventorylocation.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/productprice.go b/lending/pkg/models/shared/productprice.go index 0f59121fd..30310d0b8 100644 --- a/lending/pkg/models/shared/productprice.go +++ b/lending/pkg/models/shared/productprice.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/productref.go b/lending/pkg/models/shared/productref.go index 70f60eb92..f483a62c6 100644 --- a/lending/pkg/models/shared/productref.go +++ b/lending/pkg/models/shared/productref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/productvariant.go b/lending/pkg/models/shared/productvariant.go index bd53a7bc0..d58a1b76b 100644 --- a/lending/pkg/models/shared/productvariant.go +++ b/lending/pkg/models/shared/productvariant.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/productvariantref.go b/lending/pkg/models/shared/productvariantref.go index 6ad5d1940..4bdb4d953 100644 --- a/lending/pkg/models/shared/productvariantref.go +++ b/lending/pkg/models/shared/productvariantref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/productvariantstatus.go b/lending/pkg/models/shared/productvariantstatus.go index 9c2be05c1..bfedfa228 100644 --- a/lending/pkg/models/shared/productvariantstatus.go +++ b/lending/pkg/models/shared/productvariantstatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e ProductVariantStatus) ToPointer() *ProductVariantStatus { return &e } - func (e *ProductVariantStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/profitandlossreport.go b/lending/pkg/models/shared/profitandlossreport.go index c79e52af1..ca03bf26e 100644 --- a/lending/pkg/models/shared/profitandlossreport.go +++ b/lending/pkg/models/shared/profitandlossreport.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -8,8 +8,8 @@ import ( ) type ProfitAndLossReport struct { - CostOfSales *ReportLineInput `json:"costOfSales,omitempty"` - Expenses *ReportLineInput `json:"expenses,omitempty"` + CostOfSales *ReportLine `json:"costOfSales,omitempty"` + Expenses *ReportLine `json:"expenses,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -31,16 +31,16 @@ type ProfitAndLossReport struct { // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. FromDate *string `json:"fromDate,omitempty"` // Gross profit of the company in the given date range. - GrossProfit *decimal.Big `decimal:"number" json:"grossProfit"` - Income *ReportLineInput `json:"income,omitempty"` + GrossProfit *decimal.Big `decimal:"number" json:"grossProfit"` + Income *ReportLine `json:"income,omitempty"` // Net operating profit of the company in the given date range. NetOperatingProfit *decimal.Big `decimal:"number" json:"netOperatingProfit"` // Net other income of the company in the given date range. NetOtherIncome *decimal.Big `decimal:"number" json:"netOtherIncome"` // Net profit of the company in the given date range. - NetProfit *decimal.Big `decimal:"number" json:"netProfit"` - OtherExpenses *ReportLineInput `json:"otherExpenses,omitempty"` - OtherIncome *ReportLineInput `json:"otherIncome,omitempty"` + NetProfit *decimal.Big `decimal:"number" json:"netProfit"` + OtherExpenses *ReportLine `json:"otherExpenses,omitempty"` + OtherIncome *ReportLine `json:"otherIncome,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -74,14 +74,14 @@ func (p *ProfitAndLossReport) UnmarshalJSON(data []byte) error { return nil } -func (o *ProfitAndLossReport) GetCostOfSales() *ReportLineInput { +func (o *ProfitAndLossReport) GetCostOfSales() *ReportLine { if o == nil { return nil } return o.CostOfSales } -func (o *ProfitAndLossReport) GetExpenses() *ReportLineInput { +func (o *ProfitAndLossReport) GetExpenses() *ReportLine { if o == nil { return nil } @@ -102,7 +102,7 @@ func (o *ProfitAndLossReport) GetGrossProfit() *decimal.Big { return o.GrossProfit } -func (o *ProfitAndLossReport) GetIncome() *ReportLineInput { +func (o *ProfitAndLossReport) GetIncome() *ReportLine { if o == nil { return nil } @@ -130,14 +130,14 @@ func (o *ProfitAndLossReport) GetNetProfit() *decimal.Big { return o.NetProfit } -func (o *ProfitAndLossReport) GetOtherExpenses() *ReportLineInput { +func (o *ProfitAndLossReport) GetOtherExpenses() *ReportLine { if o == nil { return nil } return o.OtherExpenses } -func (o *ProfitAndLossReport) GetOtherIncome() *ReportLineInput { +func (o *ProfitAndLossReport) GetOtherIncome() *ReportLine { if o == nil { return nil } diff --git a/lending/pkg/models/shared/projectref.go b/lending/pkg/models/shared/projectref.go index 49695e1e8..9f2c1e524 100644 --- a/lending/pkg/models/shared/projectref.go +++ b/lending/pkg/models/shared/projectref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/propertieitemref.go b/lending/pkg/models/shared/propertieitemref.go index aae7f5221..f98ae19ef 100644 --- a/lending/pkg/models/shared/propertieitemref.go +++ b/lending/pkg/models/shared/propertieitemref.go @@ -1,12 +1,12 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared // PropertieItemRef - Reference to the item the line is linked to. type PropertieItemRef struct { - // Unique identifier for the item in the accounting platform. + // Unique identifier for the item in the accounting software. ID string `json:"id"` - // Name of the item in the accounting platform. + // Name of the item in the accounting software. Name *string `json:"name,omitempty"` } diff --git a/lending/pkg/models/shared/pulloperation.go b/lending/pkg/models/shared/pulloperation.go index 44b956d89..052fbc10a 100644 --- a/lending/pkg/models/shared/pulloperation.go +++ b/lending/pkg/models/shared/pulloperation.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -7,40 +7,37 @@ import ( "fmt" ) -// PullOperationStatus - The current status of the pull operation. -type PullOperationStatus string +// DatasetStatus - The current status of the dataset. +type DatasetStatus string const ( - PullOperationStatusInitial PullOperationStatus = "Initial" - PullOperationStatusQueued PullOperationStatus = "Queued" - PullOperationStatusFetching PullOperationStatus = "Fetching" - PullOperationStatusMapQueued PullOperationStatus = "MapQueued" - PullOperationStatusMapping PullOperationStatus = "Mapping" - PullOperationStatusComplete PullOperationStatus = "Complete" - PullOperationStatusFetchError PullOperationStatus = "FetchError" - PullOperationStatusMapError PullOperationStatus = "MapError" - PullOperationStatusInternalError PullOperationStatus = "InternalError" - PullOperationStatusProcessingQueued PullOperationStatus = "ProcessingQueued" - PullOperationStatusProcessing PullOperationStatus = "Processing" - PullOperationStatusProcessingError PullOperationStatus = "ProcessingError" - PullOperationStatusValidationQueued PullOperationStatus = "ValidationQueued" - PullOperationStatusValidating PullOperationStatus = "Validating" - PullOperationStatusValidationError PullOperationStatus = "ValidationError" - PullOperationStatusAuthError PullOperationStatus = "AuthError" - PullOperationStatusCancelled PullOperationStatus = "Cancelled" - PullOperationStatusRouting PullOperationStatus = "Routing" - PullOperationStatusRoutingError PullOperationStatus = "RoutingError" - PullOperationStatusNotSupported PullOperationStatus = "NotSupported" - PullOperationStatusRateLimitError PullOperationStatus = "RateLimitError" - PullOperationStatusPermissionsError PullOperationStatus = "PermissionsError" - PullOperationStatusPrerequisiteNotMet PullOperationStatus = "PrerequisiteNotMet" + DatasetStatusInitial DatasetStatus = "Initial" + DatasetStatusQueued DatasetStatus = "Queued" + DatasetStatusFetching DatasetStatus = "Fetching" + DatasetStatusMapQueued DatasetStatus = "MapQueued" + DatasetStatusMapping DatasetStatus = "Mapping" + DatasetStatusComplete DatasetStatus = "Complete" + DatasetStatusFetchError DatasetStatus = "FetchError" + DatasetStatusMapError DatasetStatus = "MapError" + DatasetStatusInternalError DatasetStatus = "InternalError" + DatasetStatusProcessingQueued DatasetStatus = "ProcessingQueued" + DatasetStatusProcessing DatasetStatus = "Processing" + DatasetStatusProcessingError DatasetStatus = "ProcessingError" + DatasetStatusValidationQueued DatasetStatus = "ValidationQueued" + DatasetStatusValidating DatasetStatus = "Validating" + DatasetStatusValidationError DatasetStatus = "ValidationError" + DatasetStatusAuthError DatasetStatus = "AuthError" + DatasetStatusCancelled DatasetStatus = "Cancelled" + DatasetStatusNotSupported DatasetStatus = "NotSupported" + DatasetStatusRateLimitError DatasetStatus = "RateLimitError" + DatasetStatusPermissionsError DatasetStatus = "PermissionsError" + DatasetStatusPrerequisiteNotMet DatasetStatus = "PrerequisiteNotMet" ) -func (e PullOperationStatus) ToPointer() *PullOperationStatus { +func (e DatasetStatus) ToPointer() *DatasetStatus { return &e } - -func (e *PullOperationStatus) UnmarshalJSON(data []byte) error { +func (e *DatasetStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err @@ -80,10 +77,6 @@ func (e *PullOperationStatus) UnmarshalJSON(data []byte) error { fallthrough case "Cancelled": fallthrough - case "Routing": - fallthrough - case "RoutingError": - fallthrough case "NotSupported": fallthrough case "RateLimitError": @@ -91,10 +84,10 @@ func (e *PullOperationStatus) UnmarshalJSON(data []byte) error { case "PermissionsError": fallthrough case "PrerequisiteNotMet": - *e = PullOperationStatus(v) + *e = DatasetStatus(v) return nil default: - return fmt.Errorf("invalid value for PullOperationStatus: %v", v) + return fmt.Errorf("invalid value for DatasetStatus: %v", v) } } @@ -127,7 +120,7 @@ type PullOperation struct { ConnectionID string `json:"connectionId"` // The data type you are requesting in a pull operation. DataType string `json:"dataType"` - // A message about a transient or persistent error. + // A message about a transient or persistent error returned by Codat or the source platform. ErrorMessage *string `json:"errorMessage,omitempty"` // Unique identifier of the pull operation. ID string `json:"id"` @@ -157,8 +150,8 @@ type PullOperation struct { // > Not all dates from Codat will contain information about time zones. // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. Requested string `json:"requested"` - // The current status of the pull operation. - Status PullOperationStatus `json:"status"` + // The current status of the dataset. + Status DatasetStatus `json:"status"` // Additional information about the dataset status. StatusDescription *string `json:"statusDescription,omitempty"` } @@ -233,9 +226,9 @@ func (o *PullOperation) GetRequested() string { return o.Requested } -func (o *PullOperation) GetStatus() PullOperationStatus { +func (o *PullOperation) GetStatus() DatasetStatus { if o == nil { - return PullOperationStatus("") + return DatasetStatus("") } return o.Status } diff --git a/lending/pkg/models/shared/pulloperations.go b/lending/pkg/models/shared/pulloperations.go index 36591729b..279571670 100644 --- a/lending/pkg/models/shared/pulloperations.go +++ b/lending/pkg/models/shared/pulloperations.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/pushchangetype.go b/lending/pkg/models/shared/pushchangetype.go index af522940e..d7a3d7a69 100644 --- a/lending/pkg/models/shared/pushchangetype.go +++ b/lending/pkg/models/shared/pushchangetype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -21,7 +21,6 @@ const ( func (e PushChangeType) ToPointer() *PushChangeType { return &e } - func (e *PushChangeType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/pushfieldvalidation.go b/lending/pkg/models/shared/pushfieldvalidation.go index bfe6460d6..02899cb77 100644 --- a/lending/pkg/models/shared/pushfieldvalidation.go +++ b/lending/pkg/models/shared/pushfieldvalidation.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/pushoperation.go b/lending/pkg/models/shared/pushoperation.go index b54e8efbb..fdb1a3ceb 100644 --- a/lending/pkg/models/shared/pushoperation.go +++ b/lending/pkg/models/shared/pushoperation.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -29,7 +29,7 @@ type PushOperation struct { CompletedOnUtc *string `json:"completedOnUtc,omitempty"` // Unique identifier for a company's data connection. DataConnectionKey string `json:"dataConnectionKey"` - // Available Data types + // Available data types DataType *DataType `json:"dataType,omitempty"` // A message about the error. ErrorMessage *string `json:"errorMessage,omitempty"` diff --git a/lending/pkg/models/shared/pushoperationchange.go b/lending/pkg/models/shared/pushoperationchange.go index 500f01617..f7471e9a3 100644 --- a/lending/pkg/models/shared/pushoperationchange.go +++ b/lending/pkg/models/shared/pushoperationchange.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/pushoperationref.go b/lending/pkg/models/shared/pushoperationref.go index 766073374..3e9ac25c0 100644 --- a/lending/pkg/models/shared/pushoperationref.go +++ b/lending/pkg/models/shared/pushoperationref.go @@ -1,9 +1,9 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared type PushOperationRef struct { - // Available Data types + // Available data types DataType *DataType `json:"dataType,omitempty"` // Unique identifier for a push operation. ID *string `json:"id,omitempty"` diff --git a/lending/pkg/models/shared/pushoperations.go b/lending/pkg/models/shared/pushoperations.go index 9d2ed7c86..23e30831d 100644 --- a/lending/pkg/models/shared/pushoperations.go +++ b/lending/pkg/models/shared/pushoperations.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/pushoperationstatus.go b/lending/pkg/models/shared/pushoperationstatus.go index a795bac79..2f7070a10 100644 --- a/lending/pkg/models/shared/pushoperationstatus.go +++ b/lending/pkg/models/shared/pushoperationstatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -20,7 +20,6 @@ const ( func (e PushOperationStatus) ToPointer() *PushOperationStatus { return &e } - func (e *PushOperationStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/pushoption.go b/lending/pkg/models/shared/pushoption.go index 39df89775..f0de79dcc 100644 --- a/lending/pkg/models/shared/pushoption.go +++ b/lending/pkg/models/shared/pushoption.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/pushoptionchoice.go b/lending/pkg/models/shared/pushoptionchoice.go index 0e5cffbd5..e36c2c799 100644 --- a/lending/pkg/models/shared/pushoptionchoice.go +++ b/lending/pkg/models/shared/pushoptionchoice.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/pushoptionproperty.go b/lending/pkg/models/shared/pushoptionproperty.go index 51f5137e9..fea745b1a 100644 --- a/lending/pkg/models/shared/pushoptionproperty.go +++ b/lending/pkg/models/shared/pushoptionproperty.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/pushoptiontype.go b/lending/pkg/models/shared/pushoptiontype.go index 799d12d4e..8049ad49a 100644 --- a/lending/pkg/models/shared/pushoptiontype.go +++ b/lending/pkg/models/shared/pushoptiontype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -24,7 +24,6 @@ const ( func (e PushOptionType) ToPointer() *PushOptionType { return &e } - func (e *PushOptionType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/pushvalidationinfo.go b/lending/pkg/models/shared/pushvalidationinfo.go index eb5756f08..c8f167d02 100644 --- a/lending/pkg/models/shared/pushvalidationinfo.go +++ b/lending/pkg/models/shared/pushvalidationinfo.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/recordref.go b/lending/pkg/models/shared/recordref.go index 1331fed6c..2f3ccea0c 100644 --- a/lending/pkg/models/shared/recordref.go +++ b/lending/pkg/models/shared/recordref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/reportbasis.go b/lending/pkg/models/shared/reportbasis.go index 57db57fe6..2e1008903 100644 --- a/lending/pkg/models/shared/reportbasis.go +++ b/lending/pkg/models/shared/reportbasis.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e ReportBasis) ToPointer() *ReportBasis { return &e } - func (e *ReportBasis) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/reportcomponentmeasure.go b/lending/pkg/models/shared/reportcomponentmeasure.go index 77e3e821b..795d6315c 100644 --- a/lending/pkg/models/shared/reportcomponentmeasure.go +++ b/lending/pkg/models/shared/reportcomponentmeasure.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/reportinfo.go b/lending/pkg/models/shared/reportinfo.go index 25dfea7db..14f13dcda 100644 --- a/lending/pkg/models/shared/reportinfo.go +++ b/lending/pkg/models/shared/reportinfo.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/reportinput.go b/lending/pkg/models/shared/reportinput.go index 4bbbb23b2..20c2be68b 100644 --- a/lending/pkg/models/shared/reportinput.go +++ b/lending/pkg/models/shared/reportinput.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e ReportInput) ToPointer() *ReportInput { return &e } - func (e *ReportInput) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/reportitems.go b/lending/pkg/models/shared/reportitems.go index 2cf1b8fe5..1018de85a 100644 --- a/lending/pkg/models/shared/reportitems.go +++ b/lending/pkg/models/shared/reportitems.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -22,7 +22,6 @@ const ( func (e LoanTransactionType) ToPointer() *LoanTransactionType { return &e } - func (e *LoanTransactionType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { @@ -68,8 +67,8 @@ type ReportItems struct { Date *string `json:"date,omitempty"` ItemRef *ItemRef `json:"itemRef,omitempty"` // The name of lender providing the loan. - LenderName *string `json:"lenderName,omitempty"` - LoanRef *LoanRef `json:"loanRef,omitempty"` + Lender *string `json:"lender,omitempty"` + LoanRef *LoanRef `json:"loanRef,omitempty"` // The type of loan transaction. LoanTransactionType *LoanTransactionType `json:"loanTransactionType,omitempty"` } @@ -106,11 +105,11 @@ func (o *ReportItems) GetItemRef() *ItemRef { return o.ItemRef } -func (o *ReportItems) GetLenderName() *string { +func (o *ReportItems) GetLender() *string { if o == nil { return nil } - return o.LenderName + return o.Lender } func (o *ReportItems) GetLoanRef() *LoanRef { diff --git a/lending/pkg/models/shared/reportline.go b/lending/pkg/models/shared/reportline.go index e9b6fe24f..310037fa3 100644 --- a/lending/pkg/models/shared/reportline.go +++ b/lending/pkg/models/shared/reportline.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -8,7 +8,7 @@ import ( ) type ReportLine struct { - // Identifier for the account, unique for the company in the accounting platform. + // Identifier for the account, unique for the company in the accounting software. AccountID *string `json:"accountId,omitempty"` // An array of ReportLine items. Items []ReportLine `json:"items,omitempty"` diff --git a/lending/pkg/models/shared/reportlineinput.go b/lending/pkg/models/shared/reportlineinput.go deleted file mode 100644 index c6b78e618..000000000 --- a/lending/pkg/models/shared/reportlineinput.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -import ( - "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" - "github.com/ericlagergren/decimal" -) - -type ReportLineInput struct { - // Identifier for the account, unique for the company in the accounting platform. - AccountID *string `json:"accountId,omitempty"` - // An array of ReportLine items. - Items []ReportLine `json:"items,omitempty"` - // Name of the report line item. - Name *string `json:"name,omitempty"` - // Numerical value of the line item. - Value *decimal.Big `decimal:"number" json:"value"` -} - -func (r ReportLineInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(r, "", false) -} - -func (r *ReportLineInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &r, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ReportLineInput) GetAccountID() *string { - if o == nil { - return nil - } - return o.AccountID -} - -func (o *ReportLineInput) GetItems() []ReportLine { - if o == nil { - return nil - } - return o.Items -} - -func (o *ReportLineInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *ReportLineInput) GetValue() *decimal.Big { - if o == nil { - return new(decimal.Big).SetFloat64(0.0) - } - return o.Value -} diff --git a/lending/pkg/models/shared/schemadatatype.go b/lending/pkg/models/shared/schemadatatype.go index 19e3d610a..8d4d8cb8c 100644 --- a/lending/pkg/models/shared/schemadatatype.go +++ b/lending/pkg/models/shared/schemadatatype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -7,7 +7,7 @@ import ( "fmt" ) -// SchemaDataType - Available Data types +// SchemaDataType - Available data types type SchemaDataType string const ( @@ -59,7 +59,6 @@ const ( func (e SchemaDataType) ToPointer() *SchemaDataType { return &e } - func (e *SchemaDataType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/security.go b/lending/pkg/models/shared/security.go index 5d91435a8..e1f80d158 100644 --- a/lending/pkg/models/shared/security.go +++ b/lending/pkg/models/shared/security.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/servicecharge.go b/lending/pkg/models/shared/servicecharge.go index e6c05cf38..527aac902 100644 --- a/lending/pkg/models/shared/servicecharge.go +++ b/lending/pkg/models/shared/servicecharge.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/servicechargetype.go b/lending/pkg/models/shared/servicechargetype.go index 7a3a240c3..377c3a681 100644 --- a/lending/pkg/models/shared/servicechargetype.go +++ b/lending/pkg/models/shared/servicechargetype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -20,7 +20,6 @@ const ( func (e ServiceChargeType) ToPointer() *ServiceChargeType { return &e } - func (e *ServiceChargeType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/sourceref.go b/lending/pkg/models/shared/sourceref.go index a9c467092..b0f3bda9f 100644 --- a/lending/pkg/models/shared/sourceref.go +++ b/lending/pkg/models/shared/sourceref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/startuploadsessionrequest.go b/lending/pkg/models/shared/startuploadsessionrequest.go new file mode 100644 index 000000000..add44fe2a --- /dev/null +++ b/lending/pkg/models/shared/startuploadsessionrequest.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +// StartUploadSessionRequestDataType - A key for a Codat data type. +type StartUploadSessionRequestDataType string + +const ( + StartUploadSessionRequestDataTypeBankingAccounts StartUploadSessionRequestDataType = "banking-accounts" + StartUploadSessionRequestDataTypeBankingTransactions StartUploadSessionRequestDataType = "banking-transactions" +) + +func (e StartUploadSessionRequestDataType) ToPointer() *StartUploadSessionRequestDataType { + return &e +} +func (e *StartUploadSessionRequestDataType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "banking-accounts": + fallthrough + case "banking-transactions": + *e = StartUploadSessionRequestDataType(v) + return nil + default: + return fmt.Errorf("invalid value for StartUploadSessionRequestDataType: %v", v) + } +} + +type StartUploadSessionRequest struct { + // A key for a Codat data type. + DataType *StartUploadSessionRequestDataType `json:"dataType,omitempty"` +} + +func (o *StartUploadSessionRequest) GetDataType() *StartUploadSessionRequestDataType { + if o == nil { + return nil + } + return o.DataType +} diff --git a/lending/pkg/models/shared/status.go b/lending/pkg/models/shared/status.go new file mode 100644 index 000000000..b3ce257f4 --- /dev/null +++ b/lending/pkg/models/shared/status.go @@ -0,0 +1,92 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +// Status - The current status of the dataset. +type Status string + +const ( + StatusInitial Status = "Initial" + StatusQueued Status = "Queued" + StatusFetching Status = "Fetching" + StatusMapQueued Status = "MapQueued" + StatusMapping Status = "Mapping" + StatusComplete Status = "Complete" + StatusFetchError Status = "FetchError" + StatusMapError Status = "MapError" + StatusInternalError Status = "InternalError" + StatusProcessingQueued Status = "ProcessingQueued" + StatusProcessing Status = "Processing" + StatusProcessingError Status = "ProcessingError" + StatusValidationQueued Status = "ValidationQueued" + StatusValidating Status = "Validating" + StatusValidationError Status = "ValidationError" + StatusAuthError Status = "AuthError" + StatusCancelled Status = "Cancelled" + StatusNotSupported Status = "NotSupported" + StatusRateLimitError Status = "RateLimitError" + StatusPermissionsError Status = "PermissionsError" + StatusPrerequisiteNotMet Status = "PrerequisiteNotMet" +) + +func (e Status) ToPointer() *Status { + return &e +} +func (e *Status) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "Initial": + fallthrough + case "Queued": + fallthrough + case "Fetching": + fallthrough + case "MapQueued": + fallthrough + case "Mapping": + fallthrough + case "Complete": + fallthrough + case "FetchError": + fallthrough + case "MapError": + fallthrough + case "InternalError": + fallthrough + case "ProcessingQueued": + fallthrough + case "Processing": + fallthrough + case "ProcessingError": + fallthrough + case "ValidationQueued": + fallthrough + case "Validating": + fallthrough + case "ValidationError": + fallthrough + case "AuthError": + fallthrough + case "Cancelled": + fallthrough + case "NotSupported": + fallthrough + case "RateLimitError": + fallthrough + case "PermissionsError": + fallthrough + case "PrerequisiteNotMet": + *e = Status(v) + return nil + default: + return fmt.Errorf("invalid value for Status: %v", v) + } +} diff --git a/lending/pkg/models/shared/supplementaldata.go b/lending/pkg/models/shared/supplementaldata.go index edb51f9fc..8e62d3efc 100644 --- a/lending/pkg/models/shared/supplementaldata.go +++ b/lending/pkg/models/shared/supplementaldata.go @@ -1,15 +1,15 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared // 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/supplemental-data/overview) about supplemental data. +// It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. type SupplementalData struct { - Content map[string]map[string]interface{} `json:"content,omitempty"` + Content map[string]map[string]any `json:"content,omitempty"` } -func (o *SupplementalData) GetContent() map[string]map[string]interface{} { +func (o *SupplementalData) GetContent() map[string]map[string]any { if o == nil { return nil } diff --git a/lending/pkg/models/shared/supplierref.go b/lending/pkg/models/shared/supplierref.go index f7b2ca0c3..3373584e0 100644 --- a/lending/pkg/models/shared/supplierref.go +++ b/lending/pkg/models/shared/supplierref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/supplierstatus.go b/lending/pkg/models/shared/supplierstatus.go index 57c2c2c4b..3a697817b 100644 --- a/lending/pkg/models/shared/supplierstatus.go +++ b/lending/pkg/models/shared/supplierstatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e SupplierStatus) ToPointer() *SupplierStatus { return &e } - func (e *SupplierStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/taxcomponentallocation.go b/lending/pkg/models/shared/taxcomponentallocation.go index 101eb920e..65185aa23 100644 --- a/lending/pkg/models/shared/taxcomponentallocation.go +++ b/lending/pkg/models/shared/taxcomponentallocation.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -8,9 +8,9 @@ import ( ) type TaxComponentAllocation struct { - // Tax amount on order line sale as available from source commerce platform. + // Tax amount on order line sale as available from source commerce software. Rate *decimal.Big `decimal:"number" json:"rate,omitempty"` - // Taxes rates reference object depending on the rates being available on source commerce package. + // Taxes rates reference object depending on the rates being available on source commerce software. TaxComponentRef *TaxComponentRef `json:"taxComponentRef,omitempty"` } diff --git a/lending/pkg/models/shared/taxcomponentref.go b/lending/pkg/models/shared/taxcomponentref.go index d3bfadc97..09433deff 100644 --- a/lending/pkg/models/shared/taxcomponentref.go +++ b/lending/pkg/models/shared/taxcomponentref.go @@ -1,8 +1,8 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared -// TaxComponentRef - Taxes rates reference object depending on the rates being available on source commerce package. +// TaxComponentRef - Taxes rates reference object depending on the rates being available on source commerce software. type TaxComponentRef struct { // The unique identitifer of the tax component being referenced. ID string `json:"id"` diff --git a/lending/pkg/models/shared/taxrateref.go b/lending/pkg/models/shared/taxrateref.go index 0330d51f8..0ff620ca7 100644 --- a/lending/pkg/models/shared/taxrateref.go +++ b/lending/pkg/models/shared/taxrateref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -20,9 +20,9 @@ import ( type TaxRateRef struct { // Applicable tax rate. EffectiveTaxRate *decimal.Big `decimal:"number" json:"effectiveTaxRate,omitempty"` - // Unique identifier for the tax rate in the accounting platform. + // Unique identifier for the tax rate in the accounting software. ID *string `json:"id,omitempty"` - // Name of the tax rate in the accounting platform. + // Name of the tax rate in the accounting software. Name *string `json:"name,omitempty"` } diff --git a/lending/pkg/models/shared/tracking.go b/lending/pkg/models/shared/tracking.go index b617cf884..36b3682b7 100644 --- a/lending/pkg/models/shared/tracking.go +++ b/lending/pkg/models/shared/tracking.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/trackingcategoryref.go b/lending/pkg/models/shared/trackingcategoryref.go index 1007b984f..d8677b086 100644 --- a/lending/pkg/models/shared/trackingcategoryref.go +++ b/lending/pkg/models/shared/trackingcategoryref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/trackingrecordref.go b/lending/pkg/models/shared/trackingrecordref.go index 369fc30ff..49495e34e 100644 --- a/lending/pkg/models/shared/trackingrecordref.go +++ b/lending/pkg/models/shared/trackingrecordref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e TrackingRecordRefDataType) ToPointer() *TrackingRecordRefDataType { return &e } - func (e *TrackingRecordRefDataType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/transactioncategory.go b/lending/pkg/models/shared/transactioncategory.go index 54c44307f..c7c6fb12f 100644 --- a/lending/pkg/models/shared/transactioncategory.go +++ b/lending/pkg/models/shared/transactioncategory.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -8,8 +8,10 @@ import ( ) type TransactionCategory struct { - // Returns the confidence of the suggested category for the transaction. The value is between 0 and 100. + // Returns the aggregate confidence of the suggested category for the transaction. The value is between 0 and 100. Confidence *decimal.Big `decimal:"number" json:"confidence,omitempty"` + // An ordered array of category level confidences where each element is the confidence of the corresponding item in the `levels` array. + Confidences []*decimal.Big `decimal:"number" json:"confidences,omitempty"` // The suggested category is an ordered array of category levels where each element (or level) is a subcategory of the previous element (or level). Levels []string `json:"levels,omitempty"` } @@ -32,6 +34,13 @@ func (o *TransactionCategory) GetConfidence() *decimal.Big { return o.Confidence } +func (o *TransactionCategory) GetConfidences() []*decimal.Big { + if o == nil { + return nil + } + return o.Confidences +} + func (o *TransactionCategory) GetLevels() []string { if o == nil { return nil diff --git a/lending/pkg/models/shared/transactioncategoryref.go b/lending/pkg/models/shared/transactioncategoryref.go index a6a9a624f..41b35024e 100644 --- a/lending/pkg/models/shared/transactioncategoryref.go +++ b/lending/pkg/models/shared/transactioncategoryref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/transactioncategorystatus.go b/lending/pkg/models/shared/transactioncategorystatus.go index 0c085a914..654045ca0 100644 --- a/lending/pkg/models/shared/transactioncategorystatus.go +++ b/lending/pkg/models/shared/transactioncategorystatus.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e TransactionCategoryStatus) ToPointer() *TransactionCategoryStatus { return &e } - func (e *TransactionCategoryStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/transactioncode.go b/lending/pkg/models/shared/transactioncode.go index 7f5e8b1d7..2c2caad4d 100644 --- a/lending/pkg/models/shared/transactioncode.go +++ b/lending/pkg/models/shared/transactioncode.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -31,7 +31,6 @@ const ( func (e TransactionCode) ToPointer() *TransactionCode { return &e } - func (e *TransactionCode) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/transactionsourceref.go b/lending/pkg/models/shared/transactionsourceref.go index 5644a71b7..b06484265 100644 --- a/lending/pkg/models/shared/transactionsourceref.go +++ b/lending/pkg/models/shared/transactionsourceref.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/transactionsourcetype.go b/lending/pkg/models/shared/transactionsourcetype.go index d46ae6678..25c652f95 100644 --- a/lending/pkg/models/shared/transactionsourcetype.go +++ b/lending/pkg/models/shared/transactionsourcetype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -21,7 +21,6 @@ const ( func (e TransactionSourceType) ToPointer() *TransactionSourceType { return &e } - func (e *TransactionSourceType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/transactiontype.go b/lending/pkg/models/shared/transactiontype.go index f0a0c42bb..d95f9849d 100644 --- a/lending/pkg/models/shared/transactiontype.go +++ b/lending/pkg/models/shared/transactiontype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -32,7 +32,6 @@ const ( func (e TransactionType) ToPointer() *TransactionType { return &e } - func (e *TransactionType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/transferaccount.go b/lending/pkg/models/shared/transferaccount.go index 0e392d8dd..aa979f582 100644 --- a/lending/pkg/models/shared/transferaccount.go +++ b/lending/pkg/models/shared/transferaccount.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/validation.go b/lending/pkg/models/shared/validation.go index bb4ce0816..9788c88dd 100644 --- a/lending/pkg/models/shared/validation.go +++ b/lending/pkg/models/shared/validation.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/validationitem.go b/lending/pkg/models/shared/validationitem.go index 478e7bb7f..9993cc8f1 100644 --- a/lending/pkg/models/shared/validationitem.go +++ b/lending/pkg/models/shared/validationitem.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared diff --git a/lending/pkg/models/shared/weblink.go b/lending/pkg/models/shared/weblink.go index 990eec6cb..b1ebb4dcc 100644 --- a/lending/pkg/models/shared/weblink.go +++ b/lending/pkg/models/shared/weblink.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package shared @@ -19,7 +19,6 @@ const ( func (e Type) ToPointer() *Type { return &e } - func (e *Type) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { diff --git a/lending/pkg/models/shared/withholdingtaxitems.go b/lending/pkg/models/shared/withholdingtaxitems.go deleted file mode 100644 index c725c6187..000000000 --- a/lending/pkg/models/shared/withholdingtaxitems.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -import ( - "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" - "github.com/ericlagergren/decimal" -) - -type WithholdingTaxItems struct { - // Amount of tax withheld. - Amount *decimal.Big `decimal:"number" json:"amount"` - // Name assigned to withheld tax. - Name string `json:"name"` -} - -func (w WithholdingTaxItems) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(w, "", false) -} - -func (w *WithholdingTaxItems) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { - return err - } - return nil -} - -func (o *WithholdingTaxItems) GetAmount() *decimal.Big { - if o == nil { - return new(decimal.Big).SetFloat64(0.0) - } - return o.Amount -} - -func (o *WithholdingTaxItems) GetName() string { - if o == nil { - return "" - } - return o.Name -} diff --git a/lending/pkg/models/shared/zero.go b/lending/pkg/models/shared/zero.go new file mode 100644 index 000000000..3d3e791d9 --- /dev/null +++ b/lending/pkg/models/shared/zero.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +// ZeroDataType - Allowed name of the 'dataType'. +type ZeroDataType string + +const ( + ZeroDataTypePurchaseOrders ZeroDataType = "purchaseOrders" + ZeroDataTypeBills ZeroDataType = "bills" +) + +func (e ZeroDataType) ToPointer() *ZeroDataType { + return &e +} +func (e *ZeroDataType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "purchaseOrders": + fallthrough + case "bills": + *e = ZeroDataType(v) + return nil + default: + return fmt.Errorf("invalid value for ZeroDataType: %v", v) + } +} + +// Zero - Links the current record line to the underlying record line that created it. +// +// For example, if a bill is generated from a purchase order, this property allows you to connect the bill line item to the purchase order line item in our data model. +type Zero struct { + // Allowed name of the 'dataType'. + DataType *ZeroDataType `json:"dataType,omitempty"` + // 'id' of the underlying record. + ID *string `json:"id,omitempty"` + // Line number of the underlying record. + LineNumber *string `json:"lineNumber,omitempty"` +} + +func (o *Zero) GetDataType() *ZeroDataType { + if o == nil { + return nil + } + return o.DataType +} + +func (o *Zero) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *Zero) GetLineNumber() *string { + if o == nil { + return nil + } + return o.LineNumber +} diff --git a/lending/pkg/models/webhooks/accountcategoriesupdated.go b/lending/pkg/models/webhooks/accountcategoriesupdated.go index 2df64f3cf..9003b6d20 100644 --- a/lending/pkg/models/webhooks/accountcategoriesupdated.go +++ b/lending/pkg/models/webhooks/accountcategoriesupdated.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package webhooks diff --git a/lending/pkg/models/webhooks/clientratelimitreached.go b/lending/pkg/models/webhooks/clientratelimitreached.go index 90ff5ccd3..f9be2dcf5 100644 --- a/lending/pkg/models/webhooks/clientratelimitreached.go +++ b/lending/pkg/models/webhooks/clientratelimitreached.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package webhooks @@ -6,7 +6,7 @@ import ( "net/http" ) -type ClientRateLimitReachedResponse struct { +type ClientRateLimitReachedResponse1 struct { // HTTP response content type for this operation ContentType string // HTTP response status code for this operation @@ -15,21 +15,21 @@ type ClientRateLimitReachedResponse struct { RawResponse *http.Response } -func (o *ClientRateLimitReachedResponse) GetContentType() string { +func (o *ClientRateLimitReachedResponse1) GetContentType() string { if o == nil { return "" } return o.ContentType } -func (o *ClientRateLimitReachedResponse) GetStatusCode() int { +func (o *ClientRateLimitReachedResponse1) GetStatusCode() int { if o == nil { return 0 } return o.StatusCode } -func (o *ClientRateLimitReachedResponse) GetRawResponse() *http.Response { +func (o *ClientRateLimitReachedResponse1) GetRawResponse() *http.Response { if o == nil { return nil } diff --git a/lending/pkg/models/webhooks/clientratelimitreset.go b/lending/pkg/models/webhooks/clientratelimitreset.go index 2d0164927..3a7787447 100644 --- a/lending/pkg/models/webhooks/clientratelimitreset.go +++ b/lending/pkg/models/webhooks/clientratelimitreset.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package webhooks @@ -6,7 +6,7 @@ import ( "net/http" ) -type ClientRateLimitResetResponse struct { +type ClientRateLimitResetResponse1 struct { // HTTP response content type for this operation ContentType string // HTTP response status code for this operation @@ -15,21 +15,21 @@ type ClientRateLimitResetResponse struct { RawResponse *http.Response } -func (o *ClientRateLimitResetResponse) GetContentType() string { +func (o *ClientRateLimitResetResponse1) GetContentType() string { if o == nil { return "" } return o.ContentType } -func (o *ClientRateLimitResetResponse) GetStatusCode() int { +func (o *ClientRateLimitResetResponse1) GetStatusCode() int { if o == nil { return 0 } return o.StatusCode } -func (o *ClientRateLimitResetResponse) GetRawResponse() *http.Response { +func (o *ClientRateLimitResetResponse1) GetRawResponse() *http.Response { if o == nil { return nil } diff --git a/lending/pkg/retry/config.go b/lending/pkg/retry/config.go new file mode 100644 index 000000000..c051b0a46 --- /dev/null +++ b/lending/pkg/retry/config.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package retry + +type BackoffStrategy struct { + InitialInterval int + MaxInterval int + Exponent float64 + MaxElapsedTime int +} + +type Config struct { + Strategy string + Backoff *BackoffStrategy + RetryConnectionErrors bool +} diff --git a/lending/pkg/types/bigint.go b/lending/pkg/types/bigint.go index afd0cd2b8..9c6a086d5 100644 --- a/lending/pkg/types/bigint.go +++ b/lending/pkg/types/bigint.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package types diff --git a/lending/pkg/types/date.go b/lending/pkg/types/date.go index c4648fa96..5b2782f21 100644 --- a/lending/pkg/types/date.go +++ b/lending/pkg/types/date.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package types diff --git a/lending/pkg/types/datetime.go b/lending/pkg/types/datetime.go index 0529b2556..3eff332da 100644 --- a/lending/pkg/types/datetime.go +++ b/lending/pkg/types/datetime.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package types diff --git a/lending/pkg/types/decimal.go b/lending/pkg/types/decimal.go index a42284b92..d8429bc6b 100644 --- a/lending/pkg/types/decimal.go +++ b/lending/pkg/types/decimal.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package types diff --git a/lending/pkg/types/pointers.go b/lending/pkg/types/pointers.go index 4f15e99d4..35c439d26 100644 --- a/lending/pkg/types/pointers.go +++ b/lending/pkg/types/pointers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package types @@ -8,3 +8,4 @@ func Int(i int) *int { return &i } func Int64(i int64) *int64 { return &i } func Float32(f float32) *float32 { return &f } func Float64(f float64) *float64 { return &f } +func Pointer[T any](v T) *T { return &v } diff --git a/lending/pkg/utils/contenttype.go b/lending/pkg/utils/contenttype.go index 8ed13e209..f6487e01e 100644 --- a/lending/pkg/utils/contenttype.go +++ b/lending/pkg/utils/contenttype.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package utils @@ -9,6 +9,10 @@ import ( ) func MatchContentType(contentType string, pattern string) bool { + if contentType == "" { + contentType = "application/octet-stream" + } + if contentType == pattern || pattern == "*" || pattern == "*/*" { return true } diff --git a/lending/pkg/utils/form.go b/lending/pkg/utils/form.go index 9c842fa4c..d2fa6be45 100644 --- a/lending/pkg/utils/form.go +++ b/lending/pkg/utils/form.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package utils diff --git a/lending/pkg/utils/headers.go b/lending/pkg/utils/headers.go index 0837022e2..a07608bdc 100644 --- a/lending/pkg/utils/headers.go +++ b/lending/pkg/utils/headers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package utils @@ -10,14 +10,34 @@ import ( "strings" ) -func PopulateHeaders(ctx context.Context, req *http.Request, headers interface{}) { - headerParamsStructType := reflect.TypeOf(headers) - headerParamsValType := reflect.ValueOf(headers) +func PopulateHeaders(_ context.Context, req *http.Request, headers interface{}, globals interface{}) { + globalsAlreadyPopulated := populateHeaders(headers, globals, req.Header, []string{}) + if globals != nil { + _ = populateHeaders(globals, nil, req.Header, globalsAlreadyPopulated) + } +} + +func populateHeaders(headers interface{}, globals interface{}, reqHeaders http.Header, skipFields []string) []string { + headerParamsStructType, headerParamsValType := dereferencePointers(reflect.TypeOf(headers), reflect.ValueOf(headers)) + + globalsAlreadyPopulated := []string{} for i := 0; i < headerParamsStructType.NumField(); i++ { fieldType := headerParamsStructType.Field(i) valType := headerParamsValType.Field(i) + if contains(skipFields, fieldType.Name) { + continue + } + + if globals != nil { + var globalFound bool + fieldType, valType, globalFound = populateFromGlobals(fieldType, valType, headerParamTagKey, globals) + if globalFound { + globalsAlreadyPopulated = append(globalsAlreadyPopulated, fieldType.Name) + } + } + tag := parseParamTag(headerParamTagKey, fieldType, "simple", false) if tag == nil { continue @@ -25,9 +45,11 @@ func PopulateHeaders(ctx context.Context, req *http.Request, headers interface{} value := serializeHeader(fieldType.Type, valType, tag.Explode) if value != "" { - req.Header.Add(tag.ParamName, value) + reqHeaders.Add(tag.ParamName, value) } } + + return globalsAlreadyPopulated } func serializeHeader(objType reflect.Type, objValue reflect.Value, explode bool) string { diff --git a/lending/pkg/utils/json.go b/lending/pkg/utils/json.go index 256c22253..2eb7e92db 100644 --- a/lending/pkg/utils/json.go +++ b/lending/pkg/utils/json.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package utils @@ -8,6 +8,7 @@ import ( "fmt" "math/big" "reflect" + "strconv" "strings" "time" "unsafe" @@ -164,11 +165,17 @@ func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool if field.Tag.Get("const") != "" { if r, ok := unmarhsaled[fieldName]; ok { val := string(r) + if strings.HasPrefix(val, `"`) && strings.HasSuffix(val, `"`) { - val = val[1 : len(val)-1] + var err error + val, err = strconv.Unquote(val) + if err != nil { + return fmt.Errorf("failed to unquote const field `%s` value `%s`: %w", fieldName, val, err) + } } - if val != field.Tag.Get("const") { - return fmt.Errorf("const field %s does not match expected value %s", fieldName, field.Tag.Get("const")) + constValue := field.Tag.Get("const") + if val != constValue { + return fmt.Errorf("const field `%s` does not match expected value `%s` got `%s`", fieldName, constValue, val) } delete(unmarhsaled, fieldName) @@ -260,6 +267,18 @@ func marshalValue(v interface{}, tag reflect.StructTag) (json.RawMessage, error) typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) switch typ.Kind() { + case reflect.Int64: + format := tag.Get("integer") + if format == "string" { + b := val.Interface().(int64) + return []byte(fmt.Sprintf(`"%d"`, b)), nil + } + case reflect.Float64: + format := tag.Get("number") + if format == "string" { + b := val.Interface().(float64) + return []byte(fmt.Sprintf(`"%g"`, b)), nil + } case reflect.Map: if isNil(typ, val) { return []byte("null"), nil @@ -349,6 +368,16 @@ func handleDefaultConstValue(tagValue string, val interface{}, tag reflect.Struc if bigIntTag == "string" { return []byte(fmt.Sprintf(`"%s"`, tagValue)) } + case reflect.TypeOf(int64(0)): + format := tag.Get("integer") + if format == "string" { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } + case reflect.TypeOf(float64(0)): + format := tag.Get("number") + if format == "string" { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } case reflect.TypeOf(decimal.Big{}): decimalTag := tag.Get("decimal") if decimalTag != "number" { @@ -377,6 +406,57 @@ func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTa typ := dereferenceTypePointer(v.Type()) switch typ.Kind() { + case reflect.Int64: + var b int64 + + format := tag.Get("integer") + if format == "string" { + var s string + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + var err error + b, err = strconv.ParseInt(s, 10, 64) + if err != nil { + return fmt.Errorf("failed to parse string as int64: %w", err) + } + if v.Kind() == reflect.Ptr { + if v.IsNil() { + v.Set(reflect.New(typ)) + } + v = v.Elem() + } + + v.Set(reflect.ValueOf(b)) + return nil + } + case reflect.Float64: + var b float64 + + format := tag.Get("number") + if format == "string" { + var s string + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + var err error + b, err = strconv.ParseFloat(s, 64) + if err != nil { + return fmt.Errorf("failed to parse string as float64: %w", err) + } + + if v.Kind() == reflect.Ptr { + if v.IsNil() { + v.Set(reflect.New(typ)) + } + v = v.Elem() + } + + v.Set(reflect.ValueOf(b)) + return nil + } case reflect.Map: if bytes.Equal(value, []byte("null")) || !isComplexValueType(dereferenceTypePointer(typ.Elem())) { if v.CanAddr() { @@ -407,30 +487,29 @@ func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTa v.Set(m) return nil case reflect.Slice, reflect.Array: - if bytes.Equal(value, []byte("null")) || !isComplexValueType(dereferenceTypePointer(typ.Elem())) { - if v.CanAddr() { - return json.Unmarshal(value, v.Addr().Interface()) - } else { - return json.Unmarshal(value, v.Interface()) - } - } + var unmarshaled []json.RawMessage - var unmarhsaled []json.RawMessage - - if err := json.Unmarshal(value, &unmarhsaled); err != nil { + if err := json.Unmarshal(value, &unmarshaled); err != nil { return err } - arrVal := v + arrVal := reflect.MakeSlice(typ, len(unmarshaled), len(unmarshaled)) - for _, value := range unmarhsaled { + for index, value := range unmarshaled { itemVal := reflect.New(typ.Elem()) if err := unmarshalValue(value, itemVal, tag, disallowUnknownFields); err != nil { return err } - arrVal = reflect.Append(arrVal, itemVal.Elem()) + arrVal.Index(index).Set(itemVal.Elem()) + } + + if v.Kind() == reflect.Pointer { + if v.IsNil() { + v.Set(reflect.New(typ)) + } + v = v.Elem() } v.Set(arrVal) diff --git a/lending/pkg/utils/pathparams.go b/lending/pkg/utils/pathparams.go index c28939056..cc37d1e48 100644 --- a/lending/pkg/utils/pathparams.go +++ b/lending/pkg/utils/pathparams.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package utils @@ -16,18 +16,40 @@ import ( "github.com/codatio/client-sdk-go/lending/v5/pkg/types" ) -func GenerateURL(ctx context.Context, serverURL, path string, pathParams interface{}, globals map[string]map[string]map[string]interface{}) (string, error) { +func GenerateURL(_ context.Context, serverURL, path string, pathParams interface{}, globals interface{}) (string, error) { uri := strings.TrimSuffix(serverURL, "/") + path - pathParamsStructType := reflect.TypeOf(pathParams) - pathParamsValType := reflect.ValueOf(pathParams) - parsedParameters := map[string]string{} + globalsAlreadyPopulated, err := populateParsedParameters(pathParams, globals, parsedParameters, []string{}) + if err != nil { + return "", err + } + + if globals != nil { + _, err = populateParsedParameters(globals, nil, parsedParameters, globalsAlreadyPopulated) + if err != nil { + return "", err + } + } + + // TODO should we handle the case where there are no matching path params? + return ReplaceParameters(uri, parsedParameters), nil +} + +func populateParsedParameters(pathParams interface{}, globals interface{}, parsedParameters map[string]string, skipFields []string) ([]string, error) { + pathParamsStructType, pathParamsValType := dereferencePointers(reflect.TypeOf(pathParams), reflect.ValueOf(pathParams)) + + globalsAlreadyPopulated := []string{} + for i := 0; i < pathParamsStructType.NumField(); i++ { fieldType := pathParamsStructType.Field(i) valType := pathParamsValType.Field(i) + if contains(skipFields, fieldType.Name) { + continue + } + requestTag := getRequestTag(fieldType) if requestTag != nil { continue @@ -38,12 +60,18 @@ func GenerateURL(ctx context.Context, serverURL, path string, pathParams interfa continue } - valType = populateFromGlobals(fieldType, valType, "pathParam", globals) + if globals != nil { + var globalFound bool + fieldType, valType, globalFound = populateFromGlobals(fieldType, valType, pathParamTagKey, globals) + if globalFound { + globalsAlreadyPopulated = append(globalsAlreadyPopulated, fieldType.Name) + } + } if ppTag.Serialization != "" { vals, err := populateSerializedParams(ppTag, fieldType.Type, valType) if err != nil { - return "", err + return nil, err } for k, v := range vals { parsedParameters[k] = url.PathEscape(v) @@ -52,7 +80,7 @@ func GenerateURL(ctx context.Context, serverURL, path string, pathParams interfa // TODO: support other styles switch ppTag.Style { case "simple": - simpleParams := getSimplePathParams(ctx, ppTag.ParamName, fieldType.Type, valType, ppTag.Explode) + simpleParams := getSimplePathParams(ppTag.ParamName, fieldType.Type, valType, ppTag.Explode) for k, v := range simpleParams { parsedParameters[k] = v } @@ -60,11 +88,10 @@ func GenerateURL(ctx context.Context, serverURL, path string, pathParams interfa } } - // TODO should we handle the case where there are no matching path params? - return ReplaceParameters(uri, parsedParameters), nil + return globalsAlreadyPopulated, nil } -func getSimplePathParams(ctx context.Context, parentName string, objType reflect.Type, objValue reflect.Value, explode bool) map[string]string { +func getSimplePathParams(parentName string, objType reflect.Type, objValue reflect.Value, explode bool) map[string]string { pathParams := make(map[string]string) if isNil(objType, objValue) { diff --git a/lending/pkg/utils/queryparams.go b/lending/pkg/utils/queryparams.go index 0e94bcee4..82c209fdc 100644 --- a/lending/pkg/utils/queryparams.go +++ b/lending/pkg/utils/queryparams.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package utils @@ -6,21 +6,55 @@ import ( "context" "encoding/json" "fmt" + "math/big" "net/http" "net/url" "reflect" + "time" + + "github.com/ericlagergren/decimal" + + "github.com/codatio/client-sdk-go/lending/v5/pkg/types" ) -func PopulateQueryParams(ctx context.Context, req *http.Request, queryParams interface{}, globals map[string]map[string]map[string]interface{}) error { - queryParamsStructType := reflect.TypeOf(queryParams) - queryParamsValType := reflect.ValueOf(queryParams) +func PopulateQueryParams(_ context.Context, req *http.Request, queryParams interface{}, globals interface{}) error { + // Query parameters may already be present from overriding URL + if req.URL.RawQuery != "" { + return nil + } values := url.Values{} + globalsAlreadyPopulated, err := populateQueryParams(queryParams, globals, values, []string{}) + if err != nil { + return err + } + + if globals != nil { + _, err = populateQueryParams(globals, nil, values, globalsAlreadyPopulated) + if err != nil { + return err + } + } + + req.URL.RawQuery = values.Encode() + + return nil +} + +func populateQueryParams(queryParams interface{}, globals interface{}, values url.Values, skipFields []string) ([]string, error) { + queryParamsStructType, queryParamsValType := dereferencePointers(reflect.TypeOf(queryParams), reflect.ValueOf(queryParams)) + + globalsAlreadyPopulated := []string{} + for i := 0; i < queryParamsStructType.NumField(); i++ { fieldType := queryParamsStructType.Field(i) valType := queryParamsValType.Field(i) + if contains(skipFields, fieldType.Name) { + continue + } + requestTag := getRequestTag(fieldType) if requestTag != nil { continue @@ -31,12 +65,18 @@ func PopulateQueryParams(ctx context.Context, req *http.Request, queryParams int continue } - valType = populateFromGlobals(fieldType, valType, "queryParam", globals) + if globals != nil { + var globalFound bool + fieldType, valType, globalFound = populateFromGlobals(fieldType, valType, queryParamTagKey, globals) + if globalFound { + globalsAlreadyPopulated = append(globalsAlreadyPopulated, fieldType.Name) + } + } if qpTag.Serialization != "" { vals, err := populateSerializedParams(qpTag, fieldType.Type, valType) if err != nil { - return err + return nil, err } for k, v := range vals { values.Add(k, v) @@ -44,35 +84,33 @@ func PopulateQueryParams(ctx context.Context, req *http.Request, queryParams int } else { switch qpTag.Style { case "deepObject": - vals := populateDeepObjectParams(req, qpTag, fieldType.Type, valType) + vals := populateDeepObjectParams(qpTag, fieldType.Type, valType) for k, v := range vals { for _, vv := range v { values.Add(k, vv) } } case "form": - vals := populateFormParams(req, qpTag, fieldType.Type, valType, ",") + vals := populateFormParams(qpTag, fieldType.Type, valType, ",") for k, v := range vals { for _, vv := range v { values.Add(k, vv) } } case "pipeDelimited": - vals := populateFormParams(req, qpTag, fieldType.Type, valType, "|") + vals := populateFormParams(qpTag, fieldType.Type, valType, "|") for k, v := range vals { for _, vv := range v { values.Add(k, vv) } } default: - return fmt.Errorf("unsupported style: %s", qpTag.Style) + return nil, fmt.Errorf("unsupported style: %s", qpTag.Style) } } } - req.URL.RawQuery = values.Encode() - - return nil + return globalsAlreadyPopulated, nil } func populateSerializedParams(tag *paramTag, objType reflect.Type, objValue reflect.Value) (map[string]string, error) { @@ -98,64 +136,107 @@ func populateSerializedParams(tag *paramTag, objType reflect.Type, objValue refl return values, nil } -func populateDeepObjectParams(req *http.Request, tag *paramTag, objType reflect.Type, objValue reflect.Value) url.Values { +func populateDeepObjectParams(tag *paramTag, objType reflect.Type, objValue reflect.Value) url.Values { values := url.Values{} if isNil(objType, objValue) { return values } - if objType.Kind() == reflect.Pointer { - objType = objType.Elem() + if objValue.Kind() == reflect.Pointer { objValue = objValue.Elem() } - switch objType.Kind() { + switch objValue.Kind() { + case reflect.Map: + populateDeepObjectParamsMap(values, tag.ParamName, objValue) case reflect.Struct: - for i := 0; i < objType.NumField(); i++ { - fieldType := objType.Field(i) - valType := objValue.Field(i) + populateDeepObjectParamsStruct(values, tag.ParamName, objValue) + } - if isNil(fieldType.Type, valType) { - continue - } + return values +} - if fieldType.Type.Kind() == reflect.Pointer { - valType = valType.Elem() - } +func populateDeepObjectParamsArray(qsValues url.Values, priorScope string, value reflect.Value) { + if value.Kind() != reflect.Array && value.Kind() != reflect.Slice { + return + } - qpTag := parseQueryParamTag(fieldType) - if qpTag == nil { - continue - } + for i := 0; i < value.Len(); i++ { + qsValues.Add(priorScope, valToString(value.Index(i).Interface())) + } +} - switch valType.Kind() { - case reflect.Array, reflect.Slice: - for i := 0; i < valType.Len(); i++ { - values.Add(fmt.Sprintf("%s[%s]", tag.ParamName, qpTag.ParamName), valToString(valType.Index(i).Interface())) - } - default: - values.Add(fmt.Sprintf("%s[%s]", tag.ParamName, qpTag.ParamName), valToString(valType.Interface())) - } +func populateDeepObjectParamsMap(qsValues url.Values, priorScope string, mapValue reflect.Value) { + if mapValue.Kind() != reflect.Map { + return + } + + iter := mapValue.MapRange() + + for iter.Next() { + scope := priorScope + "[" + iter.Key().String() + "]" + iterValue := iter.Value() + + switch iterValue.Kind() { + case reflect.Array, reflect.Slice: + populateDeepObjectParamsArray(qsValues, scope, iterValue) + case reflect.Map: + populateDeepObjectParamsMap(qsValues, scope, iterValue) + default: + qsValues.Add(scope, valToString(iterValue.Interface())) } - case reflect.Map: - iter := objValue.MapRange() - for iter.Next() { - switch iter.Value().Kind() { - case reflect.Array, reflect.Slice: - for i := 0; i < iter.Value().Len(); i++ { - values.Add(fmt.Sprintf("%s[%s]", tag.ParamName, iter.Key().String()), valToString(iter.Value().Index(i).Interface())) - } - default: - values.Add(fmt.Sprintf("%s[%s]", tag.ParamName, iter.Key().String()), valToString(iter.Value().Interface())) + } +} + +func populateDeepObjectParamsStruct(qsValues url.Values, priorScope string, structValue reflect.Value) { + if structValue.Kind() != reflect.Struct { + return + } + + structType := structValue.Type() + + for i := 0; i < structType.NumField(); i++ { + field := structType.Field(i) + fieldValue := structValue.Field(i) + + if isNil(field.Type, fieldValue) { + continue + } + + if fieldValue.Kind() == reflect.Pointer { + fieldValue = fieldValue.Elem() + } + + qpTag := parseQueryParamTag(field) + + if qpTag == nil { + continue + } + + scope := priorScope + "[" + qpTag.ParamName + "]" + + switch fieldValue.Kind() { + case reflect.Array, reflect.Slice: + populateDeepObjectParamsArray(qsValues, scope, fieldValue) + case reflect.Map: + populateDeepObjectParamsMap(qsValues, scope, fieldValue) + case reflect.Struct: + switch fieldValue.Type() { + case reflect.TypeOf(big.Int{}), reflect.TypeOf(decimal.Big{}), reflect.TypeOf(time.Time{}), reflect.TypeOf(types.Date{}): + qsValues.Add(scope, valToString(fieldValue.Interface())) + + continue } + + populateDeepObjectParamsStruct(qsValues, scope, fieldValue) + default: + qsValues.Add(scope, valToString(fieldValue.Interface())) } } - - return values } -func populateFormParams(req *http.Request, tag *paramTag, objType reflect.Type, objValue reflect.Value, delimiter string) url.Values { +func populateFormParams(tag *paramTag, objType reflect.Type, objValue reflect.Value, delimiter string) url.Values { return populateForm(tag.ParamName, tag.Explode, objType, objValue, delimiter, func(fieldType reflect.StructField) string { qpTag := parseQueryParamTag(fieldType) if qpTag == nil { diff --git a/lending/pkg/utils/requestbody.go b/lending/pkg/utils/requestbody.go index 950f39a31..000226ef9 100644 --- a/lending/pkg/utils/requestbody.go +++ b/lending/pkg/utils/requestbody.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package utils @@ -25,7 +25,20 @@ var ( urlEncodedEncodingRegex = regexp.MustCompile(`application\/x-www-form-urlencoded.*`) ) -func SerializeRequestBody(ctx context.Context, request interface{}, nullable, optional bool, requestFieldName, serializationMethod, tag string) (io.Reader, string, error) { +func SerializeRequestBody(_ context.Context, request interface{}, nullable, optional bool, requestFieldName, serializationMethod, tag string) (io.Reader, string, error) { + bodyReader, contentType, err := serializeRequestBody(request, nullable, optional, requestFieldName, serializationMethod, tag) + if err != nil { + return nil, "", fmt.Errorf("error serializing request body: %w", err) + } + + if bodyReader == nil && !optional { + return nil, "", fmt.Errorf("request body is required") + } + + return bodyReader, contentType, nil +} + +func serializeRequestBody(request interface{}, nullable, optional bool, requestFieldName, serializationMethod, tag string) (io.Reader, string, error) { requestStructType := reflect.TypeOf(request) requestValType := reflect.ValueOf(request) @@ -53,15 +66,16 @@ func SerializeRequestBody(ctx context.Context, request interface{}, nullable, op if tag != nil { // request object (non-flattened) requestVal := requestValType.FieldByName(requestFieldName) + val := reflect.ValueOf(requestVal.Interface()) if isNil(requestField.Type, requestVal) { if !nullable && optional { return nil, "", nil } - return serializeContentType(requestFieldName, tag.MediaType, requestVal, string(requestField.Tag)) + return serializeContentType(requestFieldName, tag.MediaType, val, string(requestField.Tag)) } - return serializeContentType(requestFieldName, tag.MediaType, requestVal, string(requestField.Tag)) + return serializeContentType(requestFieldName, tag.MediaType, val, string(requestField.Tag)) } } @@ -69,7 +83,7 @@ func SerializeRequestBody(ctx context.Context, request interface{}, nullable, op return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], reflect.ValueOf(request), tag) } -func serializeContentType(fieldName string, mediaType string, val reflect.Value, tag string) (*bytes.Buffer, string, error) { +func serializeContentType(fieldName string, mediaType string, val reflect.Value, tag string) (io.Reader, string, error) { buf := &bytes.Buffer{} if isNil(val.Type(), val) { @@ -103,6 +117,8 @@ func serializeContentType(fieldName string, mediaType string, val reflect.Value, if err := encodeFormData(fieldName, buf, val.Interface()); err != nil { return nil, "", err } + case val.Type().Implements(reflect.TypeOf((*io.Reader)(nil)).Elem()): + return val.Interface().(io.Reader), mediaType, nil default: val = reflect.Indirect(val) @@ -111,8 +127,8 @@ func serializeContentType(fieldName string, mediaType string, val reflect.Value, if _, err := buf.WriteString(valToString(val.Interface())); err != nil { return nil, "", err } - case val.Type() == reflect.TypeOf([]byte(nil)): - if _, err := buf.Write(val.Bytes()); err != nil { + case reflect.TypeOf(val.Interface()) == reflect.TypeOf([]byte(nil)): + if _, err := buf.Write(val.Interface().([]byte)); err != nil { return nil, "", err } default: @@ -202,7 +218,7 @@ func encodeMultipartFormDataFile(w *multipart.Writer, fieldType reflect.Type, va var fieldName string var fileName string - var content []byte + var reader io.Reader for i := 0; i < fieldType.NumField(); i++ { field := fieldType.Field(i) @@ -213,15 +229,19 @@ func encodeMultipartFormDataFile(w *multipart.Writer, fieldType reflect.Type, va continue } - if tag.Content { - content = val.Bytes() + if tag.Content && val.CanInterface() { + if reflect.TypeOf(val.Interface()) == reflect.TypeOf([]byte(nil)) { + reader = bytes.NewReader(val.Interface().([]byte)) + } else if reflect.TypeOf(val.Interface()).Implements(reflect.TypeOf((*io.Reader)(nil)).Elem()) { + reader = val.Interface().(io.Reader) + } } else { fieldName = tag.Name fileName = val.String() } } - if fieldName == "" || fileName == "" || content == nil { + if fieldName == "" || fileName == "" || reader == nil { return fmt.Errorf("invalid multipart/form-data file") } @@ -229,7 +249,7 @@ func encodeMultipartFormDataFile(w *multipart.Writer, fieldType reflect.Type, va if err != nil { return err } - if _, err := fw.Write(content); err != nil { + if _, err := io.Copy(fw, reader); err != nil { return err } diff --git a/lending/pkg/utils/retries.go b/lending/pkg/utils/retries.go index ff39d0d84..f08f93875 100644 --- a/lending/pkg/utils/retries.go +++ b/lending/pkg/utils/retries.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package utils @@ -6,32 +6,25 @@ import ( "context" "errors" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "net/http" "net/url" "strconv" "strings" "time" - - "github.com/cenkalti/backoff/v4" ) var errRequestFailed = errors.New("request failed") -type BackoffStrategy struct { - InitialInterval int - MaxInterval int - Exponent float64 - MaxElapsedTime int -} +// Deprecated: Use retry.BackoffStrategy instead. +type BackoffStrategy = retry.BackoffStrategy -type RetryConfig struct { - Strategy string - Backoff *BackoffStrategy - RetryConnectionErrors bool -} +// Deprecated: Use retry.Config instead. +type RetryConfig = retry.Config type Retries struct { - Config *RetryConfig + Config *retry.Config StatusCodes []string } diff --git a/lending/pkg/utils/security.go b/lending/pkg/utils/security.go index ea1d4b2df..19dfa6f46 100644 --- a/lending/pkg/utils/security.go +++ b/lending/pkg/utils/security.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package utils @@ -11,10 +11,6 @@ import ( "strings" ) -type HTTPClient interface { - Do(req *http.Request) (*http.Response, error) -} - const ( securityTagKey = "security" ) @@ -25,75 +21,27 @@ type securityTag struct { Name string Type string SubType string + Env string } -type securityConfig struct { - headers map[string]string - queryParams map[string]string -} - -type SecurityClient struct { - HTTPClient - security func(ctx context.Context) (interface{}, error) -} - -func newSecurityClient(client HTTPClient, security func(ctx context.Context) (interface{}, error)) *SecurityClient { - return &SecurityClient{ - HTTPClient: client, - security: security, +func PopulateSecurity(ctx context.Context, req *http.Request, securitySource func(context.Context) (interface{}, error)) error { + if securitySource == nil { + return nil } -} -func (c *SecurityClient) Do(req *http.Request) (*http.Response, error) { - securityCtx, err := c.security(req.Context()) + security, err := securitySource(ctx) if err != nil { - return nil, err + return err } - ctx := securityConfig{ - headers: make(map[string]string), - queryParams: make(map[string]string), - } - parseSecurityStruct(&ctx, securityCtx) - - for k, v := range ctx.headers { - req.Header.Set(k, v) - } - - queryParams := req.URL.Query() - - for k, v := range ctx.queryParams { - queryParams.Add(k, v) - } - - req.URL.RawQuery = queryParams.Encode() - - return c.HTTPClient.Do(req) -} - -func ConfigureSecurityClient(c HTTPClient, security func(ctx context.Context) (interface{}, error)) *SecurityClient { - return newSecurityClient(c, security) -} - -func trueReflectValue(val reflect.Value) reflect.Value { - kind := val.Type().Kind() - for kind == reflect.Interface || kind == reflect.Ptr { - innerVal := val.Elem() - if !innerVal.IsValid() { - break - } - val = innerVal - kind = val.Type().Kind() - } - return val -} + headers := make(map[string]string) + queryParams := make(map[string]string) -func parseSecurityStruct(c *securityConfig, security interface{}) { securityValType := trueReflectValue(reflect.ValueOf(security)) securityStructType := securityValType.Type() if isNil(securityStructType, securityValType) { - return + return nil } if securityStructType.Kind() == reflect.Ptr { @@ -118,25 +66,37 @@ func parseSecurityStruct(c *securityConfig, security interface{}) { secTag := parseSecurityTag(fieldType) if secTag != nil { if secTag.Option { - handleSecurityOption(c, valType.Interface()) + handleSecurityOption(headers, queryParams, valType.Interface()) } else if secTag.Scheme { // Special case for basic auth which could be a flattened struct if secTag.SubType == "basic" && kind != reflect.Struct { - parseSecurityScheme(c, secTag, security) + parseSecurityScheme(headers, queryParams, secTag, security) } else { - parseSecurityScheme(c, secTag, valType.Interface()) + parseSecurityScheme(headers, queryParams, secTag, valType.Interface()) } } } } + + for key, value := range headers { + req.Header.Add(key, value) + } + + query := req.URL.Query() + for key, value := range queryParams { + query.Add(key, value) + } + req.URL.RawQuery = query.Encode() + + return nil } -func handleSecurityOption(c *securityConfig, option interface{}) error { +func handleSecurityOption(headers, queryParams map[string]string, option interface{}) { optionValType := trueReflectValue(reflect.ValueOf(option)) optionStructType := optionValType.Type() if isNil(optionStructType, optionValType) { - return nil + return } for i := 0; i < optionStructType.NumField(); i++ { @@ -145,14 +105,12 @@ func handleSecurityOption(c *securityConfig, option interface{}) error { secTag := parseSecurityTag(fieldType) if secTag != nil && secTag.Scheme { - parseSecurityScheme(c, secTag, valType.Interface()) + parseSecurityScheme(headers, queryParams, secTag, valType.Interface()) } } - - return nil } -func parseSecurityScheme(client *securityConfig, schemeTag *securityTag, scheme interface{}) { +func parseSecurityScheme(headers, queryParams map[string]string, schemeTag *securityTag, scheme interface{}) { schemeVal := trueReflectValue(reflect.ValueOf(scheme)) schemeType := schemeVal.Type() @@ -161,9 +119,14 @@ func parseSecurityScheme(client *securityConfig, schemeTag *securityTag, scheme } if schemeType.Kind() == reflect.Struct { - if schemeTag.Type == "http" && schemeTag.SubType == "basic" { - handleBasicAuthScheme(client, schemeVal.Interface()) - return + if schemeTag.Type == "http" { + switch schemeTag.SubType { + case "basic": + handleBasicAuthScheme(headers, schemeVal.Interface()) + return + case "custom": + return + } } for i := 0; i < schemeType.NumField(); i++ { @@ -183,34 +146,37 @@ func parseSecurityScheme(client *securityConfig, schemeTag *securityTag, scheme return } - parseSecuritySchemeValue(client, schemeTag, secTag, valType.Interface()) + parseSecuritySchemeValue(headers, queryParams, schemeTag, secTag, valType.Interface()) } } else { - parseSecuritySchemeValue(client, schemeTag, schemeTag, schemeVal.Interface()) + parseSecuritySchemeValue(headers, queryParams, schemeTag, schemeTag, schemeVal.Interface()) } } -func parseSecuritySchemeValue(client *securityConfig, schemeTag *securityTag, secTag *securityTag, val interface{}) { +func parseSecuritySchemeValue(headers, queryParams map[string]string, schemeTag *securityTag, secTag *securityTag, val interface{}) { switch schemeTag.Type { case "apiKey": switch schemeTag.SubType { case "header": - client.headers[secTag.Name] = valToString(val) + headers[secTag.Name] = valToString(val) case "query": - client.queryParams[secTag.Name] = valToString(val) + queryParams[secTag.Name] = valToString(val) case "cookie": - client.headers["Cookie"] = fmt.Sprintf("%s=%s", secTag.Name, valToString(val)) + headers["Cookie"] = fmt.Sprintf("%s=%s", secTag.Name, valToString(val)) default: panic("not supported") } case "openIdConnect": - client.headers[secTag.Name] = prefixBearer(valToString(val)) + headers[secTag.Name] = prefixBearer(valToString(val)) case "oauth2": - client.headers[secTag.Name] = prefixBearer(valToString(val)) + if schemeTag.SubType != "client_credentials" { + headers[secTag.Name] = prefixBearer(valToString(val)) + } case "http": switch schemeTag.SubType { case "bearer": - client.headers[secTag.Name] = prefixBearer(valToString(val)) + headers[secTag.Name] = prefixBearer(valToString(val)) + case "custom": default: panic("not supported") } @@ -227,7 +193,7 @@ func prefixBearer(authHeaderValue string) string { return fmt.Sprintf("Bearer %s", authHeaderValue) } -func handleBasicAuthScheme(client *securityConfig, scheme interface{}) { +func handleBasicAuthScheme(headers map[string]string, scheme interface{}) { schemeStructType := reflect.TypeOf(scheme) schemeValType := reflect.ValueOf(scheme) @@ -237,6 +203,10 @@ func handleBasicAuthScheme(client *securityConfig, scheme interface{}) { fieldType := schemeStructType.Field(i) valType := schemeValType.Field(i) + if fieldType.Type.Kind() == reflect.Ptr { + valType = valType.Elem() + } + secTag := parseSecurityTag(fieldType) if secTag == nil || secTag.Name == "" { continue @@ -250,7 +220,7 @@ func handleBasicAuthScheme(client *securityConfig, scheme interface{}) { } } - client.headers["Authorization"] = fmt.Sprintf("Basic %s", base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", username, password)))) + headers["Authorization"] = fmt.Sprintf("Basic %s", base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", username, password)))) } func parseSecurityTag(field reflect.StructField) *securityTag { @@ -264,6 +234,7 @@ func parseSecurityTag(field reflect.StructField) *securityTag { name := "" securityType := "" securitySubType := "" + env := "" options := strings.Split(tag, ",") for _, optionConf := range options { @@ -283,6 +254,8 @@ func parseSecurityTag(field reflect.StructField) *securityTag { option = true case "scheme": scheme = true + case "env": + env = parts[1] } } @@ -294,5 +267,19 @@ func parseSecurityTag(field reflect.StructField) *securityTag { Name: name, Type: securityType, SubType: securitySubType, + Env: env, } } + +func trueReflectValue(val reflect.Value) reflect.Value { + kind := val.Type().Kind() + for kind == reflect.Interface || kind == reflect.Ptr { + innerVal := val.Elem() + if !innerVal.IsValid() { + break + } + val = innerVal + kind = val.Type().Kind() + } + return val +} diff --git a/lending/pkg/utils/utils.go b/lending/pkg/utils/utils.go index b4618bb35..adb2f7055 100644 --- a/lending/pkg/utils/utils.go +++ b/lending/pkg/utils/utils.go @@ -1,13 +1,15 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package utils import ( + "context" "fmt" "io" "math/big" "reflect" "regexp" + "strconv" "strings" "time" @@ -63,6 +65,35 @@ func Contains(slice []string, item string) bool { return false } +func MatchStatusCodes(expectedCodes []string, statusCode int) bool { + for _, codeStr := range expectedCodes { + code, err := strconv.Atoi(codeStr) + if err == nil { + if code == statusCode { + return true + } + continue + } + + codeRange, err := strconv.Atoi(string(codeStr[0])) + if err != nil { + continue + } + + if statusCode >= (codeRange*100) && statusCode < ((codeRange+1)*100) { + return true + } + } + + return false +} + +func AsSecuritySource(security interface{}) func(context.Context) (interface{}, error) { + return func(context.Context) (interface{}, error) { + return security, nil + } +} + func parseStructTag(tagKey string, field reflect.StructField) map[string]string { tag := field.Tag.Get(tagKey) if tag == "" { @@ -134,23 +165,43 @@ func valToString(val interface{}) string { } } -func populateFromGlobals(fieldType reflect.StructField, valType reflect.Value, paramType string, globals map[string]map[string]map[string]interface{}) reflect.Value { - if globals != nil && fieldType.Type.Kind() == reflect.Ptr { - parameters, ok := globals["parameters"] - if ok { - paramsOfType, ok := parameters[paramType] - if ok { - globalVal, ok := paramsOfType[fieldType.Name] - if ok { - if reflect.TypeOf(globalVal).Kind() == fieldType.Type.Elem().Kind() && valType.IsNil() { - valType = reflect.ValueOf(&globalVal) - } - } - } +func populateFromGlobals(fieldType reflect.StructField, valType reflect.Value, paramType string, globals interface{}) (reflect.StructField, reflect.Value, bool) { + if globals == nil { + return fieldType, valType, false + } + + globalsStruct := reflect.TypeOf(globals) + globalsStructVal := reflect.ValueOf(globals) + + globalsField, found := globalsStruct.FieldByName(fieldType.Name) + if !found { + return fieldType, valType, false + } + + if fieldType.Type.Kind() != reflect.Ptr || !valType.IsNil() { + return fieldType, valType, true + } + + globalsVal := globalsStructVal.FieldByName(fieldType.Name) + + if !globalsVal.IsValid() { + return fieldType, valType, false + } + + switch paramType { + case queryParamTagKey: + qpTag := parseQueryParamTag(globalsField) + if qpTag == nil { + return fieldType, valType, false + } + default: + tag := parseParamTag(paramType, fieldType, "simple", false) + if tag == nil { + return fieldType, valType, false } } - return valType + return globalsField, globalsVal, true } func isNil(typ reflect.Type, val reflect.Value) bool { @@ -168,3 +219,12 @@ func isNil(typ reflect.Type, val reflect.Value) bool { return false } + +func contains(arr []string, str string) bool { + for _, a := range arr { + if a == str { + return true + } + } + return false +} diff --git a/lending/productcategories.go b/lending/productcategories.go index 76fa71ab6..d72b92cfe 100644 --- a/lending/productcategories.go +++ b/lending/productcategories.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newProductCategories(sdkConfig sdkConfiguration) *ProductCategories { // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *ProductCategories) Get(ctx context.Context, request operations.GetCommerceProductCategoryRequest, opts ...operations.Option) (*operations.GetCommerceProductCategoryResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-commerce-product-category", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *ProductCategories) Get(ctx context.Context, request operations.GetComme return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-productCategories/{productId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-productCategories/{productId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *ProductCategories) Get(ctx context.Context, request operations.GetComme }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCommerceProductCategoryResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceProductCategory if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *ProductCategories) Get(ctx context.Context, request operations.GetComme res.CommerceProductCategory = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *ProductCategories) Get(ctx context.Context, request operations.GetComme fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List product categories @@ -169,9 +280,17 @@ func (s *ProductCategories) Get(ctx context.Context, request operations.GetComme // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *ProductCategories) List(ctx context.Context, request operations.ListCommerceProductCategoriesRequest, opts ...operations.Option) (*operations.ListCommerceProductCategoriesResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-commerce-product-categories", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *ProductCategories) List(ctx context.Context, request operations.ListCom return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-productCategories", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-productCategories", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *ProductCategories) List(ctx context.Context, request operations.ListCom }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListCommerceProductCategoriesResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceProductCategories if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *ProductCategories) List(ctx context.Context, request operations.ListCom res.CommerceProductCategories = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *ProductCategories) List(ctx context.Context, request operations.ListCom fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/products.go b/lending/products.go index 43d4ac081..7cb91f18b 100644 --- a/lending/products.go +++ b/lending/products.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newProducts(sdkConfig sdkConfiguration) *Products { // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Products) Get(ctx context.Context, request operations.GetCommerceProductRequest, opts ...operations.Option) (*operations.GetCommerceProductResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-commerce-product", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *Products) Get(ctx context.Context, request operations.GetCommerceProduc return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-products/{productId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-products/{productId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *Products) Get(ctx context.Context, request operations.GetCommerceProduc }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCommerceProductResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceProduct if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *Products) Get(ctx context.Context, request operations.GetCommerceProduc res.CommerceProduct = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *Products) Get(ctx context.Context, request operations.GetCommerceProduc fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List products @@ -169,9 +280,17 @@ func (s *Products) Get(ctx context.Context, request operations.GetCommerceProduc // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Products) List(ctx context.Context, request operations.ListCommerceProductsRequest, opts ...operations.Option) (*operations.ListCommerceProductsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-commerce-products", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *Products) List(ctx context.Context, request operations.ListCommerceProd return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-products", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/commerce-products", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *Products) List(ctx context.Context, request operations.ListCommerceProd }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListCommerceProductsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.CommerceProducts if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *Products) List(ctx context.Context, request operations.ListCommerceProd res.CommerceProducts = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *Products) List(ctx context.Context, request operations.ListCommerceProd fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/profitandloss.go b/lending/profitandloss.go index 0a999efe6..eebb06cac 100644 --- a/lending/profitandloss.go +++ b/lending/profitandloss.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -27,9 +30,17 @@ func newProfitAndLoss(sdkConfig sdkConfiguration) *ProfitAndLoss { // Get profit and loss // Gets the latest profit and loss for a company. func (s *ProfitAndLoss) Get(ctx context.Context, request operations.GetAccountingProfitAndLossRequest, opts ...operations.Option) (*operations.GetAccountingProfitAndLossResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-profit-and-loss", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -37,32 +48,47 @@ func (s *ProfitAndLoss) Get(ctx context.Context, request operations.GetAccountin return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/financials/profitAndLoss", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/financials/profitAndLoss", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -70,53 +96,109 @@ func (s *ProfitAndLoss) Get(ctx context.Context, request operations.GetAccountin }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingProfitAndLossResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingProfitAndLossReport if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -124,7 +206,12 @@ func (s *ProfitAndLoss) Get(ctx context.Context, request operations.GetAccountin res.AccountingProfitAndLossReport = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -142,22 +229,46 @@ func (s *ProfitAndLoss) Get(ctx context.Context, request operations.GetAccountin fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetCategorizedAccounts - Get categorized profit and loss statement @@ -165,9 +276,17 @@ func (s *ProfitAndLoss) Get(ctx context.Context, request operations.GetAccountin // // Codat suggests a category for each account automatically, but you can [change it](https://docs.codat.io/lending/enhanced-financials/overview#categorize-accounts) to a more suitable one. func (s *ProfitAndLoss) GetCategorizedAccounts(ctx context.Context, request operations.GetCategorizedProfitAndLossStatementRequest, opts ...operations.Option) (*operations.GetCategorizedProfitAndLossStatementResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-categorized-profit-and-loss-statement", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -175,32 +294,47 @@ func (s *ProfitAndLoss) GetCategorizedAccounts(ctx context.Context, request oper return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/enhancedProfitAndLoss/accounts", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/enhancedProfitAndLoss/accounts", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -208,53 +342,109 @@ func (s *ProfitAndLoss) GetCategorizedAccounts(ctx context.Context, request oper }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCategorizedProfitAndLossStatementResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.EnhancedFinancialReport if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -262,7 +452,12 @@ func (s *ProfitAndLoss) GetCategorizedAccounts(ctx context.Context, request oper res.EnhancedFinancialReport = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -280,20 +475,44 @@ func (s *ProfitAndLoss) GetCategorizedAccounts(ctx context.Context, request oper fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/pulloperations.go b/lending/pulloperations.go index a11b54daf..7ee8cc20a 100644 --- a/lending/pulloperations.go +++ b/lending/pulloperations.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -27,9 +30,17 @@ func newPullOperations(sdkConfig sdkConfiguration) *PullOperations { // Get pull operation // Retrieve information about a single dataset or pull operation. func (s *PullOperations) Get(ctx context.Context, request operations.GetPullOperationRequest, opts ...operations.Option) (*operations.GetPullOperationResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-pull-operation", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -37,28 +48,43 @@ func (s *PullOperations) Get(ctx context.Context, request operations.GetPullOper return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/history/{datasetId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/history/{datasetId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -66,53 +92,109 @@ func (s *PullOperations) Get(ctx context.Context, request operations.GetPullOper }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetPullOperationResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.PullOperation if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -120,7 +202,12 @@ func (s *PullOperations) Get(ctx context.Context, request operations.GetPullOper res.PullOperation = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -136,30 +223,62 @@ func (s *PullOperations) Get(ctx context.Context, request operations.GetPullOper fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List pull operations // Gets the pull operation history (datasets) for a given company. func (s *PullOperations) List(ctx context.Context, request operations.ListPullOperationsRequest, opts ...operations.Option) (*operations.ListPullOperationsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-pull-operations", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -167,32 +286,47 @@ func (s *PullOperations) List(ctx context.Context, request operations.ListPullOp return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/history", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/history", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -200,53 +334,109 @@ func (s *PullOperations) List(ctx context.Context, request operations.ListPullOp }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListPullOperationsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.PullOperations if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -254,7 +444,12 @@ func (s *PullOperations) List(ctx context.Context, request operations.ListPullOp res.PullOperations = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -272,20 +467,44 @@ func (s *PullOperations) List(ctx context.Context, request operations.ListPullOp fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/refresh.go b/lending/refresh.go index 481f1fa1c..21672e5cc 100644 --- a/lending/refresh.go +++ b/lending/refresh.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -31,9 +34,17 @@ func newRefresh(sdkConfig sdkConfiguration) *Refresh { // // [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. func (s *Refresh) AllDataTypes(ctx context.Context, request operations.RefreshAllDataTypesRequest, opts ...operations.Option) (*operations.RefreshAllDataTypesResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "refresh-all-data-types", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -41,28 +52,43 @@ func (s *Refresh) AllDataTypes(ctx context.Context, request operations.RefreshAl return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/all", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/all", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -70,49 +96,100 @@ func (s *Refresh) AllDataTypes(ctx context.Context, request operations.RefreshAl }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.RefreshAllDataTypesResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 204: case httpRes.StatusCode == 401: @@ -129,22 +206,46 @@ func (s *Refresh) AllDataTypes(ctx context.Context, request operations.RefreshAl fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // DataType - Refresh data type @@ -152,9 +253,17 @@ func (s *Refresh) AllDataTypes(ctx context.Context, request operations.RefreshAl // // This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. func (s *Refresh) DataType(ctx context.Context, request operations.RefreshDataTypeRequest, opts ...operations.Option) (*operations.RefreshDataTypeResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "refresh-data-type", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -162,32 +271,47 @@ func (s *Refresh) DataType(ctx context.Context, request operations.RefreshDataTy return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/queue/{dataType}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/queue/{dataType}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -195,53 +319,109 @@ func (s *Refresh) DataType(ctx context.Context, request operations.RefreshDataTy }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.RefreshDataTypeResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.PullOperation if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -249,7 +429,12 @@ func (s *Refresh) DataType(ctx context.Context, request operations.RefreshDataTy res.PullOperation = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -265,20 +450,44 @@ func (s *Refresh) DataType(ctx context.Context, request operations.RefreshDataTy fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/reports.go b/lending/reports.go index 6efb01c1a..0f25d950d 100644 --- a/lending/reports.go +++ b/lending/reports.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -27,9 +30,17 @@ func newReports(sdkConfig sdkConfiguration) *Reports { // GetAgedCreditors - Aged creditors report // Returns aged creditors report for company that shows the total balance owed by a business to its suppliers over time. func (s *Reports) GetAgedCreditors(ctx context.Context, request operations.GetAccountingAgedCreditorsReportRequest, opts ...operations.Option) (*operations.GetAccountingAgedCreditorsReportResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-aged-creditors-report", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -37,32 +48,47 @@ func (s *Reports) GetAgedCreditors(ctx context.Context, request operations.GetAc return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/agedCreditor", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/agedCreditor", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -70,53 +96,109 @@ func (s *Reports) GetAgedCreditors(ctx context.Context, request operations.GetAc }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingAgedCreditorsReportResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingAgedCreditorReport if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -124,7 +206,12 @@ func (s *Reports) GetAgedCreditors(ctx context.Context, request operations.GetAc res.AccountingAgedCreditorReport = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -140,30 +227,62 @@ func (s *Reports) GetAgedCreditors(ctx context.Context, request operations.GetAc fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetAgedDebtors - Aged debtors report // Returns aged debtors report for company that shows the total outstanding balance due from customers to the business over time. func (s *Reports) GetAgedDebtors(ctx context.Context, request operations.GetAccountingAgedDebtorsReportRequest, opts ...operations.Option) (*operations.GetAccountingAgedDebtorsReportResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-aged-debtors-report", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -171,32 +290,47 @@ func (s *Reports) GetAgedDebtors(ctx context.Context, request operations.GetAcco return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/agedDebtor", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/agedDebtor", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -204,53 +338,109 @@ func (s *Reports) GetAgedDebtors(ctx context.Context, request operations.GetAcco }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingAgedDebtorsReportResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingAgedDebtorReport if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -258,7 +448,12 @@ func (s *Reports) GetAgedDebtors(ctx context.Context, request operations.GetAcco res.AccountingAgedDebtorReport = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -274,30 +469,62 @@ func (s *Reports) GetAgedDebtors(ctx context.Context, request operations.GetAcco fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // IsAgedCreditorsAvailable - Aged creditors report available // Indicates whether the aged creditor report is available for the company. func (s *Reports) IsAgedCreditorsAvailable(ctx context.Context, request operations.IsAgedCreditorsReportAvailableRequest, opts ...operations.Option) (*operations.IsAgedCreditorsReportAvailableResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "is-aged-creditors-report-available", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -305,28 +532,43 @@ func (s *Reports) IsAgedCreditorsAvailable(ctx context.Context, request operatio return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/agedCreditor/available", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/agedCreditor/available", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -334,53 +576,109 @@ func (s *Reports) IsAgedCreditorsAvailable(ctx context.Context, request operatio }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.IsAgedCreditorsReportAvailableResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out bool if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -388,7 +686,12 @@ func (s *Reports) IsAgedCreditorsAvailable(ctx context.Context, request operatio res.Boolean = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -404,30 +707,62 @@ func (s *Reports) IsAgedCreditorsAvailable(ctx context.Context, request operatio fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // IsAgedDebtorsAvailable - Aged debtors report available // Indicates whether the aged debtors report is available for the company. func (s *Reports) IsAgedDebtorsAvailable(ctx context.Context, request operations.IsAgedDebtorsReportAvailableRequest, opts ...operations.Option) (*operations.IsAgedDebtorsReportAvailableResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "is-aged-debtors-report-available", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -435,28 +770,43 @@ func (s *Reports) IsAgedDebtorsAvailable(ctx context.Context, request operations return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/agedDebtor/available", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/reports/agedDebtor/available", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -464,53 +814,109 @@ func (s *Reports) IsAgedDebtorsAvailable(ctx context.Context, request operations }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.IsAgedDebtorsReportAvailableResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out bool if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -518,7 +924,12 @@ func (s *Reports) IsAgedDebtorsAvailable(ctx context.Context, request operations res.Boolean = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -534,20 +945,44 @@ func (s *Reports) IsAgedDebtorsAvailable(ctx context.Context, request operations fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/sales.go b/lending/sales.go index 2049b0d6f..ede294be3 100644 --- a/lending/sales.go +++ b/lending/sales.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending diff --git a/lending/suppliers.go b/lending/suppliers.go index c8c2bae23..bbc06b635 100644 --- a/lending/suppliers.go +++ b/lending/suppliers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -31,10 +34,17 @@ func newSuppliers(sdkConfig sdkConfiguration) *Suppliers { // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support downloading a supplier attachment. func (s *Suppliers) DownloadAttachment(ctx context.Context, request operations.DownloadAccountingSupplierAttachmentRequest, opts ...operations.Option) (*operations.DownloadAccountingSupplierAttachmentResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "download-accounting-supplier-attachment", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, - operations.SupportedOptionAcceptHeaderOverride, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -42,33 +52,43 @@ func (s *Suppliers) DownloadAttachment(ctx context.Context, request operations.D return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/suppliers/{supplierId}/attachments/{attachmentId}/download", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/suppliers/{supplierId}/attachments/{attachmentId}/download", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout } - if o.AcceptHeaderOverride != nil { - req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) - } else { - req.Header.Set("Accept", "application/json;q=1, application/octet-stream;q=0") + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/octet-stream") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -76,60 +96,114 @@ func (s *Suppliers) DownloadAttachment(ctx context.Context, request operations.D }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.DownloadAccountingSupplierAttachmentResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - if (httpRes.StatusCode == 200) && utils.MatchContentType(contentType, `application/octet-stream`) { - res.Data = httpRes.Body - - return res, nil + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/octet-stream`): + res.Data = httpRes.Body + + return res, nil default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -145,22 +219,46 @@ func (s *Suppliers) DownloadAttachment(ctx context.Context, request operations.D fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // Get supplier @@ -172,9 +270,17 @@ func (s *Suppliers) DownloadAttachment(ctx context.Context, request operations.D // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Suppliers) Get(ctx context.Context, request operations.GetAccountingSupplierRequest, opts ...operations.Option) (*operations.GetAccountingSupplierResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-supplier", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -182,28 +288,43 @@ func (s *Suppliers) Get(ctx context.Context, request operations.GetAccountingSup return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/suppliers/{supplierId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/suppliers/{supplierId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -211,53 +332,109 @@ func (s *Suppliers) Get(ctx context.Context, request operations.GetAccountingSup }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingSupplierResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingSupplier if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -265,7 +442,12 @@ func (s *Suppliers) Get(ctx context.Context, request operations.GetAccountingSup res.AccountingSupplier = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -283,22 +465,46 @@ func (s *Suppliers) Get(ctx context.Context, request operations.GetAccountingSup fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetAttachment - Get supplier attachment @@ -308,9 +514,17 @@ func (s *Suppliers) Get(ctx context.Context, request operations.GetAccountingSup // // 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 supplier attachment. func (s *Suppliers) GetAttachment(ctx context.Context, request operations.GetAccountingSupplierAttachmentRequest, opts ...operations.Option) (*operations.GetAccountingSupplierAttachmentResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-accounting-supplier-attachment", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -318,28 +532,43 @@ func (s *Suppliers) GetAttachment(ctx context.Context, request operations.GetAcc return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/suppliers/{supplierId}/attachments/{attachmentId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/suppliers/{supplierId}/attachments/{attachmentId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -347,53 +576,109 @@ func (s *Suppliers) GetAttachment(ctx context.Context, request operations.GetAcc }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetAccountingSupplierAttachmentResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingAttachment if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -401,7 +686,12 @@ func (s *Suppliers) GetAttachment(ctx context.Context, request operations.GetAcc res.AccountingAttachment = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -417,22 +707,46 @@ func (s *Suppliers) GetAttachment(ctx context.Context, request operations.GetAcc fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List suppliers @@ -442,9 +756,17 @@ func (s *Suppliers) GetAttachment(ctx context.Context, request operations.GetAcc // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *Suppliers) List(ctx context.Context, request operations.ListAccountingSuppliersRequest, opts ...operations.Option) (*operations.ListAccountingSuppliersResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-suppliers", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -452,32 +774,47 @@ func (s *Suppliers) List(ctx context.Context, request operations.ListAccountingS return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/suppliers", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/data/suppliers", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -485,53 +822,109 @@ func (s *Suppliers) List(ctx context.Context, request operations.ListAccountingS }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingSuppliersResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingSuppliers if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -539,7 +932,12 @@ func (s *Suppliers) List(ctx context.Context, request operations.ListAccountingS res.AccountingSuppliers = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -559,22 +957,46 @@ func (s *Suppliers) List(ctx context.Context, request operations.ListAccountingS fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // ListAttachments - List supplier attachments @@ -584,9 +1006,17 @@ func (s *Suppliers) List(ctx context.Context, request operations.ListAccountingS // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support listing supplier attachments. func (s *Suppliers) ListAttachments(ctx context.Context, request operations.ListAccountingSupplierAttachmentsRequest, opts ...operations.Option) (*operations.ListAccountingSupplierAttachmentsResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-accounting-supplier-attachments", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -594,28 +1024,43 @@ func (s *Suppliers) ListAttachments(ctx context.Context, request operations.List return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/suppliers/{supplierId}/attachments", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/suppliers/{supplierId}/attachments", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -623,53 +1068,109 @@ func (s *Suppliers) ListAttachments(ctx context.Context, request operations.List }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListAccountingSupplierAttachmentsResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.Attachments if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -677,7 +1178,12 @@ func (s *Suppliers) ListAttachments(ctx context.Context, request operations.List res.Attachments = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -695,20 +1201,44 @@ func (s *Suppliers) ListAttachments(ctx context.Context, request operations.List fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/transactioncategories.go b/lending/transactioncategories.go index c30972e51..c9d77a844 100644 --- a/lending/transactioncategories.go +++ b/lending/transactioncategories.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -33,9 +36,17 @@ func newTransactionCategories(sdkConfig sdkConfiguration) *TransactionCategories // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *TransactionCategories) Get(ctx context.Context, request operations.GetBankingTransactionCategoryRequest, opts ...operations.Option) (*operations.GetBankingTransactionCategoryResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-banking-transaction-category", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -43,28 +54,43 @@ func (s *TransactionCategories) Get(ctx context.Context, request operations.GetB return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/banking-transactionCategories/{transactionCategoryId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/banking-transactionCategories/{transactionCategoryId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -72,53 +98,109 @@ func (s *TransactionCategories) Get(ctx context.Context, request operations.GetB }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetBankingTransactionCategoryResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.BankingTransactionCategory if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -126,7 +208,12 @@ func (s *TransactionCategories) Get(ctx context.Context, request operations.GetB res.BankingTransactionCategory = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -144,22 +231,46 @@ func (s *TransactionCategories) Get(ctx context.Context, request operations.GetB fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // List transaction categories @@ -169,9 +280,17 @@ func (s *TransactionCategories) Get(ctx context.Context, request operations.GetB // // Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). func (s *TransactionCategories) List(ctx context.Context, request operations.ListBankingTransactionCategoriesRequest, opts ...operations.Option) (*operations.ListBankingTransactionCategoriesResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-banking-transaction-categories", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -179,32 +298,47 @@ func (s *TransactionCategories) List(ctx context.Context, request operations.Lis return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/banking-transactionCategories", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/data/banking-transactionCategories", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -212,53 +346,109 @@ func (s *TransactionCategories) List(ctx context.Context, request operations.Lis }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "409", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.ListBankingTransactionCategoriesResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.BankingTransactionCategories if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -266,7 +456,12 @@ func (s *TransactionCategories) List(ctx context.Context, request operations.Lis res.BankingTransactionCategories = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -286,20 +481,44 @@ func (s *TransactionCategories) List(ctx context.Context, request operations.Lis fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } diff --git a/lending/transactions.go b/lending/transactions.go index 3e9b90f01..ffbc02e84 100644 --- a/lending/transactions.go +++ b/lending/transactions.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending diff --git a/lending/transfers.go b/lending/transfers.go index 7ff6b8b64..0733832fb 100644 --- a/lending/transfers.go +++ b/lending/transfers.go @@ -1,4 +1,4 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package lending @@ -6,9 +6,12 @@ import ( "bytes" "context" "fmt" + "github.com/cenkalti/backoff/v4" + "github.com/codatio/client-sdk-go/lending/v5/internal/hooks" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/operations" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/sdkerrors" "github.com/codatio/client-sdk-go/lending/v5/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v5/pkg/retry" "github.com/codatio/client-sdk-go/lending/v5/pkg/utils" "io" "net/http" @@ -35,9 +38,17 @@ func newTransfers(sdkConfig sdkConfiguration) *Transfers { // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=transfers) for integrations that support creating an account. func (s *Transfers) Create(ctx context.Context, request operations.CreateTransferRequest, opts ...operations.Option) (*operations.CreateTransferResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "create-transfer", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -45,39 +56,53 @@ func (s *Transfers) Create(ctx context.Context, request operations.CreateTransfe return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/transfers", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/transfers", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, true, true, "AccountingTransfer", "json", `request:"mediaType=application/json"`) if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -85,53 +110,109 @@ func (s *Transfers) Create(ctx context.Context, request operations.CreateTransfe }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } - contentType := httpRes.Header.Get("Content-Type") + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.CreateTransferResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.AccountingCreateTransferResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -139,7 +220,12 @@ func (s *Transfers) Create(ctx context.Context, request operations.CreateTransfe res.AccountingCreateTransferResponse = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: fallthrough @@ -157,22 +243,46 @@ func (s *Transfers) Create(ctx context.Context, request operations.CreateTransfe fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + } // GetCreateModel - Get create transfer model @@ -186,9 +296,17 @@ func (s *Transfers) Create(ctx context.Context, request operations.CreateTransfe // // Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=transfers) for integrations that support creating a transfer. func (s *Transfers) GetCreateModel(ctx context.Context, request operations.GetCreateTransfersModelRequest, opts ...operations.Option) (*operations.GetCreateTransfersModelResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-create-transfers-model", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, } for _, opt := range opts { @@ -196,28 +314,43 @@ func (s *Transfers) GetCreateModel(ctx context.Context, request operations.GetCr return nil, fmt.Errorf("error applying option: %w", err) } } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/transfers", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/transfers", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - client := s.sdkConfiguration.SecurityClient + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } globalRetryConfig := s.sdkConfiguration.RetryConfig retryConfig := o.Retries if retryConfig == nil { - if globalRetryConfig == nil { - retryConfig = &utils.RetryConfig{ - Strategy: "backoff", - Backoff: &utils.BackoffStrategy{ + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ InitialInterval: 500, MaxInterval: 60000, Exponent: 1.5, @@ -225,53 +358,109 @@ func (s *Transfers) GetCreateModel(ctx context.Context, request operations.GetCr }, RetryConnectionErrors: true, } - } else { - retryConfig = globalRetryConfig } } - httpRes, err := utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "408", - "429", - "5XX", - }, - }, func() (*http.Response, error) { - if req.Body != nil { - copyBody, err := req.GetBody() + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - req.Body = copyBody } - return client.Do(req) - }) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } + } else { + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } - contentType := httpRes.Header.Get("Content-Type") + _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } res := &operations.GetCreateTransfersModelResponse{ StatusCode: httpRes.StatusCode, - ContentType: contentType, + ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) + getRawBody := func() ([]byte, error) { + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + return rawBody, nil } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out shared.PushOption if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err @@ -279,7 +468,12 @@ func (s *Transfers) GetCreateModel(ctx context.Context, request operations.GetCr res.PushOption = &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 401: fallthrough @@ -295,20 +489,44 @@ func (s *Transfers) GetCreateModel(ctx context.Context, request operations.GetCr fallthrough case httpRes.StatusCode == 503: switch { - case utils.MatchContentType(contentType, `application/json`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + var out sdkerrors.ErrorMessage if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } + return nil, &out default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := getRawBody() + if err != nil { + return nil, err + } + + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) } return res, nil + }